Skip to content

fix(merge_queue): log gh stderr, survive one failed repository, fetch heavy fields per changed PR - #34

Merged
NaNIsaac merged 1 commit into
mainfrom
fix/merge-queue-failures
Oct 26, 2026
Merged

NaNIsaac merged 1 commit into
mainfrom
fix/merge-queue-failures

Conversation

@NaNIsaac

Copy link
Copy Markdown
Owner

merge_queue.py (after #33) made one search, one repository listing and one heavy gh pr list (files, checks, comments, body) per repository on every run, and a single failed gh call ended the run with a bare traceback and no gh message.

  • gh failures: gh() raises GhError with the command, exit code and the last 400 characters of stderr, and prints it to stderr, so the sentinel's merge-queue.log shows it. A failed search or repository list ends the run with that message instead of a traceback.
  • One failure does not stop the run: a repository or PR gh cannot read goes into a "조회 실패" section of the digest (name and reason) and the rest is still generated; the exit code is 0.
  • Heavy fields only where needed: with a fresh prs.py snapshot (at most 30 minutes old, HERDR_BOARD_DIR overrides the directory) the repositories come from it, and a PR whose (head sha, updated, checks) match the last run is taken from merge-queue-cache.json next to the snapshot. Only changed PRs are fetched, one gh pr view each. Mergeable always comes from the snapshot. Without a usable snapshot it asks gh as before, one gh pr list per repository.

Measured here on the real account, same output both times: first run with an empty cache 75 s (one view per PR), next run 20 s. The remaining time is the per-base commit lookups for the stale check, unchanged.

local-ci: 2d0e974 | merge_queue.py selftest ok (new cases: no snapshot, cache hit fetches nothing, new head sha fetches one PR, mergeable from snapshot, old and corrupt snapshot, a PR gh cannot read is reported and the others stay, gh stderr in the error); ruff format clean | not run: ruff check tools/conventions.py has one existing import-order finding, left alone

🤖 Generated with Claude Code

@NaNIsaac
NaNIsaac merged commit 93cbbc4 into main Oct 26, 2026
3 checks passed
@NaNIsaac
NaNIsaac deleted the fix/merge-queue-failures branch October 26, 2026 18:33
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.

1 participant