Skip to content

Restart Mergify backoff when admission is confirmed - #1813

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/1302-reset-queue-backoff-r53
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/1302-reset-queue-backoff-r53

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Restart Mergify backoff when admission is confirmed

Context and goal

  • Goal: Observe a newly admitted PR at the initial poll interval.
  • Problem: A long admission wait leaves the landing phase at its longest backoff even when membership is newly confirmed.
  • Context: Keep the current schedule and total wait budget. Restart the interval on the single transition to confirmed membership. This replaces Restart Mergify backoff when admission is confirmed #1709. Owner verification.

Closes #1302

Acceptance

  • A fake-clock replay reaches the 120-second backoff before admission. The next landing read uses the initial interval and observes the merge.
  • Steady-state backoff, dequeue and changed-head verdicts, and the wait deadline retain their behavior.
  • Extend the existing replay with zero net new test lines.

Base

Base: bb2aae1

Validation

Recorded for 05d4fa24df56

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

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

Review

Carry the verified net change from #1709.

Architecture-Review: unchanged; Mergify admission backoff and the existing fake-clock coverage are unchanged.
Co-Authored-By: Codex <noreply@openai.com>
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.

@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 3c353c1fa66784dcc7385b7795426e0894bbebe8, 30.3s: approve (0 critical, 0 important, 2 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 src/loopzero/cli.py
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)

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: Unneeded polls temporary

The polls variable is only used once, in the for loop on the next line, and nothing else reads the generator. Calling _poll_until(...) directly in the for statement, as before, keeps the diff smaller and makes it clearer that nothing else uses the generator.

Comment thread src/loopzero/cli.py
) -> Iterator[None]:
delay = WAIT_INTERVAL
while True:
was_admitted = admitted is not None and admitted()

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: Admission is checked twice per tick through a closure

_poll_until calls admitted() before and after each yield to detect the transition. This works because the lambda reads the reassigned confirmed local of _wait_for_mergify. However, the reset depends on a side effect inside the loop body, and the generic poller now carries Mergify-specific state. A one-line comment at the call site would help, saying the lambda deliberately reads the live confirmed. Another option is to have the loop body tell the generator to reset, for example with polls.send(...). That would remove the double evaluation. The current code is correct and every existing _poll_until caller and monkeypatch still works: line 1545 passes bounded=..., line 1611 uses positional arguments only, and the lambda *_ stub at tests/test_cli.py:4752 is only used through _wait_for_merge.

Architecture-Review: unchanged; admission resets the queue interval and source reads keep their deadline allowance.
Co-Authored-By: Codex <noreply@openai.com>

@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 delta review by claude on 05d4fa24df56296db436e138a147a1606fbdcad6, 8.5s: approve (0 critical, 0 important, 0 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.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Merged main at 5cfb9c25 after #1812 landed. The conflict resolution retains both the source-read allowance and the queue-admission backoff reset. On 05d4fa24, all 167 focused tests passed, the size gate measured 8,146/8,250 source lines and 13,688/13,850 test lines with zero test-line growth, and delta review approved. Starting the fresh slotted check before readiness.

@eowca
eowca marked this pull request as ready for review November 26, 2026 11:19
@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 839d8fa at 11:27 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 11:21 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1836
  • ✅ Merged 11:27 · 839d8fa · 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 839d8fa into main Nov 26, 2026
16 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1302-reset-queue-backoff-r53 branch November 26, 2026 11:27
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.

Reset Mergify poll backoff when queue admission is confirmed

1 participant