Repository navigation
ci: drop the PR Hygiene commit-count check - #38997
Conversation
The repository squash-merges every PR, so a branch's commit count never reaches main. The check counted base.sha..head, and base.sha is the base tip at event time, not the fork point, so it also counted main commits.
PR Hygiene no longer counts commits, so the template, CONTRIBUTING, AGENTS.md, the CI doc and the prepare-pr skill stop stating the limit and the rebase-only rule that protected it.
The repository also allows merge and rebase merges, so the docs state squash as the default instead of a guarantee.
…/drop-commit-count
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: under squash merge the branch commit count never reaches Notes
[DESIGN-REVIEWED] 5f1b4e3 Description read[DESCRIPTION-READ] 77e1f4457ddb4573379243a340cb9b0415550733f1f3f2f96efed77674308a52 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The removed step's only job was counting branch commits, and with squash merge as the default that count never reaches What this change shipsInventory (8 items) — 8 justifiedIntent: authors stop getting a red required check, or a push to rebase and force-push, because of their branch's commit count. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 5f1b4e3 Description read[DESCRIPTION-READ] 49dbe541db08c39796a726e02e0e5d606733241aa918bb1301dfbd72d073f7a2 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…/drop-commit-count # Conflicts: # CONTRIBUTING.md
Code change approver recommendation: A person should decideWhy: the decider estimates a 6% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: reviewer-lanes-untrusted. This PR removes the "Enforce commit count" step and its Tier: 2, held for a person: reviewer-lanes-untrusted. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head 5f1b4e3. It removes the PR Hygiene commit-count step and updates every doc and test that described or exercised it. Nothing in the repository reads the removed step, its env or its remedy text anymore. The diff-base step stays, and the other hygiene steps that depend on it are unchanged. The changed test files and the other suites that read the hygiene workflow, the PR template and CONTRIBUTING.md all pass on this head, and I found no code error or vacuous test.
Problem / Motivation
Goal: A PR is never failed, or told to rebase and force-push, because of how many commits its branch carries.
PR Hygiene's "Enforce commit count" step fails any PR with more than two commits. PRs here are squash-merged by default (auto-merge and the prepare-pr skill use
--squash), so the branch's commit count does not reachmain. The step catches no bug; it only makes authors rebase and force-push.It also counts wrong. It runs
git rev-list --count "$BASE".."$HEAD", and$BASEis the event'spull_request.base.sha: wheremainwas when the event fired, not where the branch forked. Josh Kiepert traced one case:base.shawas758622b385, the branch's real fork point wasbddefa36fb, so the step counted 61maincommits plus the PR's 1 and reported 62. A re-run reuses the same event, so it reported 62 again. Mergingmaininto a branch (or the Update branch button) trips it the same way.Why it matters
Every author whose branch picks up a merge commit, or whose event base is stale, gets a red required check that no edit to the code can fix. The remedy (rebase, squash, force-push) costs a CI round and can drop a co-author's commits, for a property
mainnever sees.Not a goal
--first-parentas #38678 did for the diff-scoped gates. A correct count still protects nothing under squash merge.push_guard.py's--max-aheadguard. Those guard against squashing someone else's commits or a stale base, which is unrelated to this CI step.mainruleset still allows merge and rebase merges (8 merge-commit PRs landed in the last 60 days); limiting it to squash is a settings change for a maintainer.What changed (motivation → approach → change)
Squash merge makes the per-PR commit count meaningless, so the step is removed rather than repaired.
.github/workflows/pr-hygiene.yml: the "Enforce commit count" step and itsMAX_COMMITSare gone. The checkout stays atfetch-depth: 2and the diff-base step stays, because the reader-list, app-repo, Proof line and Sibling sweep steps still read the merge-base and the base tip..github/workflows/pr-readiness.yml,.github/scripts/code-review-history.sh: comments no longer mention a commit count. Readiness only listed PR Hygiene as a lane; it never read the step's result.test/test_pr_hygiene_guidance.pykeeps its annotation checks;test/test_code_review_history_fetch.pydrops therev-list --countread;test/test_push_guard_record.pystops reading the removed remedy text).CONTRIBUTING.md,AGENTS.md,docs/ci/ci-and-reviews.md, two.kiro/specsdesign notes, one RFC line, and the prepare-pr skill'sSKILL.mdandreferences/ci.mdno longer state a one-or-two-commit limit or a rebase-only rule.push_guard.pyis unchanged. Its--max-aheadceiling refuses a branch that picked up foreign history before a local squash, and--squashbuilds the skill's one reviewed commit; neither exists only for this gate.Backwards compatibility
Compatible: the change only removes a failure; every PR that passed PR Hygiene still passes. A PR merged with a merge commit instead of a squash can now bring more than two commits into
main.Reader: .github/workflows/pr-readiness.yml:PR Hygiene lane -- release -- reads the job's conclusion, not the step; the job still runs and reports
Reader: .github/workflows/pr-hygiene.yml:Resolve diff base (merge-base) -- release -- still feeds the reader-list and app-repo steps; fetch depth unchanged
Reader: src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/push_guard.py:--max-ahead -- subagent -- its own pre-squash guard; never read the CI step
Reader: test/test_pr_hygiene_guidance.py:TestTheCommitCountRemedy -- release -- removed with the step it read
Reader: test/test_push_guard_record.py:test_the_ci_squash_remedy_vouches_only_after_the_refusal_lists -- release -- removed with the remedy text it read
Tests
pytest test/test_pr_hygiene_guidance.py test/test_code_review_history_fetch.py test/test_push_guard_record.py test/test_sweep_check.py test/test_review_repair_routing_skill.py: all pass.scripts/run_scoped_tests.py --surface backend) passes everything this diff touches; its only local failures are intest_design_tweak_*andtest_ci_file_shards/test_ci_pytest_progress(missingpytest_spliton this host), which this diff does not reach.Manual verification
actionlint(actionlint-py) on.github/workflows/pr-hygiene.ymland.github/workflows/pr-readiness.yml: no findings.main(3c57a086ef,5f1b4e333d, the second resolving aCONTRIBUTING.mdconflict). The removed step would have counted 5 and failed. PR Hygiene was green on3c57a086efwith the title, template-section and Reader-line steps still running.scripts/check_comment_history.py,scripts/docs-lint.sh, flake8, isort and black on the changed tests all pass.Related Issues
Related: #3632 (the single-commit rule against GitHub's Update branch button), #38678 (the same stale
base.shaproblem in the diff-scoped gates). Josh Kiepert's analysis of the 62-commit count is the trigger.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); the PR is squash-merged, so it may carry any number of commits