Repository navigation
Recognize merged base ancestors when the base tip advances - #69998
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
/matt |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
🟡 Changes recommended
Ancestor-based exemptions can allow protected-file changes to escape validation.
2 open issues
What changed in this PR
Recognizes merged base ancestors when the base tip advances, preventing upstream changes from inflating unsigned bundle validation limits.
Changes:
- Confirms merged ancestors against the pinned tip through REST comparisons.
- Reuses the confirmed baseline for validation and history exclusions.
- Adds coverage for advanced bases and offline object inspection.
| File | Description |
|---|---|
| actions/setup/js/push_to_pull_request_branch.test.cjs | Tests ancestry confirmation, fallback, and validation safeguards. |
| actions/setup/js/push_to_pull_request_branch.integration.test.cjs | Covers advanced-base validation scenarios. |
| actions/setup/js/push_to_pull_request_branch.cjs | Resolves and applies trusted ancestor baselines. |
| actions/setup/js/bundle_transport.integration.test.cjs | Checks newest-ancestor selection without fetching objects. |
Review effort: Max
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs to the new resolveBundleTrustedBase fix for issue #69912.
📋 Key Themes & Highlights
Key Themes
- Unbounded API fan-out: the merge-parent comparison loop in
resolveBundleTrustedBase(push_to_pull_request_branch.cjs:237-247) issues onecompareCommitsREST call per candidate parent with no cap and no retry/backoff, unlike thewithRetry/RATE_LIMIT_RETRY_CONFIGpattern used elsewhere in this file. Since the candidate set is derived from agent-supplied bundle content, a bundle crafted with many merge commits could drive a large, uncapped number of API calls per push.
Positive Highlights
- ✅ Core approach (offline topological ordering + single-parent REST confirmation, newest-first) is sound and well-documented.
- ✅ Strong regression coverage: new integration test in
bundle_transport.integration.test.cjsexercises a realistic advancing-base scenario end-to-end, and the unit test matrix (push_to_pull_request_branch.test.cjs) is thoughtfully expanded with abaseAdvanceddimension covering compare-status variants. - ✅ Safeguards preserved: PR-head fallback on any failure, no fetches, error messages scrubbed of remote diagnostics before logging.
Left one inline comment on the unbounded loop; everything else looks solid.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 107.9 AIC · ⌖ 16.2 AIC · ⊞ 10.1K
Comment /matt to run again
|
✅ 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.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ Matt Pocock Skills 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.
|
|
✅ 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.
|
|
✅ 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.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Request changes
The merged-base recognition logic still has merge-blocking trust and scalability gaps: it can treat arbitrary merged ancestors as a trusted base, and it fans out remote comparisons over agent-controlled merge parents.
Blocking themes
resolveBundleTrustedBaseis still proving only reachability to the pinned tip, not that the selected commit was ever a base-branch tip. That can exclude the wrong history from protected-file and patch-size validation.- The comparison loop is unbounded over merge parents extracted from the bundle range, so a crafted history can turn validation into a burst of remote API calls before we fall back.
- The added tests do not cover the fast path where the pinned tip is already present locally, so regressions in the no-network success path would currently slip through.
Static review only; I did not execute the test suite.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 54.7 AIC · ⌖ 5.91 AIC · ⊞ 12.7K
Comment /review to run again
Keep protected-file and history checks relative to the PR head for non-tip ancestors while retaining their size baseline. Limit ancestor comparisons to four and stop on errors other than missing parents. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…eckouts Cap Git execution time, output, and history scans; abort REST comparisons after five seconds without retries. Keep optional discovery offline and cover unchanged shallow/partial checkout state plus explicit history recovery gating. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Formalize offline baseline discovery, explicit prerequisite recovery, credential roles, and separate size/protection provenance. Add a bounded TLA+ Git-operation model with executable negative controls and reachability witnesses. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot make sure behavior is opt in and and error message information about flag when disabled. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Older merged-base ancestor discovery is now opt-in via |
Remove the handler-local child process executor and getExecOutput replacement. Share structured Git process execution with execGitSync while preserving bounded offline discovery, scrubbed optional diagnostics, and conflict-status handling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Summary
When the base branch advances after an agent merges it, unsigned bundle validation can fall back to the old PR head and count upstream changes against the agent's size limits. This PR adds opt-in recognition of merged base ancestors without fetching base objects or weakening protected-file checks.
Behavior
allow-merged-base-baseline: trueundersafe-outputs.push-to-pull-request-branch. The schema/compiler forward this setting, and relevant patch-size failures point to the opt-in.git ls-remote.Safety and implementation
allow-full-history-fetchseparate and disabled by default. Only literal opt-in permits potentially unbounded prerequisite recovery, using the handler-selected repository credentials; it never enables optional baseline downloads.git_helpers.cjsinstead of a handler-localgetExecOutputreplacement. Preserve append-only delivery, credential separation, conflict-resolution checks, and octopus-merge rejection.