Skip to content

fix(review): paginate getLatestDeploymentStatus deployments and statuses (#7805) - #7843

Merged
loopover-orb[bot] merged 6 commits into
JSONbored:mainfrom
kai392:fix/preview-deployment-pagination-7805
Jul 21, 2026
Merged

fix(review): paginate getLatestDeploymentStatus deployments and statuses (#7805)#7843
loopover-orb[bot] merged 6 commits into
JSONbored:mainfrom
kai392:fix/preview-deployment-pagination-7805

Conversation

@kai392

@kai392 kai392 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #7805

Test plan

  • Unit tests in test/unit/preview-url.test.ts
  • CI validate + codecov/patch

RealDiligent and others added 6 commits July 21, 2026 21:43
…ses (JSONbored#7805)

Reuse findAcrossPages for both GitHub list reads so preview URL discovery
does not silently miss deployments or statuses beyond page 1.

Closes JSONbored#7805

Co-authored-by: Cursor <cursoragent@cursor.com>
…e only

Avoid a redundant page-1 refetch after pagination and satisfy
exactOptionalPropertyTypes for latestState.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@kai392
kai392 requested a review from JSONbored as a code owner July 21, 2026 14:55
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-21 15:07:19 UTC

2 files · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR paginates getLatestDeploymentStatus's deployments-list and per-deployment-statuses reads via the existing findAcrossPages helper, extending probe to accept an async return so the nested per-deployment status scan can itself paginate. The logic correctly preserves pre-pagination semantics: sawFailure/sawPending bookkeeping keys off statuses[0] only, per-page URL search short-circuits via Promise.all + find, and the outer try/catch still distinguishes 404 (absent) from other errors (error:true). Test coverage is thorough, covering both new pagination paths (deployments and statuses), the failure/pending bookkeeping, non-array payload guards, and id-less deployment skipping.

Nits — 5 non-blocking
  • The console.log calls at src/review/visual/preview-url.ts (deployment_status_error, deployment_lookup_error) already existed pre-diff and match the file's established fail-safe logging convention, so this isn't new debug leftover, contrary to the external brief's flag.
  • findDeploymentUrl and the outer findAcrossPages call both fetch per_page=10 as specified by the issue, but consider extracting the magic literal '200' in message.slice(0,200) into a shared constant if it recurs elsewhere in the file — minor readability nit only.
  • The Promise.all(ids.map(findDeploymentUrl)) inside the deployments-page probe means a page with up to 10 deployments fires up to 10 concurrent per-deployment paginated status scans (each up to 10 pages); this is bounded by PREVIEW_LIST_MAX_PAGES so not unbounded, but worth confirming this concurrency is acceptable under GitHub's rate limits given the added per-status pagination fan-out.
  • Consider documenting in a comment why Promise.all is safe here despite the increased worst-case fan-out (10 deployments × 10 status pages) now that status reads can paginate, similar to the existing PREVIEW_LIST_MAX_PAGES rationale comment.
  • The probe type change to `TResult | null | Promise<TResult | null>` is applied but the JSDoc above findAcrossPages could be updated to mention the async-probe support explicitly.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7805
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 39 registered-repo PR(s), 24 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 39 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff refactors getLatestDeploymentStatus to use findAcrossPages for both the deployments list and each deployment's statuses list, preserving sawFailure/sawPending bookkeeping and the DeploymentLookup return contract, matching the required pattern. It also adds regression tests covering a preview URL found on deployments page 2 and on statuses page 2, plus many edge-case tests for the existing

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Kotlin, Perl, TypeScript, Vue
  • Official Gittensor activity: 39 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit fa21f3e into JSONbored:main Jul 21, 2026
10 checks passed
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.82%. Comparing base (ead55ca) to head (6fb53ba).
⚠️ Report is 14 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7843      +/-   ##
==========================================
+ Coverage   88.65%   88.82%   +0.16%     
==========================================
  Files         730       89     -641     
  Lines       76959    21351   -55608     
  Branches    22787     3722   -19065     
==========================================
- Hits        68229    18965   -49264     
+ Misses       7684     2196    -5488     
+ Partials     1046      190     -856     
Flag Coverage Δ
shard-1 44.52% <30.43%> (-9.10%) ⬇️
shard-2 2.18% <0.00%> (-49.35%) ⬇️
shard-3 75.91% <100.00%> (+25.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/visual/preview-url.ts 84.67% <100.00%> (+12.15%) ⬆️

... and 641 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getLatestDeploymentStatus doesn't paginate deployments/statuses reads, unlike its siblings in the same file

2 participants