Repository navigation
ci: approval-gated fast path on Blacksmith runners - #124
Conversation
Add a workflow_dispatch fast-path workflow that runs on Blacksmith runners instead of the shared GitHub-hosted queue. The first job is gated on the fast-path environment, so nothing runs until Khaliq approves it. It mirrors ci.yml (turbo build, typecheck, test) and the SDK contract check, then publishes the multi-platform image to ghcr.io/agentworkforce/relayauth tagged fast-<sha> and sha-<sha> only (with provenance, SBOM and attestation, as container.yml does), and packs the npm packages as an artifact. npm publishing uses trusted publishing bound to publish.yml, so the fast path does not publish to npm. No channel tag moves. Existing workflows are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| - id: sha | ||
| run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
🟨 Approval not bound to source commit
With branch or tag inputs, inputs.ref remains mutable until checkout after approval. A ref writer can substitute code between review and checkout. The substituted code runs and publishes under the earlier approval.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Declining: by design the fast path takes a branch, tag or SHA (PR branches included), and the approver approves the dispatch. The ref is resolved to a SHA once, right after approval, every later job builds that SHA, and the run summary prints it. When the exact commit matters, dispatch with a SHA as ref; that input is immutable.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dc035b391
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uses: actions/attest-build-provenance@v2 | ||
| with: | ||
| subject-name: ${{ env.IMAGE }} | ||
| subject-digest: ${{ steps.build.outputs.digest }} | ||
| push-to-registry: true |
There was a problem hiding this comment.
Include the checked-out source SHA in the signed provenance
When this workflow is dispatched from main with inputs.ref pointing to a different branch or commit, the image is built from needs.test.outputs.sha, but this attestation identifies the dispatch commit instead. The action's provenance builder derives its resolved source dependency from the workflow's OIDC ref and sha claims, not the checkout, and this step supplies only the image name and digest. Consequently, the signed attestation does not identify the source actually built, undermining source-commit verification for the explicitly supported PR-branch fast path. Include the resolved checkout SHA in the signed provenance, for example through a custom predicate that records the actual build source.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed: the attest-build-provenance step is removed, since it takes the source commit from the dispatch OIDC claims. The image keeps BuildKit provenance (mode=max) and the revision label, which record the commit actually built.
[Medium impact] The reviewed changes appear safe to merge.
|
… attestation The fast path builds inputs.ref, but attest-build-provenance derives the source commit from the dispatch OIDC claims, so it would attest the wrong commit. BuildKit provenance (mode=max) and the revision label already record the commit actually built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fast path builds unreviewed refs, so it must not write into caches that normal CI or release workflows restore: - drop the setup-node `cache:` inputs (they save on success, keyed only on lockfiles); setup-go `cache: false`; setup-uv `enable-cache: false` - Swatinem/rust-cache `save-if: false`; actions/cache -> actions/cache/restore - setup-bun `no-cache: true`, setup-zig `use-cache: false` - no docker `cache-to`; Blacksmith docker builder cache key namespaced with a fast-path- prefix The concurrency group also carries github.run_id, so a run waiting for approval is never cancelled by a later dispatch of the same ref. Where the repo already tests its workflows, a property test pins the gate: workflow_dispatch only, contents: read, fast-path environment on the first job only, every other job needs it, and the rules above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Adds
.github/workflows/fast-path.yml, aworkflow_dispatchworkflow (inputsref,reason) that runs on Blacksmith runners (blacksmith-4vcpu-ubuntu-2404) so an urgent fix can be checked and its image published without waiting in the GitHub-hosted runner queue.fast-pathenvironment. Khaliq must approve it before anything runs; every other job depends on it. The ref is resolved to a SHA once and later jobs check out that SHA.ci.ymlandcontract.yml):npm ci,turbo build,turbo typecheck,turbo test --force(landing excluded, as in CI),scripts/check-contract-surface.sh.container.yml(docker/Dockerfile,linux/amd64,linux/arm64, BuildKit provenance and SBOM) pushed toghcr.io/agentworkforce/relayauthwith tagsfast-<sha>andsha-<sha>only. It never pushes:latestor a semver tag. The digest is printed in the run summary. No GitHub build attestation is issued: it would name the dispatch commit, not the built ref.publish.ymluses npm trusted publishing (OIDC; there is noNPM_TOKENsecret in the repo), which is bound to that workflow file, so the fast path packstypes,core,sdk,migrate,serverandrelayauthwithnpm packand uploads them as the artifactnpm-packages-<sha>. No dist-tag, git tag or release is created.Normal CI,
container.ymlandpublish.ymlare unchanged.save-if: false, restore-onlyactions/cache, no dockercache-to). The concurrency group includesgithub.run_id, so a run waiting for approval is never cancelled by a later dispatch of the same ref.🤖 Generated with Claude Code