Skip to content

Commit 5961d7a

Browse files
aledbfclaude
andcommitted
fix(oci): keep the tag of a tag@digest Feature reference
Bump the pinned reference CLI to v0.90.0 and port its one source change (devcontainers/cli#1311): getRef now splits a tag off the resource of a `name:tag@sha256:…` reference, so `resource` no longer ends in `:tag` and `tag` is reported next to `digest`. The digest still selects the version. The ts-oracle getRef goldens gain the two upstream test inputs (a tag with a digest, and a registry port with both), regenerated from v0.90.0 with `task testdata:ts-oracle`; the existing `z:1@sha256:…` case now expects the split. The other goldens are unchanged under v0.90.0. v0.90.0's other fix is to its npm install script, which this CLI does not ship. The recorded divergence on a digest that fails the pattern (TS logs it and keeps the reference, ParseRef refuses it) stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 609e5d7 commit 5961d7a

7 files changed

Lines changed: 63 additions & 9 deletions

File tree

‎.github/workflows/go-cli.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
167167
if: always()
168168
with:
169-
name: parity-contract-network-v0.89.0
169+
name: parity-contract-network-v0.90.0
170170
path: artifacts/
171171
if-no-files-found: error
172172
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
@@ -269,7 +269,7 @@ jobs:
269269
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
270270
if: always() && steps.plan.outputs.run == 'true'
271271
with:
272-
name: parity-runtime-v0.89.0-shard-${{ matrix.shard }}
272+
name: parity-runtime-v0.90.0-shard-${{ matrix.shard }}
273273
path: artifacts/
274274
if-no-files-found: error
275275
# daily only: covdata slice for the cross-lane merge (distinct name per shard).

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ GitHub Releases are not supported targets. “Compatible” means compatibility
121121
this scope; it does not mean that every platform or historical upstream behavior is
122122
implemented.
123123

124-
A pinned official TypeScript CLI (`reference/`, currently v0.89.0) is the behavioral
124+
A pinned official TypeScript CLI (`reference/`, currently v0.90.0) is the behavioral
125125
oracle. Roughly 200 cases run commands through both CLIs and compare exit status,
126126
normalized output, and relevant container or registry state. See the
127127
[parity matrix](docs/parity/parity-matrix.yaml) and

‎docs/DIVERGENCES.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Divergences, decisions & accepted limitations
22

33
This CLI is validated for behavioral parity with the reference TypeScript
4-
`@devcontainers/cli` (pinned at **v0.89.0**, see [`parity/`](parity/)). Where it
4+
`@devcontainers/cli` (pinned at **v0.90.0**, see [`parity/`](parity/)). Where it
55
deliberately differs, the difference is recorded here — this is the durable record of
66
*intentional* departures from the oracle, not a backlog. User-facing additions are
77
documented in [`go-only-features.md`](go-only-features.md).
@@ -71,9 +71,9 @@ touches a compared surface, reflected in the parity matrix.
7171
earlier unconditional build-arg.
7272
- **Two upstream fixes newer than the pinned reference are already ported.** A
7373
`${localEnv:VAR:default}` or `${containerEnv:VAR:default}` default keeps its colons
74-
(`my.registry.io:5000/img`; upstream #1213), where v0.89.0 keeps the text up to the next
74+
(`my.registry.io:5000/img`; upstream #1213), where v0.90.0 keeps the text up to the next
7575
colon. A read-only mount keeps `:ro` in the Compose override (upstream #881), where
76-
v0.89.0's `convertMountToVolume` drops `readonly`. The `testdata/ts-oracle` goldens
76+
v0.90.0's `convertMountToVolume` drops `readonly`. The `testdata/ts-oracle` goldens
7777
record both as divergence cases.
7878
- **Dockerfile instructions are read with BuildKit's parser**, not with the reference's
7979
regular expressions, when resolving the base image and the `USER` of a Dockerfile.

‎internal/oci/ref.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func ParseRef(input string) (*Ref, error) {
6565

6666
if indexOfLastAt != -1 {
6767
resource = input[:indexOfLastAt]
68+
if sep := strings.LastIndex(resource, ":"); sep > strings.LastIndex(resource, "/") {
69+
tag = resource[sep+1:]
70+
resource = resource[:sep]
71+
}
6872
digestWithAlgo := input[indexOfLastAt+1:]
6973
parts := strings.Split(digestWithAlgo, ":")
7074
if len(parts) != 2 {

‎internal/oci/ref_test.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ func tsRef(r *Ref) map[string]string {
1515
}
1616
if r.Digest != "" {
1717
out["digest"] = r.Digest
18-
} else {
18+
}
19+
if r.Tag != "" || r.Digest == "" {
1920
out["tag"] = r.Tag
2021
}
2122
return out

‎internal/oci/testdata/ts-oracle/ref.json‎

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,18 @@
721721
"args": [
722722
"ghcr.io/x/y/z:1@sha256:1234567890123456789012345678901234567890123456789012345678901234"
723723
],
724-
"result": null
724+
"result": {
725+
"scheme": "https",
726+
"id": "z",
727+
"owner": "x",
728+
"namespace": "x/y",
729+
"registry": "ghcr.io",
730+
"resource": "ghcr.io/x/y/z",
731+
"path": "x/y/z",
732+
"version": "sha256:1234567890123456789012345678901234567890123456789012345678901234",
733+
"tag": "1",
734+
"digest": "sha256:1234567890123456789012345678901234567890123456789012345678901234"
735+
}
725736
},
726737
{
727738
"name": "ghcr.io devcontainers/templates",
@@ -966,6 +977,44 @@
966977
"a/b/c/d"
967978
],
968979
"result": "a/b/c/d"
980+
},
981+
{
982+
"name": "tag and digest",
983+
"fn": "getRef",
984+
"args": [
985+
"mcr.microsoft.com/devcontainers/go:2.3.1-1.27-bookworm@sha256:adc326255c019241228f9da4a1cb5d6a89abaaa0eb8d926a355b00af7daafd00"
986+
],
987+
"result": {
988+
"scheme": "https",
989+
"id": "go",
990+
"owner": "devcontainers",
991+
"namespace": "devcontainers",
992+
"registry": "mcr.microsoft.com",
993+
"resource": "mcr.microsoft.com/devcontainers/go",
994+
"path": "devcontainers/go",
995+
"version": "sha256:adc326255c019241228f9da4a1cb5d6a89abaaa0eb8d926a355b00af7daafd00",
996+
"tag": "2.3.1-1.27-bookworm",
997+
"digest": "sha256:adc326255c019241228f9da4a1cb5d6a89abaaa0eb8d926a355b00af7daafd00"
998+
}
999+
},
1000+
{
1001+
"name": "registry port, tag and digest",
1002+
"fn": "getRef",
1003+
"args": [
1004+
"docker.io:8001/devcontainers/templates/docker-from-docker:1.3.4@sha256:4ef08c9c3b708f3c2faecc5a898b39736423dd639f09f2a9f8bf9b0b9252ef0a"
1005+
],
1006+
"result": {
1007+
"scheme": "https",
1008+
"id": "docker-from-docker",
1009+
"owner": "devcontainers",
1010+
"namespace": "devcontainers/templates",
1011+
"registry": "docker.io:8001",
1012+
"resource": "docker.io:8001/devcontainers/templates/docker-from-docker",
1013+
"path": "devcontainers/templates/docker-from-docker",
1014+
"version": "sha256:4ef08c9c3b708f3c2faecc5a898b39736423dd639f09f2a9f8bf9b0b9252ef0a",
1015+
"tag": "1.3.4",
1016+
"digest": "sha256:4ef08c9c3b708f3c2faecc5a898b39736423dd639f09f2a9f8bf9b0b9252ef0a"
1017+
}
9691018
}
9701019
]
9711020
}

0 commit comments

Comments
 (0)