mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #121] [MERGED] feat(groom): make pr_size_limit settable from GROOM_CONFIG #133
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/121
Author: @mattmillerai
Created: 8/4/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-6345-groom-pr-size-limit-config📝 Commits (1)
a420023feat(groom): make pr_size_limit settable from GROOM_CONFIG📊 Changes
3 files changed (+191 additions, -13 deletions)
View changed files
📝
.github/groom/config.py(+48 -6)📝
.github/groom/tests/test_config.py(+96 -3)📝
.github/workflows/groom.yml(+47 -4)📄 Description
ELI-5
groom's auto-builder refuses to open a PR when the patch it wrote is bigger thanpr_size_limitlines — it files an issue instead. Until now that number could only be changed by editing a workflow file. This makes it a normalGROOM_CONFIGknob, so each repo can tune its own ceiling without a PR, the same way it already tunes cadence,max_prs, scope and the rest.What changed
pr_size_limitmoves out of_LOCKED_KEYSand into_OPERATIONAL_KEYSin.github/groom/config.py.DEFAULTSblob, and theCapture patchstep now readsfromJSON(needs.gate.outputs.resolved).pr_size_limitinstead ofinputs.pr_size_limit. Without that second half the variable would resolve and then be ignored.groom.ymlthat described the knob are updated.test_pr_size_limit_is_lockedis inverted rather than deleted, plus a newTestPrSizeLimitclass covering the coercion decision.test_config.pygoes 50 → 62 tests.Why
nonneg_intand notnumeric_stringThe neighbouring
max_prsis deliberately kept as a string on the principle that a downstream parser is the normalization authority. That principle does not transfer here.pr_size_limit's downstream isPR_SIZE_LIMIT=$(awk -v v="$PR_SIZE_LIMIT" 'BEGIN{printf "%d", v}'), andawk'sprintf "%d"renders any non-numeric value as0with no diagnostic. A limit of0makes[ "$CHANGED" -gt "$PR_SIZE_LIMIT" ]true for every patch, so every build bails to an issue and the builder silently stops opening PRs entirely.awkcannot tell a typo from an intent, so it is not an authority worth deferring to. Rejecting inconfig.pymeans a typo emits a::warning::naming the key and falls back to the caller's reviewed default — the module's documented fail-open behaviour.0remains a legal explicit value meaning "always file issues, never open PRs".The honesty fix
config.py's docstring claimed of_OPERATIONAL_KEYS: "it can only make groom scan less, propose less, or file less — never grant it more privilege." That sentence becomes false the moment this knob is settable — raising it admits a larger machine-written patch into a PR. Deleting thepr_size_limitbullet from the locked list without fixing it would leave the file asserting an invariant it no longer holds, so the docstring now says plainly that this is the one operational knob that can widen behaviour, and carries the reasoning for why that is accepted.Verified against the code, not assumed: groom builder PRs are never auto-merged. The
build_prjob opens them with a plaingh pr create -R … --label groom --label groom-pr --label cursor-review(groom.yml:2156). There is nogh pr merge, no--auto, noenablePullRequestAutoMergeand no merge-enabling GraphQL call anywhere ingroom.ymlor the groom scripts — the only othermergematches in the file are the volume gate's "PRs merged since" activity search and the config-layer merge. Sopr_size_limitis a convenience backstop that keeps an unreviewably-large diff out of the review queue, not the thing that stops it merging. Raising it means a bigger diff reaches a human, not that a bigger diff lands unreviewed.Visibility (the compensating control)
A variable-set value leaves no diff and no branch, so the run itself has to show which ceiling was in force. The gate job's resolve step already echoes the entire resolved knob set (
Resolved knobs: {…}), andpr_size_limitis now part of it — so no second echo was added. There is an inline comment at the enforcement site saying so, to stop a future reader adding a per-build repeat of the same fact.Judgment calls
Capture patchstep.config.pyonly ever dropspr_size_limitfrom the resolved set if the caller's own reviewedwith:value is unusable (a negative literal —type: numberpermits it). If that happened, the expression would render empty,awkwould make it0, and the builder would silently stop opening PRs. The guard falls back toinputs.pr_size_limitwith a::warning::, which reproduces today's behaviour exactly for that input. Arguably unreachable in practice; it is three lines and it guards precisely the silent-disable failure this PR is otherwise designed to prevent.test_reviewed_caller_defaults_keep_their_locked_valueskept as-is (it still assertspr_size_limit: 800passes through from the defaults layer). The property it pins is unchanged — a caller's reviewedwith:value reachesresolveduntouched — so only its docstring gained a note that the knob is no longer locked.Interaction with #108
Open PR #108 (
matt/be-6161-groom-pr-size-limit-600) raises the shared default from 400 to 600 and rewrites the samepr_size_limitinput description block, so the two will conflict textually. They are independent — #108 moves the shared default, this moves where the knob can be set — and neither depends on the other. Whichever merges second rebases. This branch was cut frommain(e4a8f7c) with #108 still open.Testing
groom.ymlparses as YAML. The resolution path was also exercised end-to-end againstconfig.py's CLI with the caller default400:{"pr_size_limit": 900}→900with no warning;{"pr_size_limit": "lots"}→400+::warning::groom config: pr_size_limit='lots' is not a number;{"pr_size_limit": -5}→400+ a non-negative warning;{"pr_size_limit": 0}→0; empty variable →400. The shell guard +awkfloor were run standalone over""," ","900"and"0".Not done
No caller repo changes are needed — this is backwards compatible, and a consumer opts in purely by setting
GROOM_CONFIG(thevarscontext inside a reusable resolves against the caller's repo). Callers still need the usual pin bump to pick it up, which thebump-groom-callersfleet handles.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.