fix(semantic-pr): keep cancelled prerequisites fail closed - #106
Merged
Merged
Conversation
…ilure A prerequisite job reporting `cancelled` gets hard-failed identically to `failure` by the "Reject failed prerequisite" step. But `cancelled` happens routinely: a fast re-push/retitle triggers this workflow's own `concurrency: cancel-in-progress: true` group, superseding an in-flight run whose prerequisite is then reported `cancelled` — normal dedup, not a broken title gate. The superseding run reports its own result for the same required check. Add a "Note cancelled prerequisite" step that treats `cancelled` as a no-op (logs a notice, exits 0) so the job succeeds instead of hard-failing; `failure` and `skipped` keep today's hard-fail behavior unchanged. Update the prerequisite-result input doc, README, and the existing regex-based test in semantic-pr.test.cjs to match the new contract. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qmz53fqQcp7BqStweHH41H
|
Claude finished @kyle-sexton's task in 0s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77082e2d87
ℹ️ 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".
|
Claude finished @kyle-sexton's task in 1s —— View job I'll analyze this and get back to you. |
…lled-prerequisite
|
Claude finished @kyle-sexton's task in 0s —— View job I'll analyze this and get back to you. |
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.
Bug
The reusable semantic-PR gate accepted a caller-provided prerequisite result. A proposed exception treated
cancelledas a successful no-op, but GitHub'sneeds.<job_id>.resultcontract does not prove that a successor run exists: manual cancellation, concurrency cancellation, and other cancellation paths all produce the same value. Allowing a deliveredcancelledresult to pass could therefore make the required PR-title check green without validating the title.Fix
successprerequisite result fail-closed, includingcancelled,failure, andskipped.if: ${{ !cancelled() }}. GitHub recommends this status function when a reporting job should still run after failed/skipped prerequisites but should not resist cancellation of the workflow itself.cancelledreaches the hard-fail path.This preserves the original security contract: a required PR-title check cannot report success unless title validation ran after a successful prerequisite.
Verification
node --test .github/scripts/*.test.cjs— 234/234git diff --checkAuthoritative references
needscontext