Repository navigation
ci: require a whole-change check in pull requests that change docs or code - #235
Merged
Merged
Conversation
… code The growth guards count lines, and a number cannot judge sense: pages and functions grew by appending, and a failing guard was passed by squeezing lines or cutting words. The guard stays an alarm. A pull request that changes docs or code now says in its description what its author read whole and how the change reshaped it, and the review judges that. - PULL_REQUEST_TEMPLATE.md: a "Whole-change check" section with its prompts in a comment, so the untouched template does not pass - build/whole-change-check.js and whole-change-check.yml: fail a pull request that changes docs/, a README, root Markdown, a module's Components/, Public/, Private/ or .psm1, shared/ or build/ without text in that section; runs again on an edited description; the description reaches the script only through env; Dependabot and release pull requests are exempt - growth.js: a function, file or page that grew says to stop and check the whole, then reshape or raise the baseline with a reason - AGENTS.md, CONTRIBUTING.md: the raised baseline's reason and the check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a release pull request's title ends in its version, so a "chore(release): ..." clean-up is no longer exempt - a "#" line inside a code fence of the description is no heading - the changed files are listed without rename detection, so a file moved out of scope still counts by its old path - the script names no other repository; wording aligned where the review found two texts disagreeing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The growth guards count lines, and a number cannot judge sense. Pages and functions grew by appending, and a failing guard was passed by squeezing lines or cutting words. The guard stays an alarm. A pull request that changes docs or code now carries a written whole-change check, and the review judges it.
whole-change-check.ymlrunsbuild/whole-change-check.jsonopened,synchronize,reopenedandeditedpull requests to main. It fails when the pull request changesdocs/**/*.md, a README, root Markdown, a module'sComponents/,Public/,Private/,Apps/or.psm1,shared/orbuild/, and the description has no## Whole-change checkwith text under it. Editing the description re-runs it.pull_request, neverpull_request_target;contents: read;persist-credentials: false. The body, title and author reach the script only throughenv; no${{ }}insiderun(asserted intests/js/ci.test.js).dependabot[bot]) and release pull requests (titlechore(<scope>): release … x.y.zorchore(release): … x.y.z). The title is the author's word; the review sees it.Whole-change check
Docs, each read whole:
.github/PULL_REQUEST_TEMPLATE.md(a contributor opening a pull request; task: know what to write). The new section sits after the Summary. Its prompts are one comment, so the page people see stays as short as before. Nothing removed.AGENTS.md: I extended the existing growth paragraph by one sentence instead of adding a section.CONTRIBUTING.md: step 5 "Open a pull request" says what the check needs, where a contributor reads it before opening.docs/decisions/0010-growth-guards-are-a-ratchet.mdas it is: "the pull request says why" is still true, and an accepted record is history.Code, each read whole:
build/whole-change-check.js: new, one job: the verdict on a pull request's description. Pure functions (inScope,sectionText,exemption,check) and a thin main that reads onlyprocess.env.build/growth.js: I rewroteADVICEfor powershell, javascript and docs and theACCEPTline. The shared wording is inSTOP;ACCEPTstays the one place for raising the baseline.duplicationstays as it is: its threshold is fixed and has no baseline to raise.tests/js/ci.test.jsgets one test for the new workflow.tests/js/growth.test.jschecks the new message instead of "Shorten the page".Neutral review
A separate read-only session reviewed the commit against the whole repository. Security found nothing:
pull_requestonly,contents: read, and the body only throughenv. I fixed:modules/*/Apps/) were out of scope; now in scope.chore(...): releasetitle. It now needs a version at the end (test: "chore(docs): release notes page" is not exempt).#line inside a code fence counted as a heading. Fences are now tracked (two tests).--no-renames, so a file moved out of scope still counts.Left as is:
docs/site/scripts andmodules/*/examples/stay out of scope, as the scope I was given lists.Test plan
npm test: 0 failures.npm run growth: powershell, javascript, duplication, docs ok.npm run lint: 0 errors (9 existingreact-hookswarnings in files this change does not touch).actionlint .github/workflows/whole-change-check.yml: clean.build/and root Markdown, so the new job runs on it.🤖 Generated with Claude Code