fix(review): paginate findPreviewUrlFromChecks's check-runs read - #7838
fix(review): paginate findPreviewUrlFromChecks's check-runs read#7838shin-core wants to merge 1 commit into
Conversation
findPreviewUrlFromChecks fetched only page 1 of a commit's check-runs and never followed pagination, unlike its siblings getPreviewBuildState and findPreviewUrlFromPrComments which walk the same endpoint via the file's own findAcrossPages helper. On a commit with >100 check-runs the Cloudflare Workers Builds check-run can land on page 2+, so this discovery returned null even though the check existed -- the PR then showed a permanent loading spinner instead of the real preview screenshot. Reuse findAcrossPages (as the issue requires) so the check-runs scan walks every page, stopping as soon as a page yields a usable preview URL, and preserve the pre-existing best-effort degrade-to-null on a read error.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7838 +/- ##
==========================================
- Coverage 91.37% 88.76% -2.61%
==========================================
Files 729 89 -640
Lines 74688 21348 -53340
Branches 22793 3720 -19073
==========================================
- Hits 68246 18950 -49296
+ Misses 5396 2203 -3193
+ Partials 1046 195 -851
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-21 14:50:20 UTC
Review summary Nits — 3 non-blocking
CI checks failing
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
What & why
Closes #7779.
findPreviewUrlFromChecks(src/review/visual/preview-url.ts) fetched only page 1 of a commit's check-runs (?per_page=100) and never followed pagination — even though the exact same endpoint, in the same file, is walked correctly via the file's ownfindAcrossPageshelper by bothgetPreviewBuildStateandfindPreviewUrlFromPrComments. The file header comment already reasons about this exact truncation (">100 check-runs would push the Cloudflare Workers Builds check-run onto page 2+ … return null/absent as if it genuinely didn't exist"), but this one function never got the fix its neighbours have.Called from
capture.ts:163as the primary preview-URL-discovery step. On a repo with matrix builds / many external checks (>100 check-runs on the head SHA), the Workers Builds check-run lands on page 2+, sofindPreviewUrlFromChecksreturnednullwhile the latergetPreviewBuildState(which paginates) correctly reportedsucceeded— the system knew a preview deploy succeeded but never surfaced its URL, leaving a permanent loading spinner instead of the screenshot.The fix
Reuse
findAcrossPages(the pattern the issue requires — no new pagination loop) for the check-runs read, moving the per-run scan into its probe so the walk stops as soon as a page yields a usable URL. The pre-existing best-effort behavior is preserved: the paginated walk is wrapped in.catch(() => null)so a check-runs read error still degrades to "no URL from this source" rather than throwing, and the earlier combined-commit-status short-circuit is unchanged.Tests (added to
test/unit/preview-url.test.ts, mirroring the siblinggetPreviewBuildStatepagination tests)continue) and resolves the URL from thedetails_url ?? output.summary ?? output.textfallback chain.check_runsarray →null(no throw)..catchdegrades tonull.Validation
preview-url.tstypecheck clean;test/unit/preview-url.test.ts(28) + consumerqueue-3.test.ts(145) greengit diff --checkclean; scoped to the two files above; rebased onto latestmain, mergeable-clean