Repository navigation
fix(pr-validation): keep the breaking-change label after the approval - #919
Merged
Merged
Conversation
The label was being removed the moment the change was approved, which
gets it backwards: `breaking-change` describes the commits, and the
break does not stop being a break because somebody agreed to it. The
repository's own labels.yml says as much — "Callers must update their
workflow configuration after this change" is a fact about the change,
not a step in a workflow. Removing it erased the record exactly when it
started to matter: now the break is both real and agreed.
Two labels now, expiring at different times:
breaking-change a fact. Applied throughout, removed only
when the breaking commits are gone
awaiting-breaking-approval a state. On while a decision is pending,
off the moment one is made, either way
Found while implementing this: the cleanup for the fact label did not
exist at all. An earlier rewrite of the verdict job dropped it, so a
reword that removed the `!` left `breaking-change` on the pull request
for good. Restored, and now removing both.
awaiting-breaking-approval added to .github/labels.yml. Both are
cosmetic — a repository that never declared them still gets its gate.
Contributor
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
Contributor
🔍 Lint Analysis
|
Contributor
🛡️ CodeQL Analysis ResultsLanguages analyzed: ✅ No security issues found. 🔍 View full scan logs | 🛡️ Security tab |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
From the CodeRabbit review on #919. The label test asserted on the composite's text, which cannot say which state made which call. Moving `--add-label "$LABEL"` into the `waiting` branch would have left every string in place and stopped the fact label from surviving a decision — the one thing this PR exists to fix. `run_reporter_labels(state)` executes the reporter with `gh` stubbed and returns the `gh pr edit` calls. Each state is checked for the fact label being added and never removed, and for the pending label being added only while waiting. Verified by that exact mutation: three subtests fail. Worth saying plainly: I ran this check by hand while implementing, and pasted its output as evidence. Running it once and versioning it are not the same thing, and only the second survives the next refactor. Also documents the behaviour change for callers who set `label` as a temporary waiting marker — move it to `pending_label` and clear `label`. Callers on the default need nothing.
Contributor
|
@coderabbitai review |
✅ Action performedReview finished.
|
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.
GitHub Actions Shared Workflows
Description
The gate removed the
breaking-changelabel the moment the change was approved. That is backwards: the label describes the commits, and the break does not stop being a break because somebody agreed to it.This repository's own
.github/labels.ymlalready says as much:That is a fact about the change, not a step in a process. Removing it on approval erased the record exactly when it started to matter — the break is now both real and agreed — and a search for
label:breaking-changemonths later would miss every PR that made it through the gate.Two labels, expiring at different times
breaking-changeawaiting-breaking-approvalVerified state by state against the composite:
A second bug, found while implementing this
The cleanup for the fact label did not exist at all. An earlier rewrite of the verdict job dropped it, so a reword that removed the
!leftbreaking-changeon the pull request permanently — the one moment the label genuinely should come off was the one moment nothing happened.Restored, now removing both labels, with a test pinning it to the
state=nonepath.Type of Change
feat: New workflow or new input/output/step in an existing workflowfix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)perf: Performance improvement (e.g. caching, parallelism, reduced steps)refactor: Internal restructuring with no behavior changedocs: Documentation only (README, docs/, inline comments)ci: Changes to self-CI (workflows under.github/workflows/that run on this repo)chore: Dependency bumps, config updates, maintenancetest: Adding or updating testsBREAKING CHANGE: Callers must update their configuration after this PRBreaking Changes
None.
pending_labelis a new optional input with a default;labelkeeps its name and default and only changes when it is removed.Repositories that have not declared
awaiting-breaking-approvalsimply do not get it — labelling is cosmetic throughout and failing to apply one never fails the job. It is added to this repository's.github/labels.ymlhere.Testing
@this-branchor the beta tagLabel behaviour exercised against a stubbed
ghacross all five states — the table above is that run's output.Two tests added: the fact label is never removed by the reporter (no
--remove-label "$LABEL"exists in it), and both labels come off on thestate=nonepath, which is the only place the fact stops being true.actionlint,composite-schema,typosclean; full wiring suite green.Note on provenance: this commit was written on the
feat/one-breaking-change-commentbranch while #918 was merged out from under it, so it ended up pushed with no open PR. It is cherry-picked here unchanged — the four touched files are byte-identical to what was validated there.Related Issues