Repository navigation
Allow signed PR branch pushes under non-blocking rulesets - #77556
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Reviewed PR head 76f3c92a3a726755b9c90bdc5e643aa5ee3cd037 against Safe Outputs MCP Gateway Specification v1.29.25, especially the push-to-pull-request-branch requirements in the protected-branch notes.
Blocking finding: the implementation broadens the protected-branch exception from the normative copilot_code_review-only allowlist to multiple naming/content rules and conditional required_signatures, while the PR does not update the normative specification. The changed reference documentation therefore contradicts the applicable MUST-level contract. Please retain the existing allowlist or synchronize the normative specification through the required specification process with conformance evidence and security/compatibility rationale.
No specification files were edited. Static review only; tests were not run per review instructions.
Generated by PR Specification Reviewer for #77556 · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs to run again
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Reviewed the changed branch-protection classification and signed-push fallback behavior. I found no actionable correctness or regression issues in the changed lines. Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd, requesting changes on one security gap.
Blocking: a signed push admitted by the ruleset exception can still produce unsigned commits through the fallback-as-PR path. allowGitPushFallback is honored by pushSignedCommits, but the fallback-as-PR block in push_to_pull_request_branch.cjs (around L1787) runs an unsigned git push to ${branchName}-fallback without checking it. This contradicts the docs claim that signed pushes fail rather than falling back to unsigned pushes. Please gate that branch on allowGitPushFallback and add a regression test.
📋 Key Themes & Highlights
Key Themes
- Fallback gap (blocking): the new flag does not cover the fallback-as-PR path.
- Test gap: the only fallback-as-PR test runs with
fallback_as_pull_request: false, so the exception path is never exercised. - Helper hardening (minor):
hasOnlyNonBlockingRulesneeds a default for its options argument.
Positive Highlights
- ✅ The helper rename is complete, with no stale callers.
- ✅ The non-blocking rule allowlist matches the docs and the specification.
- ✅
required_signaturesis admitted only for signed pushes, and the tests coverundefined,false, andtrue. - ✅ The per-message
allowGitPushFallbackflag is scoped correctly.
⚠️ Validation limits
The test suite could not run in this environment. npm ci in actions/setup/js fails on a TLS certificate from the package proxy, so this review is based on static reading of the diff and call paths. Please confirm the new tests pass in CI.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| signedCommits, | ||
| onProtectionException: () => { | ||
| // A ruleset exception must not turn a signed push into an unsigned fallback. | ||
| allowGitPushFallback = false; |
There was a problem hiding this comment.
[/diagnosing-bugs] Setting allowGitPushFallback = false stops the signed push from falling back to an unsigned git push, but the fallback-as-PR path (around L1787) still runs an unsigned git push of ${branchName}-fallback and never checks this flag. A signed push admitted by the ruleset exception that hits a non-fast-forward rejection can still create unsigned commits. That contradicts the guarantee in safe-outputs-pull-requests.md (L620) that signed pushes fail rather than falling back to unsigned pushes.
💡 Suggested guard
Gate the fallback-as-PR branch on the same flag:
if ((isNonFastForward || isWorkflowsScopeTimeout) && fallbackAsPullRequest && allowGitPushFallback) {Alternatively, have the fallback PR push go through the signed path. Either way, add a regression test for this case (see the test comment below).
@copilot please address this.
There was a problem hiding this comment.
The fallback-as-PR branch now checks allowGitPushFallback, preventing unsigned fallback pushes for signed ruleset exceptions. Fallback remains available when signed_commits: false. Commit: acaf90e.
| } else { | ||
| expect(result.success).toBe(true); | ||
| expect(result.branch_name).toBe("feature-branch"); | ||
| expect(pushSignedSpy).toHaveBeenCalledWith(expect.objectContaining({ signedCommits: true, allowGitPushFallback: false })); |
There was a problem hiding this comment.
[/tdd] This asserts that allowGitPushFallback: false is passed to pushSignedCommits, but nothing checks the behavior that flag is meant to guarantee. The existing fallback-as-PR test (around L1853) sets fallback_as_pull_request: false, so the fallback path under a ruleset exception is never exercised.
💡 Suggested test case
Arrange a ruleset exception with signedCommits: true, make the signed push reject with a non-fast-forward error, and leave fallback_as_pull_request at its default. Assert that no unsigned git push to a -fallback branch runs and that the result is a failure.
@copilot please address this.
There was a problem hiding this comment.
Added a regression for a signed ruleset exception followed by a non-fast-forward failure; it asserts failure with no fallback PR creation or unsigned git push. Commit: acaf90e.
| * @returns {Promise<boolean>} | ||
| */ | ||
| async function hasOnlyCopilotReviewRules(githubClient, owner, repo, branch) { | ||
| async function hasOnlyNonBlockingRules(githubClient, owner, repo, branch, { signedCommits }) { |
There was a problem hiding this comment.
[/codebase-design] Low risk: hasOnlyNonBlockingRules destructures its last argument with no default, so a caller that passes undefined throws a TypeError. The current caller is safe because checkBranchPushable defaults options to {}, but a default keeps the helper safe if it is reused.
💡 Suggested change
async function hasOnlyNonBlockingRules(githubClient, owner, repo, branch, { signedCommits } = {}) {@copilot please address this.
There was a problem hiding this comment.
The helper now defaults omitted options to {}, and its JSDoc reflects the optional parameter. Commit: acaf90e.
There was a problem hiding this comment.
🟡 Changes recommended
Signing failures can still trigger unsigned Git fallbacks in the PR-branch and extra-empty-commit paths, risking rejected delivery or publication of unsigned commits despite signing requirements.
2 open issues
What changed in this PR
Updates gh-aw’s PR-branch safe output to allow signed pushes under compatible rulesets while retaining checks for default branches, classic protection, and restrictive rules.
Changes:
- Allows specified review, naming, and content rules; permits
required_signaturesonly when signing is enabled. - Passes signing configuration into the guard and disables unsigned fallback in the primary push helper for exception-admitted branches.
- Adds regression coverage and documents the exception and push-time enforcement.
| File | Description |
|---|---|
docs/src/content/docs/specs/safe-outputs-specification.md |
Defines permitted rule types and signing conditions. |
docs/src/content/docs/reference/safe-outputs-pull-requests.md |
Explains ruleset exceptions and fallback behavior. |
actions/setup/js/push_to_pull_request_branch.test.cjs |
Adds signature-rule admission and fallback-policy assertions. |
actions/setup/js/push_to_pull_request_branch.cjs |
Threads signing configuration and fallback policy through the handler. |
actions/setup/js/pr_helpers.test.cjs |
Covers allowed rules, signature requirements, and blocked protection. |
actions/setup/js/pr_helpers.cjs |
Classifies non-blocking rules while preserving verification checks. |
Review effort: Max (dynamic)
| signedCommits, | ||
| onProtectionException: () => { | ||
| // A ruleset exception must not turn a signed push into an unsigned fallback. | ||
| allowGitPushFallback = false; |
| pushRemoteUrl, | ||
| pushToken: headGitHubToken, | ||
| signedCommits, | ||
| allowGitPushFallback, |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "76f3c92a3a726755b9c90bdc5e643aa5ee3cd037",
"kind": "requested",
"schema_version": "1",
"state": "cf95c415c83930db25f323b303b532804e90328c5fdd70e6a2e8cf42147959ae",
"work": [
"00df58854f162edf8c4f957e7fc537006e2069208c9763bc56f682ccd2ce3173",
"06ab072d60e1ba34ecf128d22bb10af86c84624e5976f08e014ab47c659095d4",
"1e0d902d516654456ad45be96c4801a12c49c8333aea0a240a422679fa4599a0",
"879525ab42cf47478c6b5ec661da04d6360eb5ae3e5bbe7f1f2a5c6e2ccb7957"
],
"workflow": "pr-sous-chef"
}
|
…request-branch-fix Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Merged the latest |

Since v1.2.1, the protection guard rejects any ruleset-covered PR branch, including branches requiring only signed commits. This restores compatible pushes without disabling protection checks.
Rule classification
required_signaturesonly when signed commits are enabled.Signed publication
Coverage and documentation