Skip to content

chore: CI on main now fails when the dispatcher pin lags behind the newest stable release - #2474

Merged
hatayama merged 2 commits into
mainfrom
chore/hatayama/dispatcher-pin-freshness-gate
Aug 31, 2026
Merged

hatayama merged 2 commits into
mainfrom
chore/hatayama/dispatcher-pin-freshness-gate

Conversation

@hatayama

@hatayama hatayama commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

Part 2 of #2463 (follows #2473). Closes #2463.

Summary

  • CI on main now fails while the dispatcher pin still records an older release than the newest published stable dispatcher-v* release, so a skipped pin stamp is visible instead of silent

User Impact

  • Before: if the pin-stamp PR was never merged (or never opened), nothing in the pipeline noticed. During the 3.0.0 release this let fresh installs land on a beta dispatcher until a manual check caught it
  • After: the build-and-test run on main fails with check-dispatcher-pin-freshness: pin records dispatcher-vX but the newest stable dispatcher release is dispatcher-vY. Merge the automated pin-stamp pull request, or run stamp-dispatcher-pin --tag dispatcher-vY. The failure clears by merging the automated PR from chore: Stable dispatcher releases now open the pin-stamp pull request automatically #2473

Changes

  • cli/release-automation/cmd/check-dispatcher-pin-freshness (new) backed by internal/automation/dispatcher_pin_freshness.go: lists releases via the GitHub API (per_page=100, paged until a short page, fail-closed cap at 50 pages), keeps only non-draft, non-prerelease dispatcher-v<semver> tags without a pre-release identifier, takes the highest, and compares it to dispatcherReleaseTag in Packages/src/project-runner-pin.json. Older pin → exit 1; equal or newer → pass; no stable release yet → pass; unreadable pin or API error → exit 1. Reuses the existing semver comparison (common/version), tag parsing, API headers, and token lookup — no new dependency
  • .github/workflows/build-and-test.yml: new step "Check dispatcher pin freshness" with if: github.event_name != 'pull_request'. It is deliberately not run on pull requests: while the stamp PR is open, every other branch legitimately carries the lagging pin, and failing there would turn all open PRs red for a state only main can fix
  • docs/dispatcher-pin-release-order.md, docs/project-runner-pin.md: document the gate and how to clear it

Verification

  • cli/release-automation: gofmt -l . clean, go vet ./..., go test ./... pass (10 new tests: pagination, filtering of drafts / prereleases / other components / pre-release identifiers, older / equal / newer pin, empty listing, unreadable pin, API error); golangci-lint run with both configs → 0 issues
  • scripts/check-go-cli.sh exit 0; go run ./cmd/check-release-triggers --base origin/main --head HEAD → "Release trigger guard passed."; go run ./cmd/check-file-length → no file over 500 SLOC; actionlint .github/workflows/build-and-test.yml clean
  • Live run against the repository (unauthenticated): Dispatcher pin freshness guard passed: pin records dispatcher-v3.0.1 and the newest stable dispatcher release is dispatcher-v3.0.1. exit 0

Note

  • A workflow_dispatch of build-and-test.yml from a branch whose pin lags will also fail this step; that is the same signal as on main and is intentional

https://claude.ai/code/session_01XbhSMKK4LFud57iAmowDz7

Review in cubic

…er pin

Fresh CLI installs resolve the dispatcher release named by the package pin, so
between a stable dispatcher release and the pin stamp that follows it every new
install keeps landing on the superseded release. Nothing detected that window;
the 3.0.0 and 3.0.1 stamps were only noticed and opened by hand.

The command lists the release repository's releases, keeps the published stable
dispatcher-v<semver> tags, and fails when the pin records an older version than
the newest of those. It fails closed: an unusable pinned tag or an API failure
exits non-zero rather than passing on missing evidence. No stable dispatcher
release at all is the initial state, not staleness, so that passes.
…e release

The freshness command only helps if something runs it. Wire it into
build-and-test.yml for every event except pull_request, so main goes red for as
long as the pin trails the newest published stable dispatcher release and the
lag cannot pass unnoticed until someone happens to look.

Pull requests are excluded on purpose: while the automated pin-stamp pull
request is open, every branch carries the same lagging pin, so failing there
would redden all open work over a state only main can resolve.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 6 minutes.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e6cb653c-b224-4635-ae33-51ac27dbb38a

📥 Commits

Reviewing files that changed from the base of the PR and between 517ad62 and 3ad487e.

📒 Files selected for processing (6)
  • .github/workflows/build-and-test.yml
  • cli/release-automation/cmd/check-dispatcher-pin-freshness/main.go
  • cli/release-automation/internal/automation/dispatcher_pin_freshness.go
  • cli/release-automation/internal/automation/dispatcher_pin_freshness_test.go
  • docs/dispatcher-pin-release-order.md
  • docs/project-runner-pin.md

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

Comment @coderabbitai help to get the list of available commands.

@hatayama
hatayama merged commit 4c27bb2 into main Aug 31, 2026
15 checks passed
@hatayama
hatayama deleted the chore/hatayama/dispatcher-pin-freshness-gate branch August 31, 2026 15:15
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.

Automate dispatcher pin stamping after a stable dispatcher release

1 participant