Skip to content

Require explicit repo for wildcard push_to_pull_request_branch targets in multi-repo workflows - #49813

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-push-to-pull-request
Aug 2, 2026
Merged

Require explicit repo for wildcard push_to_pull_request_branch targets in multi-repo workflows#49813
pelikhan merged 4 commits into
mainfrom
copilot/fix-push-to-pull-request

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

push_to_pull_request_branch could not resolve sub-repo checkouts in multi-repo workflows when target: "*", because the tool schema had no repo input and fallback execution happened from GITHUB_WORKSPACE. As a result, branch resolution failed when the PR branch existed only in a side checkout.

  • Schema: add repo disambiguation for push-to-PR-branch

    • Added repo (owner/repo) to push_to_pull_request_branch.inputSchema.properties.
    • Updated tool description to include repo in accepted fields.
  • Wildcard target requirements: make repo explicit

    • Updated x-safe-outputs-target-requirements["*"] for push_to_pull_request_branch to require repo (primary + anyOf), so wildcard calls must specify which repository checkout to target.
  • Behavioral contract coverage

    • Updated focused handler test to assert wildcard push_to_pull_request_branch now errors on missing repo (even when pull_request_number is present), matching the new ambiguity guard.
{
  "name": "push_to_pull_request_branch",
  "inputSchema": {
    "properties": {
      "repo": { "type": "string" },
      "pull_request_number": { "type": ["number", "string"] }
    }
  },
  "x-safe-outputs-target-requirements": {
    "*": {
      "primary": "repo",
      "anyOf": ["repo"]
    }
  }
}

Run: https://github.com/github/gh-aw/actions/runs/30761726325

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 4.21 AIC · ⌖ 6.14 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix push_to_pull_request_branch for multi-repo workflows Require explicit repo for wildcard push_to_pull_request_branch targets in multi-repo workflows Aug 2, 2026
Copilot AI requested a review from pelikhan August 2, 2026 16:32
@pelikhan
pelikhan marked this pull request as ready for review August 2, 2026 17:33
Copilot AI review requested due to automatic review settings August 2, 2026 17:33
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #49813 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

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.

Pull request overview

Adds repository disambiguation for wildcard PR-branch pushes in multi-repository workflows.

Changes:

  • Adds the repo tool input.
  • Requires repo for wildcard targets.
  • Updates handler validation coverage.
Show a summary per file
File Description
actions/setup/js/safe_outputs_tools.json Adds and requires the repository input.
actions/setup/js/safe_outputs_handlers.test.cjs Tests missing-repository validation.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread actions/setup/js/safe_outputs_tools.json Outdated

@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.

Review: Require explicit repo for wildcard push_to_pull_request_branch targets

The approach is correct — adding repo to the schema and making it the primary requirement for target: "*" properly addresses the multi-repo checkout ambiguity.

One blocking issue found:

The pull_request_number field description (line 1213 in safe_outputs_tools.json) still says "Required when the workflow target is '''*''' (any PR)." — but this is no longer true after this change. repo is now the required field for wildcard targets. This stale description contradicts the new x-safe-outputs-target-requirements and will mislead agents.

See inline comment for the suggested fix.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 25.5 AIC · ⌖ 7.67 AIC · ⊞ 5.4K

Comment thread actions/setup/js/safe_outputs_tools.json Outdated
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

⚠️ Test Quality Score: N/A — Modified Existing Test

Analyzed 1 test: modified existing behavioral test reflecting requirement change. No new tests added.

📊 Test Analysis
Test File Type Change
should require explicit repo when push_to_pull_request_branch target is '*' actions/setup/js/safe_outputs_handlers.test.cjs:1443 Behavioral Modified

Test Overview:
The test validates error handling when push_to_pull_request_branch has a wildcard target (*). The modification reflects a requirement change:

  • Previous requirement: Explicit pull_request_number needed
  • Updated requirement: Explicit repo parameter needed

Quality Assessment:

  • Design contract: Tests a security/safety invariant — handlers must enforce explicit repository scope for wildcard operations
  • Edge/error coverage: Validates error path with proper error message verification
  • Structure: Proper AAA pattern (Arrange/Act/Assert) with mocking and result validation
  • Behavioral focus: Verifies observable error response, not implementation details
  • Assertion quality: Multiple focused assertions (error flag, error message, mock not called)
  • Context: Change accurately reflects spec requirement update (no test inflation)

Violations: None

Verdict

Passed. Modified existing test correctly reflects requirement change. Test verifies critical safety invariant (explicit repo requirement for wildcard targets). No violations detected.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 15.2 AIC · ⌖ 7.24 AIC · ⊞ 8.5K ·
Comment /review to run again

@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.

✅ Test Quality Sentinel: Modified existing test correctly reflects requirement change. Test verifies critical safety invariant (explicit repo requirement for wildcard targets). No violations detected.

