Skip to content

feat(deps): repin tool downloads and their sha256 for Renovate #4902

Closed as not planned

Description

@dan-petty

Problem or Motivation

src/devops_cli/tools_lock/tools.lock holds 20 binaries with 80 url and sha256 pairs. .devcontainer/Dockerfile repeats the 40 Linux pairs, and a test needs them equal. Dockerfile and runner_tools.py pin gh 2.102.1 with 2 more pairs. No Renovate manager reads these pins, and no project command updates them: the tools.lock header lists manual steps.

Measured on 2026-11-11: 11 of 20 binaries are behind (golangci-lint 1.64.6 to 2.15.0 is a major; trivy 0.75.0 to 0.76.2; argocd 3.5.4 to 3.6.1), and gh is 2.102.1 to 2.103.3.

Renovate's github-release-attachments datasource updates a sha256 natively. But it finds the release by the exact tag and replaces only that string. It fits 11 of 20 binaries:

  • 7 put the version without v in the file name or use a tag prefix: trivy, pluto, tuicr, gitleaks, golangci-lint, promtool, kustomize.
  • 2 are not on GitHub: kubectl (dl.k8s.io) and helm (get.helm.sh).

Proposed Solution & Architectural Design

  • Add one devops command. The proposal names it, for example devops tools repin <tool> <version>.
  • The command sets the version and writes every platform url and sha256 of the tool again in tools.lock, .devcontainer/Dockerfile, Dockerfile and runner_tools.py.
  • It takes each sha256 from the release asset digest of the GitHub REST API. It compares it with the publisher's checksum file where one exists (the per-tool sources in the tools.lock header). kubectl uses dl.k8s.io kubectl.sha256, and helm uses the get.helm.sh .sha256sum file.
  • A checksum mismatch stops the command with an error, and the command writes no file.
  • --dry-run makes no request.
  • Add the Renovate regex managers to .github/renovate.json: one on each [binary.<name>] version line with its source (github-releases; kubernetes/kubernetes for kubectl, helm/helm for helm), and one on the Dockerfile gh url pair.
  • Add postUpgradeTasks that run uv run --frozen devops tools repin {{{depName}}} {{{newVersion}}} with executionMode: "update" and installTools python and uv. Add the binaries to the coupled groups of ci(deps): make Renovate cover every pin on a fixed schedule #4896 (trivy, argo, cloudflared, gh).
  • The global allowedCommands of feat(deps): track regular version updates with Renovate #4893 child 4 allows only this command as an anchored regex.

One mechanism for all 20 tools is simpler than the native datasource for 11 and a second path for 9.

Target Subsystem

SDLC, Git & PR Governance (dependency updates).

Existing Tool Considered

