Skip to content

Skip redundant local Git queries during PR refresh and merge admission - #1735

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/1608-verified-git-savings
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/1608-verified-git-savings

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Skip redundant local Git queries during PR refresh and merge admission

Context and goal

  • Goal: Save one local Git process each when refreshing an open PR at the same head and when requesting merge admission.
  • Problem: PR refresh asks Git whether a verified commit is its own ancestor. Merge admission reads the current branch twice.
  • Context: Existing offline CLI fixtures use real local Git and stub GitHub. On current main they measured 11 Git processes for PR refresh and 8 for merge admission.

Closes #1608

Acceptance

  • Measure 10 Git processes on same-head PR refresh and 7 on merge admission.
  • Preserve distinct-head ancestry failures, Git object verification, and merge cancellation.

Notes

Supersedes #1615 and #1690. This branch retains the merge commit and its test conflict resolution. The upstream push-target check adds one launch to the PR baseline. The regression tests now assert against the redundant calls themselves.

The architecture guide already describes the delivery and verification boundaries. This only removes redundant local queries.

Validation

(no loopzero check run recorded)

Review

  • primary, claude, b04d3a4, approve

Base

Base: 481383a


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

eowca and others added 2 commits November 26, 2026 09:09
Architecture-Review: unchanged; the publication and merge verification boundaries are unchanged.

Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the base merge retains delivery verification and adapts the consolidated ancestry test.

Co-Authored-By: Codex <noreply@openai.com>
@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown

⚠️ The sha of the head commit of this PR conflicts with #1690. Mergify cannot evaluate rules on this PR. Once #1690 is merged or closed, Mergify will resume processing this PR. ⚠️

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

loopzero primary review by claude on b04d3a417c73ff42695cd0ab7237cf1a56dba512, 18.7s: approve (0 critical, 0 important, 1 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread tests/test_cli.py

git_calls.clear()
code, out, err = run(capsys, "pr")
assert not any(call[:2] == ["merge-base", "--is-ancestor"] for call in git_calls)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: The tests don't check the 10 and 7 process totals named in the acceptance criteria

The acceptance criteria call for measuring 10 Git processes on a same-head PR refresh and 7 on merge admission. The new tests only check that the redundant calls are gone: no merge-base --is-ancestor call, and exactly one branch --show-current call. That matches what the Notes say was intended, and it does guard the specific regression. But other extra Git launches could creep back into either path without any test failing. If the totals matter, add assert_git_cost(git_calls, 10, ...) and assert_git_cost(git_calls, 7, ...), using the existing helper at tests/test_cli.py:308, next to the targeted assertions. This is optional.

@eowca
eowca marked this pull request as ready for review November 26, 2026 09:25
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as fb5640f at 09:31 UTC

4 min in the queue, 3 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 09:26 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1761
  • ✅ Merged 09:31 · fb5640f · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit fb5640f into main Nov 26, 2026
21 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1608-verified-git-savings branch November 26, 2026 09:31
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.

Skip redundant local Git queries during PR refresh and merge admission

1 participant