Skip to content

Commit fbed4e9

Browse files
authored
fix: use JSON kind for devcontainer updatecli targets (#1846)
* 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. * fix: use bracket notation for JSONPath keys with special characters * 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. * 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. * 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. * 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.
1 parent a98986a commit fbed4e9

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

updatecli/disabled/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Devcontainer Dependency Updates - Currently Disabled
2+
3+
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.
4+
5+
## The Problem
6+
7+
The devcontainer.json file uses feature keys with dots, slashes, and colons:
8+
```json
9+
{
10+
"features": {
11+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
12+
"version": "v27.0.3"
13+
},
14+
"ghcr.io/devcontainers/features/github-cli:1": {
15+
"version": "v2.83.1"
16+
}
17+
}
18+
}
19+
```
20+
21+
Updatecli cannot reliably target these keys using:
22+
- **JSON kind**: JSONPath bracket notation fails to find the values
23+
- **YAML kind**: Yamlpath complains about invalid characters in the path
24+
- **File kind**: Complex multiline pattern matching is error-prone
25+
26+
## Manual Update Process
27+
28+
Until this is resolved, devcontainer dependency versions should be updated manually:
29+
30+
1. Check latest Docker version: https://github.com/moby/moby/releases
31+
2. Check latest GitHub CLI version: https://github.com/cli/cli/releases
32+
3. Update `.devcontainer/devcontainer.json` manually
33+
4. Test in GitHub Codespaces to verify functionality
34+
35+
## Potential Solutions
36+
37+
- Wait for updatecli to improve JSON/YAML path handling for keys with special characters
38+
- Consider restructuring devcontainer.json to use simpler feature keys (requires changes to devcontainer spec)
39+
- Create a custom script to handle these specific updates outside of updatecli
40+
41+
## Re-enabling
42+
43+
To re-enable when a solution is found:
44+
```bash
45+
mv updatecli/updatecli.d/devcontainer.yaml.disabled updatecli/updatecli.d/devcontainer.yaml
46+
```
File renamed without changes.

0 commit comments

Comments
 (0)