Repository navigation
test: pin protected pushes after a multi-line commit message - #32237
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This adds one test and changes no runtime code. The test pins a decision the code already makes, and it accepts any push-floor rule, so a later change to how quoted newlines are read won't break it. [DESIGN-REVIEWED] 8569153 Description read[DESCRIPTION-READ] 45af8dfa64e7a1d19806ce619f7b562101e845d370063b481684bac5fef0d8cc 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsTest-only addition, no candidates. Nothing to examine beyond that. No findings. [OPUS-REVIEWED] 8569153 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
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: |
|
[operator: bolichen97] The red Backend Tests shards are not from this change (it only adds one test), so this PR is not re-pushed for them:
Coverage Gate and PR Readiness fail closed on those shards. Once #32209 merges, this branch rebases onto main and CI re-runs. |
A push to main chained after a git commit whose message spans several lines is refused today, with or without a PATH or env PATH prefix. Nothing pinned that, and the open work on how the push gate reads a quoted newline is the change that could let it through. The test asserts a refusal by the push floor, not one exact rule, so a reading that reports the protected branch name instead still passes. Refs #20847
1004ffb to
8569153
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: adds one test that a protected push after a multi-line commit message is refused; test file only.
Problem / Motivation
Goal: a push to
mainchained after agit commitwith a multi-line message stays refused, with or without aPATHprefix, whatever later reading of quoted newlines lands.Today
git commit -m 'a⏎⏎b' && git push origin mainis refused by the push floor, and so are theenv PATH=/x:$PATH git push origin mainandPATH=/x git push origin mainforms. No test pins that. The open work on how the push gate reads a newline inside quotes (#20847 and its siblings) is exactly the kind of change that could let one of them through by accident.Why it matters
A push to a protected branch is what the push floor exists to stop. If a future reading of quoted newlines lets this chain through, nothing goes red today, and an agent could push to
mainafter writing an ordinary multi-line commit message.Not a goal
What changed (motivation → approach → change)
One test in
test/test_push_branch_gate.py, inTestGitPushEnforcement(the tests that go through the real enforcement pointis_denied). It runs the chain tomainthree ways (no prefix,env PATH=/x:$PATH,PATH=/x) and asserts each is refused by agit-publish-rule. It accepts any push-floor rule on purpose: today the reason isgit-publish-target-unverifiable, and a later reading that reportsgit-publish-push-protected-branch-nameinstead must still pass.Backwards compatibility
Compatible: test-only; no runtime code changes.
Removes nothing: the diff adds one test and touches no runtime code.
Tests
test/test_push_branch_gate.py::TestGitPushEnforcement::test_protected_push_after_a_multi_line_commit_message_blocked: the three commands above are refused by the push floor.argv_floor._git_publish_floor_tagsreturning nothing),is_deniedreturnsNonefor these commands.-n0and 10 at-n 4 --dist loadgroup --max-worker-restart=2withtest/test_push_branch_gate_parser.pyandtest/test_security_stream_redaction.pyas co-tenants, all green; the whole file in a shuffled order (seed 8513), 105 passed.test/test_flake_pattern_ratchet.pygreen.Manual verification
N/A — unit coverage sufficient: the change is one test of the deny gate's verdict, with no runtime change.
Related Issues
Refs #20847
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.