@github-actions github-actions Bot mentioned this pull request Aug 2, 2026

@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 a stale description and a missing success-path test.

📋 Key Themes & Highlights

Key Themes

  • Stale pull_request_number description — the field still says it is "Required when the workflow target is *" which contradicts the new repo-first requirement. Agents reading the schema receive conflicting guidance.
  • Missing success-path test — the updated test block covers only the error case. A complementary test asserting that providing repo lets a wildcard call pass the requirements check would close the coverage gap.

Positive Highlights

  • ✅ Clean, targeted schema change — adding repo as a distinct field with a clear owner/repo format description.
  • ✅ Correct x-safe-outputs-target-requirements pivot from pull_request_number to repo, preventing the original fallback-to-GITHUB_WORKSPACE ambiguity.
  • ✅ Tool description updated in lock-step with the schema change.
  • ✅ Test updated to supply pull_request_number while omitting repo, proving the guard fires even when the previously required field is present.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 60.4 AIC · ⌖ 9.04 AIC · ⊞ 7.1K
Comment /matt to run again

Comment thread actions/setup/js/safe_outputs_tools.json Outdated
Comment thread actions/setup/js/safe_outputs_handlers.test.cjs

@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.

Verdict: Request changes

The schema change is incomplete: relaxing the wildcard requirement from pull_request_number to repo alone reintroduces a downstream failure mode instead of fixing it.

💡 Themes
  • Broken validation coherence: push_to_pull_request_branch.cjs (apply-time handler) still hard-requires message.pull_request_number when target === "*", independent of the MCP-layer schema. By dropping pull_request_number from anyOf, calls with only repo now pass early validation and fail later with a confusing, less actionable error, after wasted work (git pin, patch/bundle generation, allowed-files scan).
  • Test coverage gap: the updated test only swaps which single field is missing; the previously-covered "no repo, no PR number" case and the newly-relevant "repo present, PR number missing" case are both left unverified.
  • The schema/description update to add repo as an accepted field is itself reasonable and clearly documented — the issue is solely the x-safe-outputs-target-requirements change dropping the pre-existing pull_request_number requirement instead of requiring both fields together for wildcard targets.

🔎 Code quality review by PR Code Quality Reviewer · auto · 150.2 AIC · ⌖ 4 AIC · ⊞ 7.9K
Comment /review to run again

Comment thread actions/setup/js/safe_outputs_tools.json
Comment thread actions/setup/js/safe_outputs_handlers.test.cjs
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please continue triage on this PR.

Remaining reviewer-visible blockers (newest first):

  • PR Code Quality Reviewer still has a dismissed-but-actionable finding: wildcard push_to_pull_request_branch validation is incomplete because the apply-time handler still requires pull_request_number when target: "*"; make schema and handler validation coherent
  • update the stale pull_request_number field description so it no longer claims it alone is required for wildcard targets
  • add the missing success-path coverage for the wildcard repo requirement so both the reject and allow paths are exercised
  • after addressing those items, run the pr-finisher skill and leave a concise maintainer handoff

Run details: https://github.com/github/gh-aw/actions/runs/30760589044

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.49 AIC · ⌖ 6.49 AIC · ⊞ 8.3K ·
Comment /souschef to run again

…ull_request_branch

Extend validateWildcardTargetRequirement to support an allOf property
(AND semantics) alongside the existing anyOf (OR semantics). Update
push_to_pull_request_branch wildcard requirements to require both repo
(via anyOf) and pull_request_number (via allOf), ensuring MCP-level
validation is coherent with the apply-time handler's requirements.

Also update the pull_request_number field description to document that
both fields must be supplied together for wildcard targets, and add
test coverage for all three paths: missing repo, missing pull_request_number
(with repo present), and both fields present (success path).

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please continue triage on this PR.

Remaining reviewer-visible blockers (newest first):...

Addressed all blockers in commit fix: require both repo and pull_request_number for wildcard push_to_pull_request_branch:

  1. Schema and handler coherence — Extended validateWildcardTargetRequirement with an allOf property (AND semantics alongside existing anyOf OR semantics). push_to_pull_request_branch wildcard requirements now require repo (via anyOf) and pull_request_number (via allOf), matching what the apply-time handler needs.

  2. Stale field description — Updated pull_request_number description to state that both pull_request_number and repo must be supplied together for wildcard targets.

  3. Test coverage — Three paths are now exercised:

    • pull_request_number present, repo missing → errors with "requires repo" ✅
    • repo present, pull_request_number missing → errors with "requires pull_request_number" ✅ (new)
    • Both present → passes wildcard validation (downstream error for a different reason) ✅ (new)

Copilot AI requested a review from gh-aw-bot August 2, 2026 18:34
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please continue triage on this PR.

