Repository navigation
Conversation
## Summary Addresses #2001. When a release bot's workflow-touching merge lands on the branch mid-publish, `GITHUB_TOKEN` cannot create the tag at the built commit, since the built commit's `.github/workflows` tree no longer matches the branch head and that token can never hold the `workflows` scope. The follow-up merge matches no release path, so the dependency bump never reached its registry. `github-release` in `build-release-task.yml` gains a step before the create: - Where the built commit's `.github/workflows` tree matches the branch head, it does nothing and the release proceeds as before. - Otherwise it walks the repository activity record for the branch from the head back to the built commit. It requires each update to be a `push` or `pr_merge` by the actor allowlist `publish-plan-task.yml` gates on, which is the same fact that gate reads and needs no new token grant. - It re-checks with `ls-remote` that the branch has not moved, dispatches the calling publisher on the branch, and cancels its own run. The head is then built, validated, and tagged by its own run (D4.2), and no package publish job follows the cancelled one. - Any other shape fails, as the 403 did before, so a human merge is never published by the re-dispatch (D4.1). Recorded as `WORKFLOW.md` D4.7 and scenario S14, with a line in `GOVERNANCE.md` "Release Model". This rolls out to the fleet through the ordinary hub pin bump. No publisher stub changes, since every fleet `publish-release.yml` already grants `actions: write` and declares no dispatch inputs. ## Evidence The decision was checked read-only against `ptr727/aiopurpleair`'s real history: - The failing race (built `9e918bf2`, head `90018ab5`) dispatches. - Two consecutive bot merges dispatch. - The human-merged promotion, a human merge further back, and a head not produced by a push to the branch each refuse. `tests/test_release_guards.py` runs the step's own script, with a `gh` stub that runs its real `--jq` against constructed activity responses. Removing each guard in turn fails the test. A further check keeps the step's allowlist equal to the plan's. ## Known Residuals - A push landing in the moment between the `ls-remote` re-check and `gh workflow run` goes out unchecked, since a dispatch cannot pin a SHA without a new input on every publisher stub. - A newer arrival in the publisher's global concurrency group can replace the pending dispatched run. - The activity endpoint is documented as needing only metadata read. That is not yet verified live under `GITHUB_TOKEN` on a private repository. The `comments` label covers the step's two new comments and one edited job comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Release Workflow** * Publishes overtaken by workflow changes now hand off to a new run on the latest branch and cancel the current run when intervening updates meet the release-bot and branch-stability checks. Otherwise, release creation stops without dispatching another run. * Docker images may already have been pushed before the handoff check. * **Documentation & Tests** * Added guidance and coverage for the new handoff behavior and its edge cases. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
|
CodeRabbit is not prompted on this promotion. It reviewed the identical content on #2002, commit range
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2003 +/- ##
=======================================
Coverage 55.42% 55.42%
=======================================
Files 16 16
Lines 7249 7249
=======================================
Hits 4018 4018
Misses 3231 3231
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new supersede step can terminate early without emitting the intended refuse() error when the activity record lacks a matching after SHA, due to set -e interacting with a failing read, and should be guarded to fail with a clear message.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Promotes develop to main, carrying forward the release-workflow change that avoids failing a publish when the built commit can no longer be tagged due to a workflow-only merge landing mid-run, by re-dispatching the publisher on the updated branch head under strict bot-only activity constraints.
Changes:
- Document the new CI/CD contract guarantee (D4.7) and scenario (S14) describing the “supersede instead of fail” behavior.
- Update
build-release-task.ymlto detect divergent.github/workflowscontent and, when safe, dispatch the caller workflow on the branch head and cancel the current run. - Add regression coverage in
tests/test_release_guards.pyto validate the new “supersede” step behavior and its guardrails.
| File | Description |
|---|---|
| WORKFLOW.md | Adds D4.7 guarantee and S14 scenario documenting supersede behavior. |
| GOVERNANCE.md | Updates Release Model prose to reference D4.7 behavior. |
| docs/reusable-workflows.md | Clarifies caller permissions needs for the D4.7 dispatch/cancel behavior. |
| .github/workflows/publish-plan-task.yml | Updates warning text to point maintainers at both allowlist locations. |
| .github/workflows/build-release-task.yml | Adds “Supersede a release the token cannot tag” step and updates permissions rationale comment. |
| tests/test_release_guards.py | Adds a unit test that executes the new step script against a stubbed activity response and git repo. |
| .agents/skills/workflow-ci-contract/references/test-methodology.md | Adds scenario S14 to the authored skill reference. |
| .agents/skills/workflow-ci-contract/references/d-guarantees.md | Adds D4.7 to the authored skill reference. |
| .github/skills/workflow-ci-contract/references/test-methodology.md | Regenerated skill distribution copy of the S14 addition (do not edit by hand). |
| .github/skills/workflow-ci-contract/references/d-guarantees.md | Regenerated skill distribution copy of the D4.7 addition (do not edit by hand). |
| .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/test-methodology.md | Regenerated plugin distribution copy of the S14 addition (do not edit by hand). |
| .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/d-guarantees.md | Regenerated plugin distribution copy of the D4.7 addition (do not edit by hand). |
| .claude-plugin/fleet-skills/.source-digests/workflow-ci-contract | Updates the digest to match the regenerated skill content. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Summary
Promotes develop to main, carrying #2002.
Suppose a release bot's workflow-only merge lands on the branch mid-publish.
build-release-task.yml'sgithub-releaseno longer fails the release with a 403 at the tag create. It walks the repository activity record from the built commit to the head instead. Where every update is a push or merge by the release-bot allowlistpublish-plan-task.ymlgates on, it dispatches the calling publisher on the branch and cancels its own run. The dependency bump then reaches its registry through the dispatched run. Any other shape fails as before, so a human merge never auto-publishes. The rule isWORKFLOW.mdD4.7, with scenario S14. Callers pick it up through their ordinary pin bump, and no publisher stub changes.Closes #2001
🤖 Generated with Claude Code