Skip to content

Allow signed PR branch pushes under non-blocking rulesets - #77556

Merged
pelikhan merged 5 commits into
mainfrom
copilot/push-to-pull-request-branch-fix
Nov 14, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/push-to-pull-request-branch-fix

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

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

    • Allow Copilot review and the specified naming/content rules.
    • Allow required_signatures only when signed commits are enabled.
    • Continue blocking default branches, classic protection, restrictive or unknown rules, and incomplete ruleset verification.
  • Signed publication

    • Pass signed-commit configuration into the guard.
    • Disable unsigned Git fallback for pushes admitted through the ruleset exception.
  • Coverage and documentation

    • Add helper and handler regressions; document allowed rules and push-time enforcement.

pelikhan and others added 2 commits November 13, 2026 21:04
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>
@pelikhan pelikhan changed the title [WIP] Fix push-to-pull-request-branch blocking on all branches with ruleset Allow signed PR branch pushes under non-blocking rulesets Nov 13, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 13, 2026 22:32
Copilot AI dynamic review requested due to automatic review settings November 13, 2026 22:32
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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 analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated by Ponytail Reviewer for #77556 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 182 · ◷

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #77556 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

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.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 thread actions/setup/js/pr_helpers.cjs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-82d00a64-988a-4a92-8abf-04a40ac097fd","parents":[],"payload":{"id":"ldg-6eca14de-3117-40fb-bff5-f552000a819c","operation":"append","value":{"finding_count":1,"head_sha":"76f3c92a3a726755b9c90bdc5e643aa5ee3cd037","outcome":"regression"}},"sha":"sha256:7c7efdb728265ee1746307714e3a384178d8be302190f278cf930d8dd96210e7","timestamp":"2026-11-13T22:41:44.497Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-691c8d88-4613-4a26-91d4-7e44dc53c618","parents":[],"payload":{"id":"ldg-65c7060c-bcbb-4363-88aa-a6470fe07cff","operation":"append","value":{"finding_count":0,"head_sha":"76f3c92a3a726755b9c90bdc5e643aa5ee3cd037","outcome":"no_findings"}},"sha":"sha256:727573ee4bba315b09bc816053ce77d90e86ffeda82e484d8a3aa19ebe3443d2","timestamp":"2026-11-13T22:45:45.618Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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): hasOnlyNonBlockingRules needs 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_signatures is admitted only for signed pushes, and the tests cover undefined, false, and true.
  • ✅ The per-message allowGitPushFallback flag 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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 }));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread actions/setup/js/pr_helpers.cjs Outdated
* @returns {Promise<boolean>}
*/
async function hasOnlyCopilotReviewRules(githubClient, owner, repo, branch) {
async function hasOnlyNonBlockingRules(githubClient, owner, repo, branch, { signedCommits }) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The helper now defaults omitted options to {}, and its JSDoc reflects the optional parameter. Commit: acaf90e.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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_signatures only 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,
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/pr_helpers.cjs:132): address unresolved feedback - Review comment
  3. Review (actions/setup/js/push_to_pull_request_branch.cjs:1030): address unresolved feedback - Review comment
  4. Review (actions/setup/js/push_to_pull_request_branch.test.cjs:1055): address unresolved feedback - Review comment
  5. Review (actions/setup/js/pr_helpers.cjs:120): address unresolved feedback - Review comment

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"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 13, 2026 23:25
…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>

Copilot AI commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged the latest main and addressed the four assigned review threads; the changes are published in acaf90e. The focused and final repository gates passed. CodeQL timed out, and its checker instructed not to retry.

Copilot AI requested a review from gh-aw-bot November 14, 2026 00:00
@pelikhan
pelikhan merged commit 381cedd into main Nov 14, 2026
70 checks passed
@pelikhan
pelikhan deleted the copilot/push-to-pull-request-branch-fix branch November 14, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

push-to-pull-request-branch blocked on every branch when an org ruleset such as required_signatures applies (regression in v1.2.1)

4 participants