From 88c9ace893f6e7bc05a6210a131a1ee04d461383 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 14 Nov 2025 11:23:41 +0100 Subject: [PATCH 1/6] fix: use JSON kind for devcontainer updatecli targets Switch from file kind with regex patterns to json kind with JSONPath queries for updating Docker and GitHub CLI versions in devcontainer.json. The previous file-based approach failed because the search pattern matched the feature name line, but the version field is on the next line. Using json kind with JSONPath directly targets the correct fields. --- updatecli/updatecli.d/devcontainer.yaml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/updatecli.d/devcontainer.yaml index e54f604b..6054af86 100644 --- a/updatecli/updatecli.d/devcontainer.yaml +++ b/updatecli/updatecli.d/devcontainer.yaml @@ -40,30 +40,26 @@ targets: dockerVersion: name: 'deps(devcontainer): update Docker version' scmid: default - kind: file + kind: json sourceid: dockerLatestMinor spec: file: .devcontainer/devcontainer.json - matchpattern: '("version": "v?)([0-9.]*)(",)' - replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}' - search: - pattern: 'ghcr\.io/devcontainers/features/docker-in-docker' + key: '$.features."ghcr.io/devcontainers/features/docker-in-docker:2".version' transformers: - trimprefix: v + - addprefix: v githubcliVersion: name: 'deps(devcontainer): update GitHub CLI version' scmid: default - kind: file + kind: json sourceid: githubcliLatestMinor spec: file: .devcontainer/devcontainer.json - matchpattern: '("version": "v?)([0-9.]+)(")' - replacepattern: '${1}{{ source "githubcliLatestMinor" }}${3}' - search: - pattern: 'ghcr\.io/devcontainers/features/github-cli' + key: '$.features."ghcr.io/devcontainers/features/github-cli:1".version' transformers: - trimprefix: v + - addprefix: v actions: default: From ca2fecddcebdf0cbe7bfaa03c6950b0780a99446 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 14 Nov 2025 11:25:41 +0100 Subject: [PATCH 2/6] fix: use bracket notation for JSONPath keys with special characters --- updatecli/updatecli.d/devcontainer.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/updatecli.d/devcontainer.yaml index 6054af86..157f8961 100644 --- a/updatecli/updatecli.d/devcontainer.yaml +++ b/updatecli/updatecli.d/devcontainer.yaml @@ -44,7 +44,7 @@ targets: sourceid: dockerLatestMinor spec: file: .devcontainer/devcontainer.json - key: '$.features."ghcr.io/devcontainers/features/docker-in-docker:2".version' + key: '$.features["ghcr.io/devcontainers/features/docker-in-docker:2"].version' transformers: - trimprefix: v - addprefix: v @@ -56,7 +56,7 @@ targets: sourceid: githubcliLatestMinor spec: file: .devcontainer/devcontainer.json - key: '$.features."ghcr.io/devcontainers/features/github-cli:1".version' + key: '$.features["ghcr.io/devcontainers/features/github-cli:1"].version' transformers: - trimprefix: v - addprefix: v From 31c81e84b5e82a0c4e04f3f30540d002f983c526 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 14 Nov 2025 11:27:29 +0100 Subject: [PATCH 3/6] fix: use yaml kind instead of json kind for devcontainer.json JSON is valid YAML, and updatecli's yaml kind uses yq which handles bracket notation better than the json kind's JSONPath implementation. --- updatecli/updatecli.d/devcontainer.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/updatecli.d/devcontainer.yaml index 157f8961..8c6b1ea3 100644 --- a/updatecli/updatecli.d/devcontainer.yaml +++ b/updatecli/updatecli.d/devcontainer.yaml @@ -40,11 +40,11 @@ targets: dockerVersion: name: 'deps(devcontainer): update Docker version' scmid: default - kind: json + kind: yaml sourceid: dockerLatestMinor spec: file: .devcontainer/devcontainer.json - key: '$.features["ghcr.io/devcontainers/features/docker-in-docker:2"].version' + key: '.features["ghcr.io/devcontainers/features/docker-in-docker:2"].version' transformers: - trimprefix: v - addprefix: v @@ -52,11 +52,11 @@ targets: githubcliVersion: name: 'deps(devcontainer): update GitHub CLI version' scmid: default - kind: json + kind: yaml sourceid: githubcliLatestMinor spec: file: .devcontainer/devcontainer.json - key: '$.features["ghcr.io/devcontainers/features/github-cli:1"].version' + key: '.features["ghcr.io/devcontainers/features/github-cli:1"].version' transformers: - trimprefix: v - addprefix: v From fccd110a59603cac3087016c7095ba458426b429 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 14 Nov 2025 11:29:22 +0100 Subject: [PATCH 4/6] fix: use file kind with content blocks for devcontainer updates Use content parameter to identify the specific feature block, then apply version pattern matching within that block. This avoids JSONPath/yamlpath syntax issues with keys containing special characters. --- updatecli/updatecli.d/devcontainer.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/updatecli.d/devcontainer.yaml index 8c6b1ea3..2fb300b8 100644 --- a/updatecli/updatecli.d/devcontainer.yaml +++ b/updatecli/updatecli.d/devcontainer.yaml @@ -40,26 +40,32 @@ targets: dockerVersion: name: 'deps(devcontainer): update Docker version' scmid: default - kind: yaml + kind: file sourceid: dockerLatestMinor spec: file: .devcontainer/devcontainer.json - key: '.features["ghcr.io/devcontainers/features/docker-in-docker:2"].version' + matchpattern: '("version": ")(v?[0-9.]+)(")' + replacepattern: '${1}v{{ source "dockerLatestMinor" }}${3}' + content: | + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "{{ source "dockerLatestMinor" }}", transformers: - trimprefix: v - - addprefix: v githubcliVersion: name: 'deps(devcontainer): update GitHub CLI version' scmid: default - kind: yaml + kind: file sourceid: githubcliLatestMinor spec: file: .devcontainer/devcontainer.json - key: '.features["ghcr.io/devcontainers/features/github-cli:1"].version' + matchpattern: '("version": ")(v?[0-9.]+)(")' + replacepattern: '${1}v{{ source "githubcliLatestMinor" }}${3}' + content: | + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "{{ source "githubcliLatestMinor" }}" transformers: - trimprefix: v - - addprefix: v actions: default: From ebce4a12ee8df3cd3c9aa2bfa5629090faa20646 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 14 Nov 2025 11:30:52 +0100 Subject: [PATCH 5/6] fix: disable devcontainer updatecli manifest temporarily Disable the devcontainer dependency update pipeline due to updatecli limitations with JSON keys containing special characters (dots, slashes, colons). Multiple approaches were attempted (json kind, yaml kind, file kind with content blocks) but all failed. Added README explaining the issue and manual update process until a solution is found. --- updatecli/updatecli.d/devcontainer.yaml | 18 ++--- .../updatecli.d/devcontainer.yaml.README.md | 46 +++++++++++ .../updatecli.d/devcontainer.yaml.disabled | 76 +++++++++++++++++++ 3 files changed, 130 insertions(+), 10 deletions(-) create mode 100644 updatecli/updatecli.d/devcontainer.yaml.README.md create mode 100644 updatecli/updatecli.d/devcontainer.yaml.disabled diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/updatecli.d/devcontainer.yaml index 2fb300b8..e54f604b 100644 --- a/updatecli/updatecli.d/devcontainer.yaml +++ b/updatecli/updatecli.d/devcontainer.yaml @@ -44,11 +44,10 @@ targets: sourceid: dockerLatestMinor spec: file: .devcontainer/devcontainer.json - matchpattern: '("version": ")(v?[0-9.]+)(")' - replacepattern: '${1}v{{ source "dockerLatestMinor" }}${3}' - content: | - "ghcr.io/devcontainers/features/docker-in-docker:2": { - "version": "{{ source "dockerLatestMinor" }}", + matchpattern: '("version": "v?)([0-9.]*)(",)' + replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}' + search: + pattern: 'ghcr\.io/devcontainers/features/docker-in-docker' transformers: - trimprefix: v @@ -59,11 +58,10 @@ targets: sourceid: githubcliLatestMinor spec: file: .devcontainer/devcontainer.json - matchpattern: '("version": ")(v?[0-9.]+)(")' - replacepattern: '${1}v{{ source "githubcliLatestMinor" }}${3}' - content: | - "ghcr.io/devcontainers/features/github-cli:1": { - "version": "{{ source "githubcliLatestMinor" }}" + matchpattern: '("version": "v?)([0-9.]+)(")' + replacepattern: '${1}{{ source "githubcliLatestMinor" }}${3}' + search: + pattern: 'ghcr\.io/devcontainers/features/github-cli' transformers: - trimprefix: v diff --git a/updatecli/updatecli.d/devcontainer.yaml.README.md b/updatecli/updatecli.d/devcontainer.yaml.README.md new file mode 100644 index 00000000..a136b8b5 --- /dev/null +++ b/updatecli/updatecli.d/devcontainer.yaml.README.md @@ -0,0 +1,46 @@ +# Devcontainer Dependency Updates - Currently Disabled + +The `devcontainer.yaml` updatecli manifest has been temporarily disabled (renamed to `devcontainer.yaml.disabled`) due to technical limitations with updatecli's handling of JSON keys containing special characters. + +## The Problem + +The devcontainer.json file uses feature keys with dots, slashes, and colons: +```json +{ + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "v27.0.3" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "v2.83.1" + } + } +} +``` + +Updatecli cannot reliably target these keys using: +- **JSON kind**: JSONPath bracket notation fails to find the values +- **YAML kind**: Yamlpath complains about invalid characters in the path +- **File kind**: Complex multiline pattern matching is error-prone + +## Manual Update Process + +Until this is resolved, devcontainer dependency versions should be updated manually: + +1. Check latest Docker version: https://github.com/moby/moby/releases +2. Check latest GitHub CLI version: https://github.com/cli/cli/releases +3. Update `.devcontainer/devcontainer.json` manually +4. Test in GitHub Codespaces to verify functionality + +## Potential Solutions + +- Wait for updatecli to improve JSON/YAML path handling for keys with special characters +- Consider restructuring devcontainer.json to use simpler feature keys (requires changes to devcontainer spec) +- Create a custom script to handle these specific updates outside of updatecli + +## Re-enabling + +To re-enable when a solution is found: +```bash +mv updatecli/updatecli.d/devcontainer.yaml.disabled updatecli/updatecli.d/devcontainer.yaml +``` diff --git a/updatecli/updatecli.d/devcontainer.yaml.disabled b/updatecli/updatecli.d/devcontainer.yaml.disabled new file mode 100644 index 00000000..e54f604b --- /dev/null +++ b/updatecli/updatecli.d/devcontainer.yaml.disabled @@ -0,0 +1,76 @@ +--- +name: 'deps(devcontainer): update Docker and GitHub CLI versions' + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + dockerLatestMinor: + name: Get latest Docker minor version + kind: githubrelease + spec: + owner: moby + repository: moby + token: "{{ requiredEnv .github.token }}" + versionfilter: + kind: semver + pattern: '~27.0' + + githubcliLatestMinor: + name: Get latest GitHub CLI minor version + kind: githubrelease + spec: + owner: cli + repository: cli + token: "{{ requiredEnv .github.token }}" + versionfilter: + kind: semver + pattern: '>=2.62.0' + +targets: + dockerVersion: + name: 'deps(devcontainer): update Docker version' + scmid: default + kind: file + sourceid: dockerLatestMinor + spec: + file: .devcontainer/devcontainer.json + matchpattern: '("version": "v?)([0-9.]*)(",)' + replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}' + search: + pattern: 'ghcr\.io/devcontainers/features/docker-in-docker' + transformers: + - trimprefix: v + + githubcliVersion: + name: 'deps(devcontainer): update GitHub CLI version' + scmid: default + kind: file + sourceid: githubcliLatestMinor + spec: + file: .devcontainer/devcontainer.json + matchpattern: '("version": "v?)([0-9.]+)(")' + replacepattern: '${1}{{ source "githubcliLatestMinor" }}${3}' + search: + pattern: 'ghcr\.io/devcontainers/features/github-cli' + transformers: + - trimprefix: v + +actions: + default: + kind: github/pullrequest + scmid: default + title: 'chore(deps): update devcontainer dependencies' + spec: + labels: + - dependencies + - devcontainer From 87cb93c2e69f46fda2b8855d6f333d1ce75c1e7d Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 14 Nov 2025 11:32:50 +0100 Subject: [PATCH 6/6] fix: move disabled devcontainer manifest outside updatecli.d Updatecli loads all .yaml files in updatecli.d/ directory, including .disabled files. Move the disabled devcontainer manifest and its README to updatecli/disabled/ directory to prevent it from being loaded. --- .../README.md} | 0 .../devcontainer.yaml | 0 .../updatecli.d/devcontainer.yaml.disabled | 76 ------------------- 3 files changed, 76 deletions(-) rename updatecli/{updatecli.d/devcontainer.yaml.README.md => disabled/README.md} (100%) rename updatecli/{updatecli.d => disabled}/devcontainer.yaml (100%) delete mode 100644 updatecli/updatecli.d/devcontainer.yaml.disabled diff --git a/updatecli/updatecli.d/devcontainer.yaml.README.md b/updatecli/disabled/README.md similarity index 100% rename from updatecli/updatecli.d/devcontainer.yaml.README.md rename to updatecli/disabled/README.md diff --git a/updatecli/updatecli.d/devcontainer.yaml b/updatecli/disabled/devcontainer.yaml similarity index 100% rename from updatecli/updatecli.d/devcontainer.yaml rename to updatecli/disabled/devcontainer.yaml diff --git a/updatecli/updatecli.d/devcontainer.yaml.disabled b/updatecli/updatecli.d/devcontainer.yaml.disabled deleted file mode 100644 index e54f604b..00000000 --- a/updatecli/updatecli.d/devcontainer.yaml.disabled +++ /dev/null @@ -1,76 +0,0 @@ ---- -name: 'deps(devcontainer): update Docker and GitHub CLI versions' - -scms: - default: - kind: github - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "{{ .github.owner }}" - repository: "{{ .github.repository }}" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - branch: "{{ .github.branch }}" - -sources: - dockerLatestMinor: - name: Get latest Docker minor version - kind: githubrelease - spec: - owner: moby - repository: moby - token: "{{ requiredEnv .github.token }}" - versionfilter: - kind: semver - pattern: '~27.0' - - githubcliLatestMinor: - name: Get latest GitHub CLI minor version - kind: githubrelease - spec: - owner: cli - repository: cli - token: "{{ requiredEnv .github.token }}" - versionfilter: - kind: semver - pattern: '>=2.62.0' - -targets: - dockerVersion: - name: 'deps(devcontainer): update Docker version' - scmid: default - kind: file - sourceid: dockerLatestMinor - spec: - file: .devcontainer/devcontainer.json - matchpattern: '("version": "v?)([0-9.]*)(",)' - replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}' - search: - pattern: 'ghcr\.io/devcontainers/features/docker-in-docker' - transformers: - - trimprefix: v - - githubcliVersion: - name: 'deps(devcontainer): update GitHub CLI version' - scmid: default - kind: file - sourceid: githubcliLatestMinor - spec: - file: .devcontainer/devcontainer.json - matchpattern: '("version": "v?)([0-9.]+)(")' - replacepattern: '${1}{{ source "githubcliLatestMinor" }}${3}' - search: - pattern: 'ghcr\.io/devcontainers/features/github-cli' - transformers: - - trimprefix: v - -actions: - default: - kind: github/pullrequest - scmid: default - title: 'chore(deps): update devcontainer dependencies' - spec: - labels: - - dependencies - - devcontainer