Skip to content

ci(image): move the image checks to one path-filtered workflow #1858

Open

Description

@dan-petty

Update 2026-11-26 (infra move): devops install-tools is deleted (#6555), the tools come from the dan-petty/devtools image, and the release smoke tests are in release-image.yml and smoke.Dockerfile. tf/ also left this repository. Follow the design below where the first part of the body differs.


Problem

The image checks of ci.yml (lines 418-762) find their changed paths with 3 Detect steps of hand-written git diff bash, 18 guards and fetch-depth: 0. The smoke test exists in ci.yml and again in release.yml.

The design of 2026-10-22 in this issue used a reusable workflow and dorny/paths-filter. A caller caps the permissions of a reusable workflow, and GitHub's own on.pull_request.paths filter covers the need when the image check is a workflow of its own (docs/SDLC.md:224). So this issue now uses its own workflow plus composite actions, and needs no paths-filter action.

Change

  1. Add .github/workflows/image.yml:
    • Triggers: pull_request with a fail-safe deny-list filter ['**', '!docs/**', '!openspec/**', '!**/*.md', 'README.md', '!k8s/**', '!tf/**'], and workflow_dispatch.
    • Permissions: contents read and security-events write. Concurrency is set.
    • A matrix over target [service, runner, mcp-server]. Each job runs checkout, setup-buildx, a load build (timeout 6 min), the new composite action .github/actions/image-smoke (one case per target, curl --max-time 5 per try, timeout 2 min) and the image-scan action of ci(security): scan each image with one Trivy action and SARIF #6405 (timeout 3 min), all inside the job limit of 12 min.
  2. Delete the three ci.yml jobs (418-762), with the 3 Detect steps, the 18 guards and fetch-depth: 0. Delete tests/invariants/test_architectural_invariants.py:669-725.
  3. release.yml calls image-smoke, so one smoke definition exists.
  4. Update the tests that read job or step names (test_workflow_contracts.py:306-318, test_mcp_server_image.py:73-85, test_runner_image.py:103) and the documents that name the jobs.

The release half of the old design goes to #6407: build each image once, then verify, attest and tag that digest. Owner decision of 2026-11-19: that replaces the owner decision of 2026-10-23 in this issue (the release rebuilds from the cache), because run 44415593173 pushed a different digest from the one it scanned. The cleanup workflow part went to #4816.

The release smoke tests are in release-image.yml and smoke.Dockerfile; devops install-tools is deleted (#6555).

Renovate. The github-actions manager updates the SHA pins. The path patterns hold no versions.

Risk. The deny-list also builds on PRs that change only tests: at most 3 more image runs in 29. GitHub reads only the first 300 changed files for paths, so a PR whose first 300 files are all excluded starts no run. Negated patterns depend on their order. The check names change, but they are not required checks (SDLC.md:226).

Proof

  • This PR changes image.yml, so the workflow runs and its 3 jobs pass.
  • The next docs-only PR starts no image.yml run.
  • .python-version and .github/actions/setup-toolchain/** now start the check, because the deny-list covers them.
  • The job times stay under 6 min (today's means: 196, 240 and 214 s). About 100 lines of YAML and bash go.

Depends on: #6405

Alternatives check of 2026-11-19: not-applicable.
Class: ci, no search.
Tool: none found.

Proposed design

Problem statement

The image smoke checks are duplicated in .github/workflows/ci.yml and .github/workflows/release-image.yml. This item extracts them into one composite action and calls it from both workflows. The path-filtered image.yml and the deletion of the old ci.yml jobs are deferred to a new item.

Acceptance criteria

Requirement: Shared smoke action

.github/actions/image-smoke/action.yml SHALL be a composite action that runs the smoke.Dockerfile stage and the docker run checks of one image, with one case for each of service, runner, mcp-server and uv-seed.

Scenario: The action passes actionlint and zizmor

  • WHEN uv run devops ci --check --only actionlint,zizmor runs on the branch
  • THEN the command exits 0 and reports no finding for .github/actions/image-smoke/action.yml

Requirement: Release caller

The verify job of .github/workflows/release-image.yml MUST call .github/actions/image-smoke in place of its smoke stage step and its smoke test steps, and it SHALL pass the image reference that it pulled by digest.

Scenario: The release image workflow passes actionlint and zizmor

  • WHEN uv run devops ci --check --only actionlint,zizmor runs on the branch
  • THEN the command exits 0 and reports no finding for .github/workflows/release-image.yml

Requirement: CI callers

The service-image and mcp-server-image jobs of .github/workflows/ci.yml MUST call .github/actions/image-smoke in place of their Run Smoke Stage and Run Smoke Test steps.

Scenario: The CI workflow passes actionlint and zizmor

  • WHEN uv run devops ci --check --only actionlint,zizmor runs on the branch
  • THEN the command exits 0 and reports no finding for .github/workflows/ci.yml

Requirement: Workflow documents

docs/CLUSTER.md and RELEASE_CYCLE.md SHALL name .github/actions/image-smoke as the one smoke definition that CI and the release run.

Scenario: The documents pass their check

  • WHEN uv run devops ci --check --only docs runs on the branch
  • THEN the command exits 0 and reports no broken link and no stale text

Requirement: Pending a person after the merge

A pull request that changes an image input and a release SHALL pass the shared smoke action before they report success.

Scenario: A person reads the first image checks and the first release after the merge

  • WHEN a person opens the next pull request that changes an image input, and the next release Verify job runs, after the merge
  • THEN the CI image checks and the release Verify job are green and their logs show the image-smoke action step

Existing Tool Considered

The alternatives check in the issue body gives not-applicable for class ci and names no tool. The change builds .github/actions/image-smoke/action.yml as a composite action of about 60 lines of YAML and bash. The written cost is about 8k tokens to build, about 4k tokens for each later change, and about 2 hours elapsed. The repository already shares steps with .github/actions/image-scan/action.yml and .github/actions/devcontainer-smoke/action.yml.

Key questions

  • Where do the image checks and their smoke tests live today?: Two jobs in .github/workflows/ci.yml: service-image and mcp-server-image. Each job has a Detect Image Content Changes step and a fetch-depth: 0 checkout. The mcp-server-image job builds the runner, mcp-server and uv-seed targets with one bake call. The second smoke definition is the verify job of .github/workflows/release-image.yml. It runs the smoke stage and the docker run checks on the digest it pulled. [sources: .github/workflows/ci.yml, .github/workflows/release-image.yml, smoke.Dockerfile]
  • Which mechanism scopes the image check to a pull request that changes image paths?: Use the native on.pull_request.paths filter in a workflow of its own. GitHub starts no runner for a pull request that changes no matching path. The workflow document names this as the way to scope a check that is not required. (best practice) [sources: docs/SDLC.md:224, .github/workflows/service-image-test.yml]
    • Chosen: Native on.pull_request.paths in .github/workflows/image.yml. GitHub filters before it starts a runner. The workflow document names this as the way to scope a check that is not required.
    • Rejected: dorny/paths-filter in a step. A step filter starts a runner on each push and waits in the queue. The workflow document rejects it for this case.
    • Rejected: Hand-written git diff with fetch-depth: 0. It needs a full-history checkout, Detect steps and guards. That is the code this item removes.
  • Should the paths filter be an allow-list or a deny-list, and does it keep the bare README.md pattern?: Use a deny-list: ['', '!docs/', '!openspec/', '!/*.md', '!k8s/']. Drop the body's bare README.md positive pattern. A positive pattern after a negation re-includes that path. The main Dockerfile copies no README.md. Drop !tf/ because tf/ left this repository. The local sources of the main Dockerfile are pyproject.toml, uv.lock, src/, package.json and package-lock.json, so no path that the image bakes is excluded. (best practice) [sources: docs/SDLC.md:224, .github/workflows/devcontainer-image.yml]
    • Chosen: Deny-list with ** first and no positive pattern after a negation. A new image input starts the check by default. No path that the main Dockerfile copies is excluded.
    • Rejected: Allow-list of the paths that the Dockerfile copies. A new COPY source that the list does not name would skip the check and still report success.
    • Rejected: Deny-list that keeps the bare README.md pattern. The main Dockerfile copies no README.md. The re-include would start the image jobs for a README-only pull request.
  • Does the shared smoke definition live in a composite action or in a reusable workflow?: Use a composite action at .github/actions/image-smoke/action.yml. The image workflow and the verify job of release-image.yml each call it as a step. A reusable workflow is the wrong shape here because the caller caps the permissions of the called workflow, and Verify needs security-events: write for the scan. (best practice) [sources: .github/actions/image-scan/action.yml, .github/actions/devcontainer-smoke/action.yml, .github/workflows/release-image.yml, openspec/changes/archive/2026-11-20-6407-release-image-once/design.md]
    • Chosen: Composite action called by both workflows. Each caller keeps its own permissions, and the repository already shares steps this way.
    • Rejected: Reusable workflow with workflow_call. The caller caps the permissions of the called workflow, and the image job needs security-events: write.
    • Rejected: A copy of the steps in each workflow. Two copies drift. The duplicate smoke test is the problem of this item.
  • Does image.yml hold one matrix job over the three targets or one job for each build group?: Use two jobs, one for each build group that ci.yml has today: Image Service for the service target, and Image Runner for the runner, mcp-server and uv-seed targets that one bake call builds. The runner job calls the smoke action for runner and mcp-server and keeps the uv-seed seed check. A matrix over the three images would split the one bake call and would leave uv-seed out. (best practice) [sources: .github/workflows/ci.yml, smoke.Dockerfile, openspec/changes/archive/2026-11-24-4649-build-the-runner-and-mcp-images/design.md]
    • Chosen: Two jobs, one per build group. It mirrors the one-bake build of runner, mcp-server and uv-seed.
    • Rejected: One matrix job over service, runner and mcp-server. It splits the one bake call, rebuilds the shared stages, and leaves uv-seed out.
    • Rejected: Three jobs, one for each target. It makes three copies of the steps and splits the shared build.
  • Does the architectural invariant of the image path filter stay?: The invariant stays in this item. The deferred item deletes tests/invariants/test_architectural_invariants.py with the IMAGE_CONTENT_PATHS lists of ci.yml. The deny-list covers every local source that the Dockerfile copies today, so the invariant is not needed after the old jobs go. (best practice) [sources: tests/invariants/test_architectural_invariants.py, docs/SDLC.md:224, .github/workflows/ci.yml]
    • Chosen: Keep the invariant now and delete it with the old ci.yml jobs. The old jobs still use IMAGE_CONTENT_PATHS in this item. The deferred item deletes both together.
    • Rejected: Delete the invariant now. The old ci.yml jobs still declare IMAGE_CONTENT_PATHS in this item, so the invariant still has a subject.
    • Rejected: Rewrite the invariant to match the deny-list globs. It keeps a second list to stay in step, for a failure mode that the deny-list removes for the current Dockerfile.
  • Does the smoke action wait for ci(docker): run the image smoke checks as Docker build stages #7204, which moves the checks that need no container into the stages of smoke.Dockerfile?: No wait. The change is already in the tree. The service job runs the service-smoke stage. The runner job runs the mcp-server-smoke, runner-smoke and uv-seed-smoke stages. The release verify job runs the stage of the image it pulled. The action wraps those steps and the docker run checks that are left, so it can be built now. [sources: smoke.Dockerfile, .github/workflows/ci.yml, .github/workflows/release-image.yml]
  • Which release build design applies after the owner decision of 2026-11-19?: The release builds each image once by digest, verifies that digest, then attests and tags it. The 2026-11-19 decision replaces the 2026-10-23 decision that rebuilt from the cache. The change is already in release-image.yml. This item does not change the release build. (best practice) [sources: .github/workflows/release-image.yml, .github/workflows/release.yml]
    • Chosen: Build once by digest, verify the digest, then attest and tag it. release-image.yml already builds by digest, verifies that digest, and tags only after Verify.
    • Rejected: Rebuild from the cache for the release tag. Run 44415593173 pushed a different digest from the one it scanned. The 2026-11-19 decision replaces this design.
  • What time limits do the image jobs keep?: Keep the current job and step limits: the service job 12 min, the runner job 18 min, the bake step 12 min, and each scan step 4 min. The body's 12-minute job limit and 3-minute scan would cut the runner job and the scans below today's values. (best practice) [sources: .github/workflows/ci.yml, .github/workflows/release-image.yml]
    • Chosen: Keep the current job and step limits. These are the limits that the current jobs run under, and the runner job needs its 18-minute limit.
    • Rejected: Use the body's 12-minute job limit and 3-minute scan. It cuts the runner job's 18-minute limit and the scans' 4-minute limit below today's values.
  • Is ci(security): scan each image with one Trivy action and SARIF #6405, the image-scan action, done?: Yes. .github/actions/image-scan/action.yml exists, and the image jobs and the release verify job call it. The change is archived, so this issue no longer waits on it and dependencies is empty. [sources: .github/actions/image-scan/action.yml, .github/workflows/ci.yml, .github/workflows/release-image.yml, openspec/changes/archive/2026-11-20-6405-image-scan-action-sarif/proposal.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#4816, #7330

Activity

  1. added
    source/agent
    type/infra
    on Oct 22, 2026
  2. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/infra. The candidate improves CI infrastructure by consolidating workflows and reducing permissions.
    • Priority: P2-Medium. It's a significant improvement to the CI process but not critical for immediate release.
    • Value: Medium. Improves developer experience and reduces redundancy in CI jobs.
    • Effort: High. Involves refactoring multiple workflows and requires careful handling of permissions and path detection.
  3. changed the title [-]ci(image): one reusable workflow builds the service and devcontainer images, and the pull request build holds no write scope[/-] [+]ci(image): a read-only reusable workflow verifies the service image, and the pull request build holds no write scope[/+] on Oct 22, 2026
  4. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Refine cannot set this item to Ready at 4da1e34 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • A person must decide whether deletion of cleanup-devcontainer.yml is acceptable before this item merges.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: .github/workflows/cleanup-devcontainer.yml.

  5. added
    priority/p2-medium
    status/new
    value/medium
    effort/high
    on Oct 28, 2026
  6. devops-cli-service commented on Oct 29, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 9e8317b until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Is deletion of cleanup-devcontainer.yml acceptable? (a person decides)

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: .github/workflows/cleanup-devcontainer.yml.

  7. 7 remaining items

  8. added
    status/new
    status/ready
    and removed
    status/ready
    status/new
    on Nov 12, 2026
  9. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 87ae9ee (see proposed design in issue body).

  10. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    The stage job stopped. The inputs of the step of the task group "Add the changes job and the image caller to ci.yml" hold 65323 tokens, over the budget of 64000 tokens, also after the model split the groups once. A person decides how to split the item. The job stages the item again when a person runs it with --item 1858.

    The task groups:

    1. Add the read-only reusable image workflow: 26847 tokens
    2. Add the changes job and the image caller to ci.yml: 65323 tokens
    3. Update the CI command tests for the image caller and the changes job: 23656 tokens
    4. Match the image path filter with globs in the architectural test: 49639 tokens
    5. Split the release image work into a verify job and a publish job: 37375 tokens
    6. Delete the devcontainer cleanup workflow: 25737 tokens
    7. Describe the shared image check in the workflow document: 31695 tokens
  11. changed the title [-]ci(image): Add a read-only reusable workflow for the image check[/-] [+]ci(image): move the image checks to one path-filtered workflow[/+] on Nov 19, 2026
  12. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor

    Related change: #7204 (#7202) moves the image checks that need no container into the stages of smoke.Dockerfile. When it merges, the image-smoke action of this item holds only the stage build and the docker run checks that are left: the entrypoint, the read-only sandbox and the size bounds.

  13. added
    status/new
    and removed
    status/ready
    on Nov 25, 2026
  14. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Next step: a person splits the item, or replies in a comment or edits the body to keep one item. See Fit in the section Proposed design of the body.

  15. added
    status/ready
    and removed
    status/new
    on Nov 26, 2026
  16. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

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/highpriority/p2-mediumsource/agentstatus/readytype/infravalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions