fix(release): add release preflight checks#171
Merged
Conversation
|
Caution Review failedPull request was closed or merged during review WalkthroughThis pull request introduces two release-related additions: a new CI job to preflight-build Nix packages, and a new recipe that validates repository state and runs a dry-run release workflow before executing the actual release. Changes
Sequence DiagramsequenceDiagram
participant Developer
participant Git
participant "GitHub Actions API"
participant "gh CLI"
Developer->>Git: just release-safe <level>
Git->>Git: Validate clean working tree
Git->>Git: Verify on main branch
Git->>Git: Check HEAD == origin/main
Developer->>Developer: Trigger workflow_dispatch
Developer->>"GitHub Actions API": Dispatch release.yml<br/>with tag=dry-run
"GitHub Actions API"-->>Developer: Workflow run initiated
Developer->>"gh CLI": Poll for new run<br/>(matching HEAD)
"gh CLI"-->>"GitHub Actions API": Query run status
Developer->>"gh CLI": gh run watch<br/>--exit-status
"gh CLI"-->>"GitHub Actions API": Monitor until completion
"GitHub Actions API"-->>Developer: Run complete
Developer->>Git: Fetch origin/main
Git->>Git: Verify main didn't advance
alt main advanced during dry-run
Developer->>Developer: Abort
else main unchanged
Developer->>Developer: Execute just release {{level}}
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add two safeguards so release-only failures get caught before we cut a tag.
What changed
Release Preflightjob to CI that runsnix build .#statespace .#statespace-musljust release-safe <level>to dry-run the release workflow onmain, watch it to completion, and only then run the real releasejust release/release-safeso they fail on common bad states instead of retriggering the wrong tagWhy
We hit a release-only Nix packaging failure that normal CI did not cover, and the existing release recipe could also retrigger the previous tag if
cargo releaseexited before creating a new tag.These changes make the safer path the obvious one:
Validation
just --show release-safecargo fmt,cargo clippy)mainpreviously passed after the Nix filter fixSummary by CodeRabbit