Repository navigation
Description
Problem
CI jobs install tools with uv run devops install-tools before they run: the gate jobs (ci.yml:79-91, 189, 868, 901), copilot-setup-steps.yml:58-62, pr-title.yml:161 (openspec), rule-pack.yml:53 (semgrep), image-pins.yml:62, service-image-test.yml:158-159 and release.yml:402, 544, 680. Each install downloads from GitHub release URLs and costs job time. Tests compare copied SHAs and the order of steps (test_workflow_contracts.py:617, 670; test_ci.py:2095).
Change
Owner decision of 2026-11-19: the tools come from the devtools image.
- Jobs that need tools and no Docker daemon run with
container: ghcr.io/dan-petty/devtools:<tag>@sha256:<digest>: the jobs above. - Remove every
uv run devops install-toolsstep. - Jobs that build images keep the host runner. Their scan uses the image-scan action of ci(security): scan each image with one Trivy action and SARIF #6405.
- Change the
tools_lockpath filter of service-image-test.yml:18 (if test(ci): run the Service image suite in a service-test stage #6408 has not), and point the paths filter of rule-pack.yml at the files that pin the devtools image. - Fix the comment at .pre-commit-config.yaml:88.
- Tests: test_workflow_contracts.py:620 (copilot run lines) changes. :617 and :670 assert the action name only, not the copied SHAs (zizmor unpinned-uses and pinDigests keep the pinning). Delete test_ci.py:2095 (install-tools trivy step order).
Renovate. The github-actions manager extracts the container: image, and the devtools group rule of #6414 puts it in the same PR as the Dockerfiles. #6405 handles the trivy group (packageRule 12).
Risk. Medium. A container job with a non-root image can fail actions/checkout on file permissions, so set the job user where needed. If the devtools package is private, CI needs read access to pull it.
Proof
- The CI run of the PR is green, and every changed job logs the devtools image digest.
git grep -n 'install-tools' origin/main -- .github .pre-commit-config.yamlreturns nothing.- A Renovate devtools digest PR updates the Dockerfiles and the workflows in one branch.
Depends on: dan-petty/devtools#1, #4361, #6405
Proposed design
Problem statement
CI jobs download the devops tools with uv run devops install-tools before they run, so each job spends time fetching release artifacts that an image can hold. The change runs the tool-only jobs in the pinned devtools container image, takes the tools of the Docker-daemon jobs from that image, removes the install-tools steps, keeps the image build jobs on the host runner, and updates the path filters, the OpenSpec gate comment and the tests that hold these workflows.
Acceptance criteria
Requirement: Tool jobs run in the devtools image
Every CI job that needs devops tools and runs no Docker daemon SHALL run in the devtools container image.
Scenario: Pull request CI run
- WHEN The live check of the pull request CI run starts each changed tool job.
- THEN The log of each changed tool job shows the devtools image digest and runs no
install-toolsstep.
Requirement: Host jobs take tools from the devtools image
A CI job that needs the Docker daemon and devops tools SHALL keep the host runner and SHALL take its tool binaries from the pinned devtools image.
Scenario: Service image test CI run
- WHEN The live check of the pull request CI run starts the
service-image-testjob. - THEN The job log shows the devtools image digest and the suite finds
promtoolandkubectlin the tools dir.
Requirement: Container image is pinned by digest
Every container.image and every docker reference of the devtools image in the changed workflows MUST name ghcr.io/dan-petty/devtools by tag and @sha256: digest.
Scenario: Digest pin live check
- WHEN
git grep -n 'ghcr.io/dan-petty/devtools:' origin/main -- .github/workflowsruns. - THEN Every line it shows ends with
@sha256:<digest>.
Requirement: Install-tools steps are removed
The workflows and the pre-commit configuration MUST contain no uv run devops install-tools step.
Scenario: Repository search
- WHEN
git grep -n 'uv run devops install-tools' origin/main -- .github/workflows .pre-commit-config.yamlruns. - THEN The command returns no line.
Requirement: Image build jobs keep the host runner
A CI job that builds a container image SHALL keep the host runner and SHALL use the image-scan action of #6405 for its scan.
Scenario: Image build CI run
- WHEN The live check of the pull request CI run starts the image build jobs.
- THEN Each image build job runs on the host runner and its scan step uses the image-scan action of ci(security): scan each image with one Trivy action and SARIF #6405.
Requirement: Path filters name the devtools image pins
The tools_lock path filter of service-image-test.yml and the paths filter of rule-pack.yml SHALL name the files that pin the devtools image.
Scenario: Path filter live check
- WHEN A pull request changes only
src/devops_cli/tools_lock/semgrep.txt. - THEN The
service-image-testandrule-packjobs start.
Requirement: Workflow contract test suite passes
The workflow contract test suite SHALL pass after the copilot run lines change.
Scenario: Workflow contract test suite
- WHEN
uv run pytest tests/invariants/test_workflow_contracts.py -qruns. - THEN The suite passes.
Requirement: Obsolete install-tools order test is removed
The test suite MUST NOT contain a test of the install-tools trivy step order.
Scenario: Test collection
- WHEN
uv run pytest tests/commands/test_ci.py -q --collect-onlyruns. - THEN The output names no
test_ci_security_scan_installs_the_pinned_trivy_for_its_iac_scan.
Requirement: OpenSpec gate comment names the devtools image
The OpenSpec gate comment of .pre-commit-config.yaml SHALL name the devtools image as the holder of Node and the pinned openspec for CI.
Scenario: Configuration search
- WHEN
git grep -n 'devtools image' origin/main -- .pre-commit-config.yamlruns. - THEN The command shows the OpenSpec gate comment line.
Existing Tool Considered
No alternatives check has run. ghcr.io/dan-petty/devops-cli/devcontainer is the open, maintained image in this repository that covers the need: .devcontainer/Dockerfile bakes the devops tools from src/devops_cli/tools_lock/ (semgrep, openspec, style-dictionary, promtool and the rest) and the image is published to GHCR and pinned by tag and digest (docs/DEVCONTAINER_USAGE.md:16-18). What it lacks is a tool-only variant: it also carries the Dev Container features (docker-in-docker, Node, the Copilot CLI and the vscode user, .devcontainer/image/devcontainer.json:7-32), so a CI tool job pulls more than it needs. The issue's planned ghcr.io/dan-petty/devtools image of dan-petty/devtools#1 has no source in this repository and is the external block. The change adds no new tool code.
Key questions
- Which CI jobs run in the devtools container?: The tool-only jobs run in the devtools container: the
static,test-shard,design-tokens,copilot-setup-steps,pr-title,rule-packandimage-pinsjobs. The jobs that need the Docker daemon keep the host runner: the image build jobs ofci.yml(service, runner, mcp-server),release.yml(service, runner, mcp-server) and the devcontainer image, plusservice-image-test, which loads and runs the service image. The image build jobs use the ci(security): scan each image with one Trivy action and SARIF #6405 image-scan action;service-image-testtakespromtoolandkubectlfrom the pinned devtools image. (best practice) [sources: .github/workflows/ci.yml:56-115, .github/workflows/ci.yml:160-205, .github/workflows/ci.yml:851-915, .github/workflows/copilot-setup-steps.yml:30-68, .github/workflows/rule-pack.yml:28-55, .github/workflows/image-pins.yml:40-65, .github/workflows/service-image-test.yml:100-170, .github/workflows/ci.yml:480-530, .github/workflows/release.yml:393-410]- Chosen: Container only the tool jobs. The image build jobs and service-image-test need the Docker daemon, which a container job does not have.
- Rejected: Container every job. A container job cannot use the Docker daemon that
docker build,docker loadanddocker runneed. - Rejected: Host every job. It keeps the release downloads that the change removes.
- Does
service-image-testrun in the devtools container?: No. The job downloads the service image artifact and runsdocker loadanddocker runon it, so it needs the Docker daemon and keeps the host runner. Its twoinstall-toolssteps putpromtoolandkubectlin the tools dir that the suite mounts into the service image; the change replaces them with a copy of the two binaries from the pinned devtools image (the same/usr/local/binlayout that the devcontainer image uses). (best practice) [sources: .github/workflows/service-image-test.yml:129-160]- Chosen: Host runner, copy the tools from the devtools image. It keeps the Docker daemon and removes the release downloads.
- Rejected: Host runner, keep the install-tools steps. It keeps the downloads that the change removes.
- Rejected: Container job. The job cannot run
docker loadanddocker runwithout the daemon.
- How is the devtools image pinned?: Pin it in
container.imageasghcr.io/dan-petty/devtools:<tag>@sha256:<digest>, and in theservice-image-testcopy step as the same reference. The repository pins every container image by tag and digest (Dockerfile:3,k8smanifests), and Renovate'sgithub-actionsanddockerfilemanagers setpinDigests: true, so a digest update reaches the workflows and the Dockerfiles. (best practice) [sources: .github/renovate/base.json:137-140, docs/DEVCONTAINER_USAGE.md:17-18, https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/run-jobs-in-a-container]- Chosen: Tag and digest. A digest fixes the image content, and the tag lets Renovate update it.
- Rejected: Tag only. A tag can move and does not fix the image content.
- Rejected: Digest only. Renovate has no tag to follow, so the image never updates.
- What user does a container job use?: Use the user of the image's
USERinstruction. A Dev ContainerremoteUserdoes not apply to acontainer:job (.devcontainer/image/devcontainer.json:64setsvscodefor devcontainers only). Addcontainer.options: --user rootonly to a job that runsactions/checkoutand cannot write the workspace; do not run every job as root. (best practice) [sources: https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/run-jobs-in-a-container, .devcontainer/image/devcontainer.json:64]- Chosen: Image user, root only when check out fails. It keeps the least privilege that the job needs.
- Rejected: Root on every container job. It runs more privilege than the job needs.
- Rejected: Non-root user on every job.
actions/checkoutcan fail to write the workspace.
- How does CI pull the devtools image if the package is private?: Set
permissions: packages: readandcontainer.credentialswithusername: ${{ github.actor }}andpassword: ${{ secrets.GITHUB_TOKEN }}on each container job that pulls the image. The workflow token reads a private package of the repository owner and is harmless for a public one; this repository already reads GHCR packages withpackages: readin the CodeQL and devcontainer image jobs. (best practice) [sources: https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/run-jobs-in-a-container, .github/workflows/codeql.yml:45, .github/workflows/devcontainer-image.yml:55-57]- Chosen: Workflow token credentials. The token is available to the job and needs only
packages: read. - Rejected: Public package only. It fails if the package is private.
- Rejected: Personal access token secret. It adds a long-lived secret that the workflow token replaces.
- Chosen: Workflow token credentials. The token is available to the job and needs only
- Which tests change?:
tests/invariants/test_workflow_contracts.py:620changes: its tuple holds the copilot job'spermissionsmap (line 646), the setup-node step (lines 647-648) and the run lines (lines 649-657), so it loses the install-tools lines and gainspackages: readif the job pulls with the workflow token. The pinned refs at lines 617 and 670 stay; Renovate'spinDigestsholds them. Deletetests/commands/test_ci.py:2099(test_ci_security_scan_installs_the_pinned_trivy_for_its_iac_scan); the issue's 2095 is inside the preceding SARIF test. No other test asserts an install-tools step. [sources: tests/invariants/test_workflow_contracts.py:617, tests/invariants/test_workflow_contracts.py:620, tests/invariants/test_workflow_contracts.py:646, tests/commands/test_ci.py:2099, .github/renovate/base.json:137-140] - What comment changes in
.pre-commit-config.yaml?: Rewrite the OpenSpec gate comment at.pre-commit-config.yaml:87-91so it says the devtools image holds Node and the pinned openspec for CI, in place of theuv run devops install-tools --tool openspeccommand. [sources: .pre-commit-config.yaml:87-91] - Which path filters change?:
service-image-test.ymlalready namessrc/devops_cli/tools_lock/**(line 18) and its own workflow (line 19); keep that path, or keep test(ci): run the Service image suite in a service-test stage #6408's path if that change lands first.rule-pack.ymlnames onlysrc/devops_cli/review/rules/**and its own workflow (lines 12-13); addsrc/devops_cli/tools_lock/**so a change to the semgrep lock that the image bakes starts the job. (best practice) [sources: .github/workflows/service-image-test.yml:13-19, .github/workflows/rule-pack.yml:11-13, src/devops_cli/tools_lock/semgrep.txt]- Chosen: Add tools_lock to rule-pack. The semgrep pin is now an input of the job, and the service-image-test filter already names the tools_lock files.
- Rejected: Keep both filters unchanged. A change to the semgrep lock would start no rule-pack job.
- Rejected: Wait for test(ci): run the Service image suite in a service-test stage #6408. The item can name the path now and keep test(ci): run the Service image suite in a service-test stage #6408's path if that change lands first.
- What does the install-tools search cover?: It covers the
uv run devops install-toolssteps of the listed workflows and the pre-commit comment, not everyinstall-toolstext. Thedocker run ... install-tools --checksmoke tests of the built images (.github/workflows/ci.yml:732-733,.github/workflows/release.yml:666-667), the devcontainer composite actions (.github/actions/devcontainer-image/action.yml:49,.github/actions/devcontainer-smoke/action.yml:27) and the Renovate PR body text (.github/renovate.json:294,303) stay. Usegit grep -n 'uv run devops install-tools' origin/main -- .github/workflows .pre-commit-config.yaml. [sources: .github/workflows/ci.yml:732-733, .github/workflows/release.yml:666-667, .github/actions/devcontainer-image/action.yml:49, .github/actions/devcontainer-smoke/action.yml:27, .github/renovate.json:294, .pre-commit-config.yaml:88]
Fit
Fits in one pull request.
Suspected block
The ghcr.io/dan-petty/devtools image of dan-petty/devtools#1 must be published and pullable by CI.
Dependencies
Alternatives check of 2026-11-19: not-applicable.
Class: ci, no search.
Tool: none found.
Activity
dan-petty commentedon Nov 19, 2026
Both remove install-tools from CI, but #4361 uses native install steps while the candidate uses the devtools image as a job container.devops-cli-service commentedon Nov 19, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 20, 2026
Released in v0.185.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.185.1
devops-cli-service commentedon Nov 20, 2026
Live since 2026-11-20 22:40 UTC