feat(tools): record debt changes in per-pull-request fragments #17217
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17217"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-08T14:53:35Z.
What
Pull requests stop editing the shared debt files to add, change or remove entries. Each one adds its own fragment,
docs/dev/debt/changes/<branch>.md, andtools/debt_fold.pyapplies the fragments to the debt files. Two files with different names never conflict, so the debt conflicts between pull requests go away. The proposal and its numbers are in #12521 (comment): today 300 of the 465 open pull requests that conflict withmainconflict in a debt file, and 107 of them conflict nowhere else.tools/debt_fold.py:addputs entries after the last entry of the section that links the same file, or at the end of the section, creating it if needed.changeandremovename text that occurs in exactly one entry of the file, usually its link. Table rows, such as the pending-export lists, count as entries.# TechnicalDebtnames the index.--checkvalidates without writing, and--show <name>prints a debt file with the pending fragments applied.check_conventions.debt_entries.tools/check_conventions.py:debt-fragmenterror folds the pull request's fragments onto the debt files at its head, together with any fragments already pending, and reports one that does not apply.debt-file,debt-lengthanddebt-labelschecks as entries in the debt files.doc-linkresolves them from there.docs/dev/TechnicalDebt.md, with one rule line inCONTRIBUTING.mdand theAGENTS.mdline updated. Headings and text outside entries are still edited in place.No existing entry changes format, and nothing is folded yet. Open pull requests that edit the debt files directly keep merging as they do today. How often to run the fold, and whether a later check should warn about direct entry edits, is your call.
Tested
Windows 11 Home 10.0.26300, Python 3.13.
tools/tests/test_debt_fold.py(9 tests) andtools/tests/test_check_conventions_debt_fragments.py(4 tests). The other 17test_check_conventions*andtest_debt*files pass unchanged.python tools/debt_fold.py --checkon this branch: exit 0, nothing pending.libSceAudioIn.mdthat removessceAudioInSetUsbGain, changessceAudioInSetConnectionsand adds an entry, plus a bad fragment that removes "unknown signature" and changes the same entry.debt-fragmenterrors on the bad one: the target matches 15 entries, and both fragments changesceAudioInSetConnections.Export.cppentries and before its pending-import list, and deleted the fragment.libc.md(24),libSceAgcDriver.md(5) andshader.md(5), as fragments against one common base, fold to the same entries asmain.python tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py: the 18 open pull requests that share these files and merge withmainmerge with this branch. It could not compare 10 that already conflict withmain.git merge-treeagainstmainand against this branch adds no conflicting file to any of them, #14212 included.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)