Skip to content

ci: approval-gated fast path on Blacksmith runners - #124

Merged
khaliqgant merged 3 commits into
mainfrom
ci/fast-path
Nov 15, 2026
Merged

khaliqgant merged 3 commits into
mainfrom
ci/fast-path

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What

Adds .github/workflows/fast-path.yml, a workflow_dispatch workflow (inputs ref, 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.

  • Gate: the first job uses the fast-path environment. 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.
  • Checks (mirrors ci.yml and contract.yml): npm ci, turbo build, turbo typecheck, turbo test --force (landing excluded, as in CI), scripts/check-contract-surface.sh.
  • Image: same build as container.yml (docker/Dockerfile, linux/amd64,linux/arm64, BuildKit provenance and SBOM) pushed to ghcr.io/agentworkforce/relayauth with tags fast-<sha> and sha-<sha> only. It never pushes :latest or 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.
  • npm: not published. publish.yml uses npm trusted publishing (OIDC; there is no NPM_TOKEN secret in the repo), which is bound to that workflow file, so the fast path packs types, core, sdk, migrate, server and relayauth with npm pack and uploads them as the artifact npm-packages-<sha>. No dist-tag, git tag or release is created.

Normal CI, container.yml and publish.yml are unchanged.

  • Hardening: the fast path builds unreviewed refs, so it never saves into a cache that normal CI or release workflows restore (no setup-node/setup-go/setup-uv/bun/zig cache saves, rust-cache save-if: false, restore-only actions/cache, no docker cache-to). The concurrency group includes github.run_id, so a run waiting for approval is never cancelled by a later dispatch of the same ref.

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T18:51:50.964841Z 8dc035b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change adds a manually dispatched workflow that tests a selected ref, publishes an image for its commit SHA, and uploads selected npm package tarballs as a workflow artifact. It does not publish packages to npm or create or move tags or releases.

Changes: Fast-path workflow

Layer / File(s) Summary
Ref selection and validation
.github/workflows/fast-path.yml
The workflow accepts a ref and reason, records the checked-out commit SHA, and runs build, typecheck, tests, and the SDK contract check.
Image build and attestation
.github/workflows/fast-path.yml
After tests pass, the workflow builds and publishes an amd64/arm64 image with SHA-based tags, attests its provenance, and reports the digest.
Package artifact
.github/workflows/fast-path.yml
After tests pass, the workflow packs selected npm packages and uploads the tarballs as a workflow artifact.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant FastPathWorkflow
  participant TestJob
  participant ImageJob
  participant PackageJob
  participant ImageRegistry
  participant WorkflowArtifact
  Operator->>FastPathWorkflow: Dispatch with ref and reason
  FastPathWorkflow->>TestJob: Check out ref and run checks
  TestJob-->>FastPathWorkflow: Report success and commit SHA
  par Build and attest image
    FastPathWorkflow->>ImageJob: Start with tested SHA
    ImageJob->>ImageRegistry: Push SHA-tagged image
    ImageJob-->>FastPathWorkflow: Report digest and run details
  and Pack npm packages
    FastPathWorkflow->>PackageJob: Start after tests pass
    PackageJob->>WorkflowArtifact: Upload tarballs
  end
Loading
Merge Risk: Minimal · up to 8dc03

This adds a manually triggered, approval-gated workflow that tests a chosen ref, publishes a SHA-tagged image, and uploads npm package tarballs as an artifact. It does not change normal CI or release publishing. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: an approval-gated, manually triggered fast-path workflow that runs on Blacksmith runners. It is short, specific, and matches the single added workflow file and its sta…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description clearly relates to the changeset. It explains the new manually dispatched fast-path workflow (ref and reason inputs), its Blacksmith runners, the approval gate, the checks it mirrors f…
Full details: Title check

Explanation

The title names the main change: an approval-gated, manually triggered fast-path workflow that runs on Blacksmith runners. It is short, specific, and matches the single added workflow file and its stated purpose. The title is not generic or vague.

Full details: Description check

Explanation

The description clearly relates to the changeset. It explains the new manually dispatched fast-path workflow (ref and reason inputs), its Blacksmith runners, the approval gate, the checks it mirrors from ci.yml and contract.yml, the image publishing with fast-<sha> and sha-<sha> tags, the npm pack artifact in place of publishing, and the cache hardening. This is specific and matches the raw summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the branch with care,
Then sends a build up through the air.
Two sturdy tags adorn the image,
Packed little parcels join the voyage.
The rabbit thumps: “The checks all pass!”

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e09f0322-797d-432f-bbc4-9f375fa2fa93
Commits

Reviewing files that changed from the base of the PR and between 832111c and 8dc035b.

Files selected for processing: 1

  • .github/workflows/fast-path.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment on lines +39 to +43
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- id: sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/fast-path.yml Outdated
Comment on lines +98 to +102
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.IMAGE }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

Adds an approval-gated workflow on Blacksmith runners for urgent builds.

  • An approved fast path checks a chosen commit before publishing its outputs.
  • Fast-path runs publish multi-platform images under commit-specific tags.
  • Fast-path runs make six npm packages downloadable without publishing them.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Dispatch[Manual dispatch] --> Approval[fast-path environment approval]
  Approval --> Test[Resolve SHA and run checks]
  Test --> Image[Build and publish SHA-tagged image]
  Test --> Pack[Build and upload npm tarballs]
Loading

Reviews (3) · Last reviewed commit: "ci(fast-path): never save shared caches;..." · Reviewed by Greptile

khaliqgant and others added 2 commits November 15, 2026 11:06
… 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>
@khaliqgant
khaliqgant merged commit dd4b6d3 into main Nov 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant