Skip to content

test: pin protected pushes after a multi-line commit message - #32237

Merged
bolichen97 merged 1 commit into
mainfrom
fix/20847-pin-protected-push
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/20847-pin-protected-push

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a push to main chained after a git commit with a multi-line message stays refused, with or without a PATH prefix, whatever later reading of quoted newlines lands.

Today git commit -m 'a⏎⏎b' && git push origin main is refused by the push floor, and so are the env PATH=/x:$PATH git push origin main and PATH=/x git push origin main forms. 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 main after writing an ordinary multi-line commit message.

Not a goal

What changed (motivation → approach → change)

One test in test/test_push_branch_gate.py, in TestGitPushEnforcement (the tests that go through the real enforcement point is_denied). It runs the chain to main three ways (no prefix, env PATH=/x:$PATH, PATH=/x) and asserts each is refused by a git-publish- rule. It accepts any push-floor rule on purpose: today the reason is git-publish-target-unverifiable, and a later reading that reports git-publish-push-protected-branch-name instead 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.
  • It can fail: with the push floor's tags emptied (argv_floor._git_publish_floor_tags returning nothing), is_denied returns None for these commands.
  • Determinism: 20 runs at -n0 and 10 at -n 4 --dist loadgroup --max-worker-restart=2 with test/test_push_branch_gate_parser.py and test/test_security_stream_redaction.py as co-tenants, all green; the whole file in a shuffled order (seed 8513), 105 passed.
  • test/test_flake_pattern_ratchet.py green.

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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 09:24
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 8569153f3e72d701da34a6dc38d0af963ec483a0 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 8569153f3e72d701da34a6dc38d0af963ec483a0 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 8569153f3e72d701da34a6dc38d0af963ec483a0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 8569153f3e72d701da34a6dc38d0af963ec483a0 — this comment is updated in place on each push.

Review details

Test-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 8569153f3e72d701da34a6dc38d0af963ec483a0.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 8569153f3e72d701da34a6dc38d0af963ec483a0 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 8569153f3e72d701da34a6dc38d0af963ec483a0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8569153

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 8569153f3e72d701da34a6dc38d0af963ec483a0 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 09:44
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[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
@bolichen97
bolichen97 force-pushed the fix/20847-pin-protected-push branch from 1004ffb to 8569153 Compare November 7, 2026 14:44
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main (e30915e -> d27a5fd) now that #32252 and #32209 have merged; they fix the two reds this head carried from main. No change to the diff; CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit 6706693 into main Nov 7, 2026
97 of 98 checks passed
@bolichen97
bolichen97 deleted the fix/20847-pin-protected-push branch November 7, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants