Skip to content

fix(semantic-pr): keep cancelled prerequisites fail closed - #106

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/semantic-pr-cancelled-prerequisite
Jul 15, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/semantic-pr-cancelled-prerequisite

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Bug

The reusable semantic-PR gate accepted a caller-provided prerequisite result. A proposed exception treated cancelled as a successful no-op, but GitHub's needs.<job_id>.result contract does not prove that a successor run exists: manual cancellation, concurrency cancellation, and other cancellation paths all produce the same value. Allowing a delivered cancelled result to pass could therefore make the required PR-title check green without validating the title.

Fix

  • Keep every delivered non-success prerequisite result fail-closed, including cancelled, failure, and skipped.
  • Document the canonical selector-dependent caller with 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.
  • Extend the semantic-PR regression suite to prove the exact caller topology and that cancelled reaches 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/234
  • Focused semantic-PR tests — 2/2
  • actionlint 1.7.12
  • check-jsonschema 0.37.3 against the vendored workflow schema
  • zizmor 1.27.0
  • typos, markdownlint-cli2 0.23.0, and git diff --check

Authoritative references

…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

claude Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 0s —— View job


I'll analyze this and get back to you.

@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: 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".

Comment thread .github/workflows/semantic-pr.yml Outdated
@claude

claude Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1s —— View job


I'll analyze this and get back to you.

@kyle-sexton kyle-sexton changed the title fix(semantic-pr): treat a cancelled prerequisite as a no-op, not a failure fix(semantic-pr): keep cancelled prerequisites fail closed Jul 15, 2026
@claude

claude Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 0s —— View job


I'll analyze this and get back to you.

@kyle-sexton
kyle-sexton merged commit 61d2b1a into main Jul 15, 2026
56 checks passed
@kyle-sexton
kyle-sexton deleted the fix/semantic-pr-cancelled-prerequisite branch July 15, 2026 18:20
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