Repository navigation
Conversation
Architecture-Review: unchanged; the initial interval resumes after confirmed admission with the same timeout and queue verdicts. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 2156b3119513ac2db0c1934a9402403a857fd4e3, 26.3s: 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.
| ) -> Iterator[None]: | ||
| delay = WAIT_INTERVAL | ||
| while True: | ||
| was_admitted = admitted is not None and admitted() |
There was a problem hiding this comment.
suggestion: The admission reset relies on a closure seeing a later rebinding of confirmed
_poll_until gets lambda: confirmed, checks it before each yield and checks it again after the yield to spot the transition. This works because Python closures capture variables, not values. When _wait_for_mergify sets confirmed = True inside the loop body, the second call sees the new value. I traced the unconfirmed replay: sleeps come out as [30, 60, 120] while unconfirmed. At t=210, membership is confirmed and delay resets to 30. The landing read at t=240 then sees the merge. Without the fix the sleeps would be [..., 120, 120], so the test does catch the regression. The steady-state, bounded and deadline paths are unchanged for callers that don't pass admitted.
The weak point is that the coupling is implicit. If someone later moves the confirmation into a helper that returns a new value without rebinding the local confirmed, the reset stops firing and nothing complains. A simpler alternative is to have _poll_until accept a value sent back by the caller (gen.send(...)), or to have the caller signal "reset now" directly. Either one makes the transition explicit and removes the second admitted() call. This is not blocking.
Architecture-Review: unchanged; the iterator reads the same confirmation transition and wait budget. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on 6af5ebf5dcee8dffde9c1bd7bdcbfae0ae8233fd, 12.6s: 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.
| deferred_landing_read = False | ||
| print(f"PR #{pr.number} following Mergify queue {queue}; head {pr.head_sha[:12]}; waiting up to {timeout:g}s") | ||
| for _ in _poll_until(started, timeout): | ||
| polls = _poll_until(started, timeout, admitted=lambda: confirmed) |
There was a problem hiding this comment.
suggestion: The polls binding changes nothing and nothing else uses it
for _ in _poll_until(...) already builds the generator once, before the loop starts, so naming it first does not change behavior. The admitted=lambda: confirmed closure reads the same confirmed variable either way, and _poll_until (cli.py:1310/1315) still checks it before and after each yield. polls is not read again in _wait_for_mergify, so there is no send/close or second use that would need the name. The change adds a line and a variable, and the commit title suggests an ordering fix that the code does not need. Smallest fix: revert to the one-line for _ in _poll_until(started, timeout, admitted=lambda: confirmed):. If there is a reason to keep it, say so in a comment.
Architecture-Review: unchanged; Mergify admission backoff and the existing fake-clock coverage are unchanged. Co-Authored-By: Codex <noreply@openai.com>
|
Merged main at
Conflict resolution from diff --git a/tests/test_cli.py b/tests/test_cli.py
remerge CONFLICT (content): Merge conflict in tests/test_cli.py
index fac7c537..2c88f694 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -4354,5 +4354 @@ def test_mergify_confirmed_wait_reads_pr_once_per_steady_poll(wt, gh, monkeypatc
-<<<<<<< 6af5ebf5 (Construct the admission poll iterator before its loop)
- if confirmed and sum(sleeps) == 60:
-=======
- if clock.now == 60:
->>>>>>> a6403fe4 (Reuse the PR reads that bracket hosted eligibility (#1766))
+ if confirmed and clock.now == 60:
@@ -4360 +4356 @@ def test_mergify_confirmed_wait_reads_pr_once_per_steady_poll(wt, gh, monkeypatc
- return mergify.Membership() if confirmed or sum(sleeps) >= 210 else None
+ return mergify.Membership() if confirmed or clock.now >= 210 else None
@@ -4367 +4362,0 @@ def test_mergify_confirmed_wait_reads_pr_once_per_steady_poll(wt, gh, monkeypatc
-<<<<<<< 6af5ebf5 (Construct the admission poll iterator before its loop)
@@ -4369 +4364 @@ def test_mergify_confirmed_wait_reads_pr_once_per_steady_poll(wt, gh, monkeypatc
- assert sleeps == ([30, 30] if confirmed else [30, 60, 120, 30])
+ assert clock.sleeps == ([30, 30] if confirmed else [30, 60, 120, 30])
@@ -4374,7 +4368,0 @@ def test_mergify_confirmed_wait_reads_pr_once_per_steady_poll(wt, gh, monkeypatc
-=======
- assert cli._wait_for_mergify(config, pr, 60, confirmed=True) == "e" * 40
- assert clock.sleeps == [30, 30]
- assert configurations == [(REPO, "main", "main")] * 3
- assert reads_at_membership == [1, 2, 3]
- assert [c["argv"][:2] for c in gh.calls] == [detail] * 4
->>>>>>> a6403fe4 (Reuse the PR reads that bracket hosted eligibility (#1766))Focused tests passed (82). The size gate passed at 8179/8,250 source lines and 13,784/13,850 test lines, with zero test-line growth. Awaiting your verification and the owner-priority landing order. |
|
The local size numbers above apply to this PR head. Main advanced to |
|
Lean verification of the conflict-only refresh (in place of a third review round): head |
|
Superseded by #1813, which carries the verified net change from fresh main and has primary approval on its new head. Both review rounds on this PR were spent before the conflict-resolution merge. |
Carry the verified net change from #1709. Architecture-Review: unchanged; Mergify admission backoff and the existing fake-clock coverage are unchanged. Architecture-Review: unchanged; the iterator reads the same confirmation transition and wait budget. Architecture-Review: unchanged; the initial interval resumes after confirmed admission with the same timeout and queue verdicts. Co-authored-by: eowca <4008965+eowca@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
Restart Mergify backoff when admission is confirmed
Context and goal
Closes #1302
Acceptance
Base
Base: 1778ec8
Notes
Supersedes the #1302 slice of #1425. The architecture still applies because the poll schedule has the same deadline and GitHub observations.
Validation
Recorded for
2156b3119513(unverified, runloopzero check)uv run --group dev ruff check src tests: exit 1Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review