Rejected: github-release-attachments only (fits 11 of 20); aqua with aqua-renovate-config (MIT, but it replaces the lock format, which is the scope of #4363 and #4368).

Build cost (AGENTS.md rule 3): about 250 lines of code and 300 lines of tests with recorded release JSON; about 300k tokens to build; the upkeep moves with the pins when #4363 removes tools.lock; about 3 hours of agent time.

Acceptance Criteria

  • Tests that fail on the base and pass on the branch, with recorded release JSON and checksum files:
    • A repin of trivy changes the version, all 4 tools.lock urls, all 4 sha256, the 2 Dockerfile urls and sha256, and nothing else.
    • A checksum mismatch stops the command with an error and writes no file.
    • kubectl and helm take the sha256 from the publisher file.
  • The existing tests that compare tools.lock and the Dockerfile pass after a repin.
  • The Renovate config has a manager for each of the 20 binaries and gh, and renovate-config-validator --strict exits 0.

Dependencies

#4896 (the shared preset and the coupled groups). Child 3 of #4893.

Source: #4893

Alternatives check of 2026-11-14: in-use.
The repository already uses this tool.
Tool: renovatebot/renovate (https://github.com/renovatebot/renovate), AGPL-3.0, last activity 2026-11-14, maintained.

Proposed design

Problem statement

Add one devops install-tools repin <tool> <version> command and the Renovate managers, so one version bump rewrites every platform url and sha256. The pins of 20 binaries live in src/devops_cli/tools_lock/tools.lock as 80 url and sha256 pairs, and .devcontainer/Dockerfile repeats the Linux pairs; Dockerfile and runner_tools.py pin gh. No Renovate manager reads these pins, and the tools.lock header lists manual steps only. The issue measured 11 of 20 binaries behind on 2026-11-11. The work waits on #4896 for the shared preset and coupled groups, and the global allowedCommands of #4893 child 4 must allow the command.

Acceptance criteria

Requirement: Repin rewrites every platform pair

A repin of one binary tool MUST write its new version and every platform url and sha256 in src/devops_cli/tools_lock/tools.lock, .devcontainer/Dockerfile, Dockerfile and runner_tools.py, and MUST change no other value.

Scenario: trivy repin

  • WHEN A repin of trivy to a new version runs against recorded release JSON and publisher checksum files
  • THEN The version, the four tools.lock url and sha256 values and the two .devcontainer/Dockerfile url and sha256 values hold the new version, and every other line of the four files is unchanged

Requirement: gh repin rewrites both gh pins

A repin of gh MUST write its new version and the gh url and sha256 pair in Dockerfile and the gh url and sha256 pair in runner_tools.py, and MUST change no other value.

Scenario: gh repin

  • WHEN A repin of gh to a new version runs against recorded release JSON and the publisher checksum file
  • THEN The gh url and sha256 pair in Dockerfile and the gh url and sha256 pair in runner_tools.py hold the new version, and every other line of those two files is unchanged

Requirement: Release digests agree with the publisher file

For each GitHub tool with a publisher checksum file, the command MUST compare the release asset digest with the publisher value and MUST write the digest only when the two values equal.

Scenario: digest and publisher agree

  • WHEN A repin of trivy runs against recorded release JSON and the recorded publisher checksum file with equal values
  • THEN The command exits 0 and writes the digest as each trivy sha256 in tools.lock and .devcontainer/Dockerfile

Requirement: Checksum mismatch stops the repin

The command MUST stop with an error and write no file when the release asset digest differs from the value in the publisher checksum file.

Scenario: mismatch writes nothing

  • WHEN The recorded release JSON digest differs from the recorded publisher checksum file for one tool
  • THEN The command exits with a non-zero status, names the tool and the two digests, and each target file keeps its bytes

Requirement: Publisher file gives the kubectl and helm sha256

For kubectl and helm the command MUST take each sha256 from the publisher checksum file, because their releases carry no asset digest.

Scenario: non-GitHub publisher checksum

  • WHEN A repin of kubectl and of helm runs against the recorded dl.k8s.io kubectl.sha256 file and the recorded get.helm.sh .sha256sum file
  • THEN Each sha256 written to tools.lock equals the value in the recorded publisher file for that archive

Requirement: Dry run makes no request

The command MUST send no HTTP request and write no file when it runs with the --dry-run flag.

Scenario: dry run

  • WHEN The repin command runs with --dry-run against a client that records each request
  • THEN The client records no request and each target file keeps its bytes

Requirement: The lock and the Dockerfile stay consistent after a repin

The lock and the Dockerfile MUST stay consistent after a repin, as the existing comparison in tests/invariants/test_devcontainer_config.py checks them.

Scenario: consistency after a repin

  • WHEN A test builds a temporary tools.lock and .devcontainer/Dockerfile from recorded fixtures, runs a trivy repin against recorded release JSON, and applies the comparison of tests/invariants/test_devcontainer_config.py
  • THEN The comparison passes

Requirement: One Renovate manager per pinned binary

The Renovate configuration SHALL hold one manager for each of the 20 binaries in tools.lock and one manager for gh, and SHALL pass renovate-config-validator --strict.

Scenario: strict manager validation

  • WHEN renovate-config-validator --strict .github/renovate.json runs after the 21 managers are added
  • THEN The command exits 0 and prints no warning about a manager

Requirement: The self-hosted Renovate configuration passes the k8s check

The self-hosted Renovate configuration SHALL hold the postUpgradeTasks entry that runs the repin command for the bumped package with executionMode: "update" and installTools python and uv, and the anchored allowedCommands entry that allows only the repin command, and SHALL pass the k8s check.

Scenario: k8s config check

  • WHEN uv run devops ci --check --only k8s runs on the changed k8s/devops/renovate/configmap.yaml
  • THEN The command exits 0 and reports no error for the Renovate ConfigMap

Existing Tool Considered

Renovate (https://github.com/renovatebot/renovate, AGPL-3.0, last activity 2026-11-14, maintained) has the verdict in-use in the alternatives check in the issue body. The check lists what Renovate covers and lacks. The plan keeps Renovate for version detection and uses postUpgradeTasks to run the repin command, which rewrites every platform url and sha256 in the four files, checks the release asset digest against the publisher checksum file, stops on a mismatch and sends no request under --dry-run. The plan builds that command itself: about 250 lines of code and 300 lines of tests with recorded release JSON, about 300k tokens to build and keep, and about 3 hours of agent time; the upkeep moves with the pins when #4363 removes tools.lock.

Key questions

  • Which mechanism updates the download pins of all 20 binaries and gh?: One devops install-tools repin <tool> <version> command updates every pin of one tool. Renovate calls it from postUpgradeTasks after a version bump, and Renovate regex managers find the new version. One code path serves all 20 binaries and gh. (best practice) [sources: src/devops_cli/tools_lock/tools.lock, .github/renovate.json, k8s/devops/renovate/configmap.yaml]
  • Where does each sha256 come from, and how does the command check it?: For a GitHub tool, each sha256 comes from the release asset digest of the GitHub REST API. The command checks it against the publisher checksum file where one exists. The tools.lock header names the exceptions: popeye checksums.sha256, get.helm.sh <archive>.sha256sum and dl.k8s.io kubectl.sha256 give the value alone; gh-dash checksums.txt comes from the same release as the digest; tuicr publishes no checksum file. A mismatch stops the command with an error and writes no file. (best practice) [sources: src/devops_cli/tools_lock/tools.lock]
    • Chosen: Release asset digest plus the publisher checksum file. Two independent sources where the publisher publishes a file, and the lock header already records this rule.
    • Rejected: Publisher checksum file alone. tuicr and gh-dash publish no independent checksum file.
    • Rejected: Release asset digest alone. No second source checks the answer of the API.
  • How does the command build each platform url for the new version?: The command replaces the old version string and its v-prefixed form inside each current url with the new version. The tag and the file name then keep their shape. The lock shows both forms: the trivy tag v0.76.2 with the file name trivy_0.76.2_Linux-64bit.tar.gz, and the kustomize tag kustomize/v5.8.3. (best practice) [sources: src/devops_cli/tools_lock/tools.lock]
    • Chosen: Substitute the version inside the current url. The lock holds the shape of each url, so no second table can drift from it.
    • Rejected: A per-tool url template table in the code. It repeats the urls of the lock and drifts from them.
  • Which Renovate file holds the managers, and which holds the postUpgradeTasks and allowedCommands?: The regex managers go in the repository Renovate configuration .github/renovate.json. The postUpgradeTasks and allowedCommands go in the self-hosted global configuration k8s/devops/renovate/configmap.yaml, because Renovate runs postUpgradeTasks only in a self-hosted run and the configmap already holds those keys. (best practice) [sources: k8s/devops/renovate/configmap.yaml, k8s/devops/renovate/cronjob.yaml, tests/invariants/test_k8s_renovate.py, tests/core/test_renovate_config.py]
    • Chosen: Managers in .github/renovate.json and postUpgradeTasks in k8s/devops/renovate/configmap.yaml. The repository configuration holds the managers, and postUpgradeTasks and allowedCommands are self-hosted keys that the configmap already holds.
    • Rejected: Everything in .github/renovate.json. A hosted run ignores postUpgradeTasks and allowedCommands.
  • How does Renovate trigger the repin after a version bump?: postUpgradeTasks with executionMode: "update" runs uv run --frozen devops install-tools repin {{{depName}}} {{{newVersion}}} in the same branch as the version bump. installTools names python and uv. The global allowedCommands of feat(deps): track regular version updates with Renovate #4893 child 4 must allow the same command as an anchored regex. (best practice) [sources: k8s/devops/renovate/configmap.yaml]
    • Chosen: postUpgradeTasks with executionMode: "update". It runs in the update branch, so the rewritten pins and the version bump land in one pull request.
    • Rejected: A manual run of the repin command. It needs a person after each Renovate pull request.
    • Rejected: A repository schedule that repins every tool. It cannot know the new version per tool, and it opens no per-tool pull request.
  • Which command group holds the repin subcommand, and what is its interface?: The subcommand is devops install-tools repin <tool> <version> with a --dry-run flag. The existing install-tools command owns tools.lock, and no source in the context shows a top-level tools command group. (best practice) [sources: tests/commands/test_install_tools.py, src/devops_cli/tools_lock/tools.lock]
    • Chosen: devops install-tools repin <tool> <version>. It reuses the command that already owns tools.lock and adds no new command group.
    • Rejected: devops tools repin <tool> <version>. It adds a new top-level command group for one subcommand, and no source shows that group.
  • How does each Renovate manager find the new version of its tool?: One custom regex manager per binary anchors on the version line of [binary.<name>] and takes datasourceTemplate: github-releases with the packageName of the tool's source field. Kubectl uses kubernetes/kubernetes, helm uses helm/helm, and kustomize uses extractVersion for its kustomize/v tags. gh gets one regex manager on its Dockerfile url pair with packageName: cli/cli. (best practice) [sources: src/devops_cli/tools_lock/tools.lock, .github/renovate.json]
    • Chosen: One regex manager per binary on the version line, with the datasource from the source field. Every binary holds its GitHub source, and kubectl and helm publish their releases under kubernetes/kubernetes and helm/helm.
    • Rejected: The github-release-attachments datasource on the url lines. It fits 11 of 20 tools only, and it replaces only the one string that the exact tag matches.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4896

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/deps
    status/new
    value/medium
    on Nov 12, 2026
  3. added
    effort/high
    on Nov 12, 2026
  4. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/deps. The (deps) scope of the title gives the scope.
    • Priority: P2-Medium. The pins drift, but the candidate states no security or outage risk that needs urgent work.
    • Value: Medium. It keeps 20 tool pins current with checked sha256 values and less manual work.
    • Effort: High. The proposal estimates 250 lines of code, 300 lines of tests and 3 hours of agent time.
    • Related: chore(tools): remove devops install-tools and tools.lock #4363, which asks for a different change. Both touch the tools.lock and Dockerfile pins; #4363 removes them and the candidate adds a repin command for them.
  5. added
    effort/medium
    and removed
    effort/high
    on Nov 12, 2026
  6. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/deps. The (deps) scope of the title gives the scope.
    • Priority: P2-Medium. It automates a manual update step for 20 tools but is not a security fix or a blocking defect.
    • Value: Medium. It reduces the risk of outdated or vulnerable tool binaries by enabling automated version and checksum updates.
    • Effort: Medium. The body estimates about 250 lines of code, 300 lines of tests, and 3 hours of agent time.
    • Related: chore(tools): remove devops install-tools and tools.lock #4363, which asks for a different change. Both touch tools.lock and its pins, but the candidate adds a repin command to update them while #4363 removes the lock entirely.
  7. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Renovate is already used by the project, and its github-release-attachments datasource plus regex managers cover version detection for all 20 binaries and native version+sha256 rewriting for 11 of them. No tool found rewrites every platform URL and sha256 in tools.lock, the Dockerfiles and runner_tools.py or checks the digest against the publisher's checksum file; aqua and mise keep checksums only in their own lock formats.

    The repository already uses this tool.

    Tool: renovatebot/renovate (https://github.com/renovatebot/renovate)

    • License: AGPL-3.0
    • Last activity: 2026-11-14
    • Maintained: yes

    Covers:

    • The github-release-attachments datasource updates a binary's version and its sha256 from the GitHub release asset digest for the 11 binaries whose asset names match the tag
    • Regex managers with github-releases, kubernetes/kubernetes for kubectl and helm/helm for helm detect new versions for all 20 binaries and gh
    • postUpgradeTasks with executionMode: "update" run a project command after an upgrade, so Renovate can trigger the repin step
    • Renovate already runs on the repository through .github/renovate.json

    Lacks:

    • It does not fit the 7 tools whose asset name drops the v or uses a tag prefix: trivy, pluto, tuicr, gitleaks, golangci-lint, promtool and kustomize
    • It cannot fetch kubectl from dl.k8s.io or helm from get.helm.sh
    • It does not rewrite every platform url and sha256 in tools.lock, .devcontainer/Dockerfile, Dockerfile and runner_tools.py
    • It does not verify a digest against the publisher's checksum file, stop on a mismatch, or make no request under --dry-run
    • It cannot regenerate all 4 platform pairs of a tool from one version in one update

    Tools considered:

    Searches run:

    • tool to update CLI binary download URLs and sha256 checksums in lockfile automatically, results: 5
    • Renovate github-release-attachments datasource sha256 checksum, results: 5
    • mise lockfile tool versions checksums url platforms, results: 5
    • aqua declarative CLI version manager checksum lockfile update versions, results: 5
    • suzuki-shunsuke aqua, results: 5
    • renovatebot renovate, results: 5
    • docs.renovatebot.com github-release-attachments, results: 5
    • hermit cashapp tool manager upgrade checksums manifest, results: 5
    • updatecli declarative dependency update githubrelease checksum file target, results: 5

    Sources:

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  8. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at ac493d9 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: .github/renovate.json.

  9. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 62a806b while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: k8s/devops/renovate/configmap.yaml.

  10. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  11. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor

    Closed as not planned. Owner decision of 2026-11-19: the devtools image (dan-petty/devtools#1) pins its tools in mise.toml and mise.lock, and Renovate's built-in mise manager updates both (#6402 lets the self-hosted Renovate write mise.lock). A repin command of our own and regex managers into the Dockerfile and runner_tools.py are against the rule that devops-cli is not a package manager. #4361 and #4363 remove the downloads that this item would repin.

  12. removed
    status/ready
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/depssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions