Skip to content

fix(pr-validation): keep the breaking-change label after the approval - #919

Merged
bedatty merged 2 commits into
developfrom
fix/breaking-change-label-persists
Oct 16, 2026
Merged

bedatty merged 2 commits into
developfrom
fix/breaking-change-label-persists

Conversation

@bedatty

@bedatty bedatty commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
Lerian

GitHub Actions Shared Workflows


Description

The gate removed the breaking-change label 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.yml already says as much:

- name: breaking-change
  description: Callers must update their workflow configuration after this change

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-change months later would miss every PR that made it through the gate.

Two labels, expiring at different times

Label Nature Removed when
breaking-change a fact about the commits the breaking commits are gone
awaiting-breaking-approval a state of the process a decision is made, either way

Verified state by state against the composite:

waiting           add breaking-change   add awaiting-breaking-approval
approved          add breaking-change   remove awaiting-breaking-approval
rejected          add breaking-change   remove awaiting-breaking-approval
acknowledgement   add breaking-change   (no pending label — no decision to make)

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 ! left breaking-change on 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=none path.

Type of Change

  • feat: New workflow or new input/output/step in an existing workflow
  • fix: 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 change
  • docs: 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, maintenance
  • test: Adding or updating tests
  • BREAKING CHANGE: Callers must update their configuration after this PR

Breaking Changes

None. pending_label is a new optional input with a default; label keeps its name and default and only changes when it is removed.

Repositories that have not declared awaiting-breaking-approval simply 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.yml here.

Testing

  • YAML syntax validated locally
  • Triggered a real workflow run on a caller repository using @this-branch or the beta tag
  • Verified all existing inputs still work with default values
  • Confirmed no secrets or tokens are printed in logs
  • Checked that unrelated workflows are not affected

Label behaviour exercised against a stubbed gh across 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 the state=none path, which is the only place the fact stops being true.

actionlint, composite-schema, typos clean; full wiring suite green.

Note on provenance: this commit was written on the feat/one-breaking-change-comment branch 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

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.
@bedatty
bedatty requested a review from a team as a code owner October 16, 2026 20:28
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LerianStudio/github-actions-shared-workflows/.coderabbit.yml
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 58554d22-aecf-4e87-bf15-c1f693c74e25
📥 Commits

Reviewing files that changed from the base of the PR and between 241d656 and 23403cd.

📒 Files selected for processing: 4
  • .github/workflows/breaking-change-approval.yml
  • docs/breaking-change-approval.md
  • src/notify/breaking-change-approval-reporter/action.yml
  • src/validate/breaking-change-guard/test-workflow.py

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

The breaking-change approval flow now uses a persistent breaking-change label and a separate awaiting-breaking-approval label. The existing label input now represents the persistent label. A new optional input configures the pending label.

Changes

Breaking-change labels

Layer / File(s) Summary
Reporter label lifecycle
src/notify/breaking-change-approval-reporter/action.yml, .github/labels.yml, src/notify/breaking-change-approval-reporter/README.md, docs/breaking-change-approval.md, src/validate/breaking-change-guard/test-workflow.py
The reporter now adds the configured label in every state. It adds pending-label while waiting and removes it in other states. The label catalog, documentation, and reporter test describe the two labels.
Workflow label wiring
.github/workflows/breaking-change-approval.yml, src/validate/breaking-change-guard/test-workflow.py
The workflow passes both labels to approval and outcome reporters. Acknowledgement reporting receives the persistent label and an empty pending label. When the pull request is out of scope or has no breaking changes, the workflow sets state none and attempts to remove both labels on a non-dry run with a pull request number. The verdict test checks this cleanup sequence.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: 🔵 Low · up to 23403

The stale inputs table could mislead callers configuring labels. Correct it before merge if possible; the remaining risk is limited to documentation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary fix: preserving the breaking-change label after approval.
Description check Passed The description explains the behavior change, affected labels, migration impact, testing, and validation results. It does not include a caller workflow run or related issue, and it marks breaking chan…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the behavior change, affected labels, migration impact, testing, and validation results. It does not include a caller workflow run or related issue, and it marks breaking changes as none despite documenting a migration case for callers that use label as a temporary marker. These are non-critical because the description is otherwise complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@lerian-studio lerian-studio added size/S PR changes 50–199 lines documentation Improvements or additions to documentation workflow Changes to one or more reusable workflow files notify Changes to notification composite actions (src/notify/) validate Changes to PR validation composite actions (src/validate/) composite Changes to any composite action manifest (src/**/*.yml) labels Oct 16, 2026
@lerian-studio

lerian-studio commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🔍 PR Validation Summary

✅ PR Mergeable — no blocking failures

Check Status Blocking
Source Branch ✅ success yes
PR Title ✅ success yes
PR Description ✅ success yes
Breaking Change Guard ✅ success yes
Commit Signatures ✅ success yes
PR Size ✅ success no
Auto Labels ✅ success no
PR Metadata ✅ success no

🔍 View workflow run

@lerian-studio

lerian-studio commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Lint Analysis

Check Files Scanned Status
YAML Lint 3 file(s) ✅ success
Action Lint 1 file(s) ✅ success
Pinned Actions 2 file(s) ✅ success
Markdown Link Check 2 file(s) ✅ success
Spelling Check 6 file(s) ✅ success
Shell Check 2 file(s) ✅ success
README Check 2 file(s) ✅ success
Composite Schema 1 file(s) ✅ success
Deployment Matrix no changes ⏭️ skipped

🔍 View full scan logs

@lerian-studio

lerian-studio commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis Results

Languages analyzed: actions

✅ No security issues found.


🔍 View full scan logs | 🛡️ Security tab

@lerian-studio

This comment has been minimized.

@lerian-studio lerian-studio added the review-ready Required checks passed — CodeRabbit is cleared to review label Oct 16, 2026
@coderabbitai

This comment has been minimized.

coderabbitai[bot]

This comment was marked as resolved.

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.
@lerian-studio lerian-studio added size/M PR changes 200–499 lines and removed size/S PR changes 50–199 lines labels Oct 16, 2026
@lerian-studio

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bedatty
bedatty merged commit 3104682 into develop Oct 16, 2026
48 checks passed
@github-actions
github-actions Bot deleted the fix/breaking-change-label-persists branch October 16, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

composite Changes to any composite action manifest (src/**/*.yml) documentation Improvements or additions to documentation notify Changes to notification composite actions (src/notify/) review-ready Required checks passed — CodeRabbit is cleared to review size/M PR changes 200–499 lines validate Changes to PR validation composite actions (src/validate/) workflow Changes to one or more reusable workflow files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants