ci: block merging PRs that increase technical debt unless reviewed#38228
ci: block merging PRs that increase technical debt unless reviewed#38228kim-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
|
|
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
Johan and I discussed a split of the technical debt reports into "hard" and "soft" categories. I'm waiting to hear back on that being finalized, and then I or someone else can update this PR to only react to "hard" technical debt increases. |
|
My understanding is that this PR is blocked on such a splitting; let me label it accordingly. I've left a review comment on mathlib-ci#28 about the splitting of metrics. |
|
This PR/issue depends on:
|
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