Skip to content

fix(pr-pipeline): page through pr-verify runs in the lost-run reconciler - #8685

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/reconcile-paginate-lane-runs
Oct 20, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/reconcile-paginate-lane-runs

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: regression from #8562 reported by the GitHub Support hub

Summary

maintenance-reconcile-lost-runs has failed every scheduled run since
#8562 merged. The plan step lists pr-verify runs for the last 24 hours
in one page and throws when total_count is over 100. pr-verify now has
more than 100 runs a day. The plan counted the failure but still
printed "nothing lost", and the act step exited 1 without saying why.

Fix

  • The lane run listing pages with the existing paginate helper, up to
    LANE_RUN_PAGES (5 pages, 500 runs). Past the cap it still throws and
    counts as a failure.
  • The summary says how many listings failed, not "nothing lost", when
    failed > 0.
  • The act step prints one ::error title=reconcile:: line when it exits
    1, with the plan's listing failures and its own failed re-runs.
  • A changelog fragment for pr-pipeline (patch).

Verification

  • Failing run:
    https://github.com/melodic-software/claude-code-plugins/actions/runs/39456940340
  • New tests: a 150-run listing over 2 pages finds a lost run on page 2;
    a 501-run listing is a failure and never "nothing lost"; act prints
    the reason when the plan's failed > 0. All three fail on
    origin/main (29 pass, 3 fail) and pass here (32 of 32).
  • scripts/check-affected.sh --base origin/main --tests: 10 passed,
    4 skipped.

Related

🤖 Generated with Claude Code

The lane run listing read one page and failed when pr-verify had more
than 100 runs in the lookback, so every scheduled run failed. It now
pages up to 5 pages and still fails closed past that. The plan no
longer says "nothing lost" when a listing failed, and the act step
prints why it exits 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T16:32:41.038032Z db7a569 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed db7a569a196adde378eb721e3a69b4da4aea3ae3: 0 finding(s), 0 as inline comments.

No security issues found in PR #8685 (head db7a569).

The PR touches only the lost-run reconciler script, its test and a changelog fragment, and reads only GitHub API data. I checked these points:

  • Pagination: the new code reuses the shared paginate helper, which throws "has more than N pages" when the cap is hit. A day with more than 500 pr-verify runs is therefore still treated as a failure and never as a partial read. No re-run is issued from incomplete data, and the failure is now reported as "N listings failed; what was lost is unknown" instead of "nothing lost".
  • Page shape: a response that is not a page of runs throws, so the listing fails closed.
  • Run filtering: the lane's runs are still filtered by exact r.path === lanePath, so no other workflow's runs are pulled in.
  • Input handling: the query parameters are still built with encodeURIComponent and a fixed timestamp format, and no untrusted text goes into a request path or shell.
  • Logging: the new ::error line interpolates only integer counts, so it cannot inject workflow commands.
  • Gate behavior: the act step's exit code is unchanged (1 on any failure, 0 otherwise). Only a diagnostic message is added.

The diff changes no instruction surface, so I did not apply the instruction-surface lens or consult the exception register.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed db7a569a196adde378eb721e3a69b4da4aea3ae3: 0 finding(s), 0 as inline comments.

No findings. I read the diff, the PR context, and paginate in .github/actions/check-trusted-trigger/check-trusted-trigger.mjs. I did not run the tests, so the PR's "32 of 32 pass" is author-claimed and unverified.

  • Pagination: reconcile.mjs now reads the lane run listing through the existing paginate helper, capped at LANE_RUN_PAGES (5 pages, 500 runs). The wrapper checks that each page has a workflow_runs array. A malformed page or a listing past the cap throws inside the per-lane try and is counted as a failure, so a partial read is never used. The other listing in plan still has its old single-page check.
  • Report wording: "nothing lost" is now said only when no listing failed. When one did, the message is "N listings failed; what was lost is unknown".
  • Act step: it now prints an ::error title=reconcile:: line, with the plan's listing failures and its own failed re-runs, before it exits 1.
  • Tests: the three new tests cover a lost run on page 2, a listing past the cap, and the act step's reason line. The fake GitHub handles the page= parameter. They cover the changed behaviour.
  • Closing issue: the PR links none (No related issue: …), so there are no acceptance criteria to check.
  • Path-scoped rules: no rule file under .claude/rules/ matches the changed files, apart from the changelog-fragment convention, which the PR follows.

One edge case is too minor to block. A listing of exactly 500 runs fills page 5 and paginate then throws "has more than 5 pages". It errs toward failing, never toward a wrong "nothing lost", and the 501-run test sits past it.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 1097af4 Oct 20, 2026
31 checks passed
@kyle-sexton
kyle-sexton deleted the fix/reconcile-paginate-lane-runs branch October 20, 2026 16:40
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