Skip to content

test: pin protected pushes beside a multi-line gh body - #32285

Merged
bolichen97 merged 1 commit into
mainfrom
test/20846-pin-gh-body-pushes
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
test/20846-pin-gh-body-pushes

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A push to main that runs beside a multi-line gh body stays refused by the push gate, and a test says so.

gh pr create --body "notes⏎git push⏎more" is refused today because the push gate reads each line on its own (#20846). That false positive is not being fixed yet. The same per-line reading is what refuses a real push to main placed before or after such a body, or behind a filter that strips its quotes, and nothing pinned those refusals.

Why it matters

A change to how the push gate reads a quoted newline in a gh body is the natural fix for #20846. Without a pin, such a change could let a push to main through and every existing test would stay green.

Not a goal

What changed (motivation → approach → change)

One test in test/test_push_branch_gate.py::TestGitPushEnforcement asserts that five commands, each pushing to main beside a multi-line gh pr create body, are refused by a push-floor rule (rule=git-publish-…); any push-floor rule passes, so a reading that reports a different one still passes. Four rows put the push outside the body: after the closing quote, after &&, before the gh line, and through a tr -d '"' | bash filter. The fifth holds the push line inside the body itself; it pins today's reading of that shape, so a later change to it has to change this test on purpose.

Backwards compatibility

Compatible: test-only; no code path changes.

Removes nothing: the diff only adds a test.

Tests

  • TestGitPushEnforcement::test_protected_push_beside_a_multi_line_gh_body_blocked: every row is refused with a rule=git-publish- reason. Each row is refused on main today; with argv_floor._git_publish_floor_tags returning no tags, is_denied allows every row, the in-body one included, so the test can fail.
  • Determinism (head b6f49296bf12): 20 runs at -n0 and 10 at -n 4 --dist loadgroup --max-worker-restart=2 beside test_push_branch_gate_parser.py and test_security_stream_redaction.py, all green; the file's 106 ids in a shuffled order (seed=21), green.

Manual verification

is_denied on each row on this branch: refused with git-publish-push-protected-branch-name, or git-publish-target-unverifiable for the && row.

Screenshots / video

N/A: no user-visible change.

Related Issues

Refs #20846

Refs #24964

Sibling sweep

N/A: test-only PR, no fix.

Pattern harvest

N/A: test-only PR, no fix.

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

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision d3a75850a7bc9582553205fc8b44ac72bc8ea937 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

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision d3a75850a7bc9582553205fc8b44ac72bc8ea937 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

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

This PR only adds a test. It changes no code path and takes nothing away.

Notes

[DESIGN-REVIEWED] d3a7585

Description read

[DESCRIPTION-READ] 1631deab3eb9f30fa0ea22539a793ded7515f5442941b9e5811819834608da54

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 d3a75850a7bc9582553205fc8b44ac72bc8ea937 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d3a7585

Verdict parsed from the review's SHA-scoped output markers for commit d3a75850a7bc9582553205fc8b44ac72bc8ea937.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d3a75850a7bc9582553205fc8b44ac72bc8ea937 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 d3a75850a7bc9582553205fc8b44ac72bc8ea937 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d3a7585

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

@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 12:14
@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
bolichen97 force-pushed the test/20846-pin-gh-body-pushes branch from a502d72 to 33be79e Compare November 7, 2026 14:54
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The red Backend Tests (3.12, 7) run failed on test/test_platform_collect_ignore.py::test_the_windows_list_ignores_exactly_the_listed_test_files, which was red on main for every sharded run (#32199) and is fixed there by #32209. Coverage Gate failed only because that shard did. Rebased onto main to pick up the fix; the diff is unchanged and CI is 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 previously approved these changes 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 beside a multi-line gh body stays refused; test file only.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 7, 2026
@bolichen97
bolichen97 force-pushed the test/20846-pin-gh-body-pushes branch from 33be79e to b6f4929 Compare November 7, 2026 19:07
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_push_branch_gate.py since this head went green (d27a5fd -> 21597a3); CI re-running.

The only conflict was #32237's test landing at the same spot; both tests are kept and this PR's diff is unchanged (106 tests in the file pass locally).

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
A push to main beside a multi-line gh pr body is refused today:
before or after the body, through a filter that strips its quotes,
or on a line inside the body itself. Nothing pinned that, and a
change to how the push gate reads a quoted newline in a gh body
could let one through. The test asserts a refusal by the push floor,
not one exact rule.

Refs #20846
@bolichen97
bolichen97 force-pushed the test/20846-pin-gh-body-pushes branch from b6f4929 to d3a7585 Compare November 8, 2026 01:16
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in .github/workflows since this head went green (21597a3 -> 3686b1c); CI re-running.

PR Readiness was stuck waiting on PR Hygiene, which now runs from its own workflow file (pr-hygiene.yml, added on main by #30829). The old base did not have that file, so the lane could never start on the previous head. This PR's diff is unchanged (one test in test/test_push_branch_gate.py; the file's 106 tests pass locally).

[operator: bolichen97]

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 8, 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: regression test for a protected push beside a multi-line gh body.

@bolichen97
bolichen97 merged commit 34b6380 into main Nov 8, 2026
97 of 98 checks passed
@bolichen97
bolichen97 deleted the test/20846-pin-gh-body-pushes branch November 8, 2026 03:10
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