Skip to content

fix(pr-pipeline): page the monitoring lane's failed-runs read so fork runs cannot hide a failure - #10352

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8534-40390416465-1
Oct 26, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8534-40390416465-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8534

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The monitoring lane's failed-runs read fetched one page of 100 and only then dropped fork, pull-request and test-suite runs, so 100+ failing fork runs could hide a failed run of this repository's own. Following the recorded decision on #8534, it now pages up to LIMITS.failedRunPages (5), stopping on a short page or once LIMITS.failedRuns (12) runs are kept, and records a failed runs gap when 5 full pages keep fewer (issues.mjs maps that gap to signal 3, so its open issue is left as is). Runs are keyed by id so one that shifts onto the next page mid-read is kept once.

Not verified

  • node --test .github/scripts/maintenance-monitor-signals/collect.test.mjs was not run: this lane allows no interpreter, and check-affected runs suites only with --tests, which it was run without. The tests were traced by hand only and are left to the PR's CI
  • The decision's early stop 'when a page reaches runs created before the read's created range' was not added as separate code: the request's created= filter already keeps those runs out of every page, so the short-page stop covers it
  • The review ran as a local fresh-context subagent because review-venue.txt is absent from the scratchpad; the CI review lanes still run on the PR

Fix

  • .github/scripts/maintenance-monitor-signals/collect.mjs: added LIMITS.failedRunPages = 5; the failed-runs source pages with &page=, filters each page, de-duplicates by run id, stops at a short page or 12 kept runs, and pushes a `failed runs: over 500 failed runs in the window; the rest were not
  • .github/scripts/maintenance-monitor-signals/collect.test.mjs: added tests: 100 fork runs on page 1 and an own run on page 2 returns the own run in 2 requests; a run repeated across pages is kept once; full fork pages stop at 5 requests and push the failed runs gap; a full page of own runs stops af
  • docs/conventions/pr-pipeline/README.md: the monitoring-lane section states the failed-runs paging, its 5-page cap and the signal-3 gap
  • .changes/pr-pipeline/fix-8534-failed-runs-paging-5e2c9a14.md: new patch changelog fragment for pr-pipeline (written by hand: new-changelog-fragment refused because HEAD is detached)

Verification

The runner ran each check from the base copy against 7bc5917:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository: per_page max 100 (default 30), page default 1, created filters to a date-time range, and filtered queries return at most 1,000 results; the page does not state the ordering, so the
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 6 changelog fragment(s) under .changes/ are valid
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 8 passed, 5 skipped over 4 changed files (the rest are CI only)
  • cant-fail-scan --file .github/scripts/maintenance-monitor-signals/collect.test.mjs --check: PASS, 17 test blocks parsed, no gating findings
  • fresh-context review subagent: no correctness bugs; it hand-traced every test in collect.test.mjs as passing, including the two existing tests the acceptance criteria name. Its one note (a run duplicated across pages by mid-read offset shift) was fixed, and a test was added for it
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40390416465

Left out: the items under Not verified.

Related

#8534

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #10352 (head 7bc5917)

I found no security issues in this pull request. I read the diff and the PR context only, not the wider source tree.

Scope. The change touches four files: collect.mjs and its test in the monitoring lane's signal collector, the pr-pipeline README, and a changelog fragment. None match a trusted path. docs/conventions/pr-pipeline/README.md is documentation, not docs/conventions/pr-pipeline.yaml. No plugin manifest is touched, so there are no manifest <field> lines. No standing instruction is deleted or softened, so the instruction-surface lens doesn't apply.

What I checked.

  • Filters unchanged. Every page still goes through the same filters before a run is kept: SKIP_FAILED_EVENTS, SKIP_FAILED_PATHS, ownHead(r) and completedInWindow(r). Paging doesn't widen what counts as the repository's own run, and fork-head runs are dropped on every page.
  • Bounded reads. Paging stops at LIMITS.failedRunPages (5), on a short page, or once 12 runs are kept. Each page goes through get, which spends the run's call budget. That adds at most 4 REST calls to a run that is already capped at 250 calls.
  • No new injection surface. page is a loop integer. created, repo and per_page are unchanged, so the URL gets no untrusted input.
  • De-duplication. Keying kept runs by r.id means a run that shifts between pages is counted once. It can't be counted twice to fill the 12-run limit, and it can't push out other runs.
  • Gap on truncation. The failed runs: over 500… gap is pushed only when the last page was full and fewer than 12 runs were kept. This matches the existing "lane stops" pattern. The README says this gap leaves signal 3's issue as it is, so truncation fails toward leaving the issue open.
  • Annotation text. Failed-run annotation text reaches the signal issues through annotations. That path is unchanged, and the ownHead filter still limits which runs supply it.

Spend. The only extra spend is up to 4 more GitHub REST calls per monitoring run, inside the existing 250-call cap. That is no billed resource and no hold.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

No findings. I read the full diff and the PR context, and checked collect.mjs for how ownHead, completedInWindow, gaps and source are used. I did not run the tests, so my trace of them is by hand only.

What I checked

  • Paging loop (collect.mjs): the loop stops on a short page, on 12 kept runs, or at LIMITS.failedRunPages (5). The gap is pushed only when the last page read was full and fewer than 12 runs are kept. A full page that brings the kept count to 12 or more records no gap, and neither does a short final page.
  • Duplicates and order: the Map keyed by run id keeps a run that shifts onto the next page once. Insertion order is preserved, so .slice(0, 12) still takes the newest runs.
  • Call budget: the change adds at most 4 extra list calls, well under the 250-call REST budget. GitHub caps filtered queries at 1,000 results, which is above the 500 read here.
  • Tests (collect.test.mjs): the new tests trace as passing by hand.
    • The run-id regex runs\/2\d{3}\/jobs matches ids 2000–2099.
    • slice(0, 12) gives 12 kept runs.
    • The flood case makes 5 requests and records the gap.
  • Closing issue fix(pr-pipeline): fork run floods can hide failures from the monitoring lane's run read #8534:
    • A test serves 100 fork-head runs on page 1 and an own run on page 2, and checks the own run is in data.failedRuns.
    • A test checks the 5-request cap and the failed runs gap.
    • The two existing tests the issue names are not touched. I did not run them, so I can't confirm they still pass. The paging only adds a page parameter and keeps the same filters, so I expect them to pass.
    • The "stop on runs older than the created range" item is covered by the created= filter, as the author notes.
  • Docs and changelog: the README paragraph and the patch fragment match the behaviour.

Spend: more failed-run list calls per monitoring run, at most 4 extra against the run's call budget. This is API budget, not a billing change, so there is no hold.

None of the changed files is on the trusted-paths list.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 7bc591736cf8bc52f35fbe8cd6546547c1fccd37.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit c6bf33b Oct 26, 2026
42 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-8534-40390416465-1 branch October 26, 2026 22:13
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.

fix(pr-pipeline): fork run floods can hide failures from the monitoring lane's run read

0 participants