Remaining reviewer-visible blockers appear addressed in your latest response, but the PR still shows blocking review state. Please:

  • ensure the schema/handler validation update and tests are easy for maintainers to verify
  • run the pr-finisher skill
  • leave a concise maintainer handoff summarizing the final state and any remaining manual review needed

Run details: https://github.com/github/gh-aw/actions/runs/30761726325

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 4.21 AIC · ⌖ 6.14 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please continue triage on this PR.

Remaining reviewer-visible blockers appear addressed in your latest response, but the PR still shows blocking review state. Please:...

Maintainer Handoff

All reviewer blockers have been addressed in commit e226d1d. Here's the final state:

What changed

actions/setup/js/safe_outputs_tools.json

  • Added repo (owner/repo) field to push_to_pull_request_branch.inputSchema.properties
  • Updated x-safe-outputs-target-requirements["*"] to require both repo (via anyOf) and pull_request_number (via allOf) for wildcard targets — this matches the apply-time handler's independent checks and keeps MCP-layer and handler validation coherent
  • Updated pull_request_number description to state both fields must be supplied together for wildcard targets

actions/setup/js/safe_outputs_handlers.test.cjs
Three handler paths are now exercised for wildcard push_to_pull_request_branch:

  1. pull_request_number present, repo missing → errors with "requires repo"
  2. repo present, pull_request_number missing → errors with "requires pull_request_number"
  3. Both present → passes wildcard validation (downstream failure expected in unit context) ✅

Local validation

make agent-report-progress passed — unit tests green, lock files in sync, zero lint errors.

Remaining for human review

  • Five unresolved inline review threads remain open (three active, two outdated). The three active threads (PRRT_kwDOPc1QR86VzTXf, PRRT_kwDOPc1QR86VzWrm, PRRT_kwDOPc1QR86VzWrp) were addressed by commit e226d1d; a maintainer can resolve them.
  • CI re-run needed: the agent's push does not trigger CI workflows. A maintainer should trigger a new run (close/reopen or workflow_dispatch) to get a green CI signal before merging.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please continue triage on this PR.

Your latest maintainer handoff says the blocker is fixed, but the PR still shows unresolved thread / blocking-review state. Please:

  • run the pr-finisher skill
  • leave one concise maintainer handoff that points maintainers to the wildcard validation coherence fix and the three test paths now covered
  • call out any remaining manual maintainer action, especially thread resolution or CI re-run needs

Run details: https://github.com/github/gh-aw/actions/runs/30763117443

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.26 AIC · ⌖ 9.36 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please continue triage on this PR.

Your latest maintainer handoff says the blocker is fixed, but the PR still shows unresolved thread / blocking-review state. Please:...

Maintainer Handoff

All code changes are complete in commit e226d1d. No further code changes are needed.

Wildcard validation coherence fix (actions/setup/js/safe_outputs_tools.json)

x-safe-outputs-target-requirements["*"] now requires both repo and pull_request_number for wildcard push_to_pull_request_branch calls:

"*": {
  "primary": "repo",
  "anyOf": ["repo"],
  "allOf": ["pull_request_number"]
}

anyOf (OR-semantics) gates on repo; allOf (AND-semantics) additionally gates on pull_request_number. This matches what the apply-time handler independently requires, so MCP-layer and handler validation are coherent.

Three test paths covered (actions/setup/js/safe_outputs_handlers.test.cjs)

Input Expected outcome
pull_request_number present, repo absent errors: "requires repo"
repo present, pull_request_number absent errors: "requires pull_request_number"
Both repo and pull_request_number present passes wildcard validation (any further error is downstream)

Remaining manual actions for maintainers

  1. Resolve open review threads — Six inline threads are still open. Three are outdated (their concerns are fixed by e226d1d). Three are active but also addressed by e226d1d. A maintainer should resolve them to clear the blocking review state.
  2. Trigger a CI re-run — The agent's push did not trigger CI. Close/reopen the PR or use workflow_dispatch to get a green CI signal before merging.

@pelikhan
pelikhan merged commit 048649d into main Aug 2, 2026
10 checks passed
@pelikhan
pelikhan deleted the copilot/fix-push-to-pull-request branch August 2, 2026 19:53
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot The reviewer-visible fixes appear landed, and the remaining blocker is cleanup of stale review state. Please run the pr-finisher skill and leave one concise maintainer handoff that:

  • points maintainers to the wildcard validation coherence fix in actions/setup/js/safe_outputs_tools.json
  • confirms the three wildcard test paths now covered in actions/setup/js/safe_outputs_handlers.test.cjs
  • calls out remaining manual maintainer action: resolve the addressed review threads and re-trigger CI on the current head

Newest unresolved review threads to address first:

Run details: https://github.com/github/gh-aw/actions/runs/30764198337

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 11.4 AIC · ⌖ 6.71 AIC · ⊞ 8.3K ·
Comment /souschef to run again

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.3

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: no repo param, so target:'*' can't push to sub-repo checkouts in multi-repo workflows

4 participants