ci: block merging PRs that increase technical debt unless reviewed#38228
Open
kim-em wants to merge 1 commit intoleanprover-community:masterfrom
Open
ci: block merging PRs that increase technical debt unless reviewed#38228kim-em wants to merge 1 commit intoleanprover-community:masterfrom
kim-em wants to merge 1 commit intoleanprover-community:masterfrom
Conversation
PR summary 98261a9c88Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diffNo declarations were harmed in the making of this PR! 🐙 You can run this locally as follows## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
Member
|
I think this might need to be more fine-grained, with an allow- and/or deny-list. Eg, long files tech debt is currently working really well. So I would like to take it out of this feature. |
The existing technical debt metrics script already reports changes in
a PR summary comment. This PR makes it a merge gate: when debt
increases, a `blocked-by-increases-technical-debt` label blocks bors.
A reviewer can add `allow-increases-technical-debt` to unblock.
The detection uses fail-closed logic: we grep for the safe patterns
("Decrease" / "No changes") and treat everything else as an increase,
so a wording change in the external mathlib-ci script adds the label
rather than silently skipping it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
81bb2ae to
a2f42aa
Compare
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.
This PR adds a merge gate for technical debt increases.
When the existing technical debt metrics script reports an increase, the
buildjob adds anincreases-technical-debtlabel. Acheck-technical-debtjob then addsblocked-by-increases-technical-debt, which blocks bors.A reviewer can add
allow-increases-technical-debtto unblock after confirming the increase is acceptable.Fail-closed detection
The detection greps for the safe patterns (
Decrease in tech debt:/No changes to technical debt.) rather than forIncrease. Ifmathlib-cichanges the script's output wording, the label is added (fail closed) rather than silently skipped (fail open).Labels (three-label pattern, same as #38225)
increases-technical-debtbuildjob (tech debt script)blocked-by-increases-technical-debtcheck-technical-debtjoballow-increases-technical-debtBors's
block_labelshas no conditional logic, so we need the derivedblocked-by-increases-technical-debtlabel to express the conjunction "increases-technical-debt AND NOT allow-increases-technical-debt".False positives can be reported on the mathlib4 Zulip.
🤖 Prepared with Claude Code