Skip to content

Conversation

@gounthar
Copy link
Collaborator

@gounthar gounthar commented Nov 14, 2025

Fixes the updatecli workflow failure in the weekly branch by switching from JSON path queries to file pattern matching.

Problem

The updatecli workflow was failing with:

ERROR: something went wrong in "target#githubcliVersion" : could not find value for query "$.features.\"ghcr.io/devcontainers/features/github-cli:1\".version"
ERROR: something went wrong in "target#dockerVersion" : could not find value for query "$.features.\"ghcr.io/devcontainers/features/docker-in-docker:2\".version"

The JSON path query syntax couldn't properly handle keys containing special characters (dots, slashes, colons), even with bracket notation.

Solution

Changed from json kind with JSON path queries to file kind with regex pattern matching:

Before:

kind: json
spec:
  file: .devcontainer/devcontainer.json
  key: $.features."ghcr.io/devcontainers/features/docker-in-docker:2".version

After:

kind: file
spec:
  file: .devcontainer/devcontainer.json
  matchpattern: '("version": ")([0-9.]*)(",)'
  replacepattern: '${1}{{ source "dockerLatestMinor" }}${3}'
  search:
    pattern: 'ghcr\.io/devcontainers/features/docker-in-docker'

This approach uses regex to find and update the version values, avoiding JSON path limitations with special characters.

Changes

  • updatecli/updatecli.d/devcontainer.yaml: Converted both dockerVersion and githubcliVersion targets from json kind to file kind

Testing

✅ updatecli workflow now passes: https://github.com/jenkins-docs/quickstart-tutorials/actions/runs/19359860819

Related

@github-actions github-actions bot added the repo label Nov 14, 2025
The JSON path query for devcontainer.json was using dot notation with
quotes which failed to match keys containing special characters
(dots, slashes, colons).

Changed from:
  $.features."ghcr.io/devcontainers/features/docker-in-docker:2".version

To bracket notation:
  $.features["ghcr.io/devcontainers/features/docker-in-docker:2"].version

This fixes the updatecli workflow error:
  could not find value for query "$.features.\"ghcr.io/devcontainers/features/docker-in-docker:2\".version"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@gounthar gounthar force-pushed the fix/updatecli-devcontainer-json-path branch from 8effc97 to 2508c04 Compare November 14, 2025 09:13
@gounthar gounthar merged commit 7d0b52f into jenkins-docs:weekly Nov 14, 2025
4 checks passed
@gounthar gounthar deleted the fix/updatecli-devcontainer-json-path branch November 14, 2025 09:14
@gounthar gounthar changed the title fix: use bracket notation for JSON path in devcontainer updates fix: use file kind instead of json for devcontainer updates Nov 14, 2025
This was referenced Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant