Repository navigation
fix(fleet-dispatch-test): paginate scan lists — runs/jobs/workflows/forks read completely (#6605) - #6729
Conversation
…runs/jobs/workflows/forks (#6605)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcdfca5680
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #[test] | ||
| fn paginated_runs_merge_all_pages() { |
There was a problem hiding this comment.
Add property coverage for the pagination state machine
The new paginator has meaningful invariants—preserving item order and contents across page boundaries, stopping at the first short page, and rejecting walks beyond the cap—but its coverage consists entirely of fixed examples. The root AGENTS.md testing doctrine explicitly requires property tests for meaningful invariants and says examples do not replace them. Add generated page-sequence tests using concatenation and expected request sequences as oracles.
AGENTS.md reference: AGENTS.md:L41-L45
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 90b7fe6 — added pagination_property_generated_page_sequences: a dependency-free xorshift generator drives 200 generated page sequences (0–450 items, bare-array and object bodies) through fetch_all_pages, checking the invariants against named oracles — concatenation (merged items equal the model list, order preserved) and the expected request sequence computed from the model (stop at first short page; exactly one extra empty fetch after an exactly-full final page; total_count corrected to the merged length). The cap invariant is pinned too: an endless full-page list errors after exactly MAX_PAGES requests. cargo test -p fleet-dispatch-test → 21 passed.
Fixes #6605.
Claimed and worked in FALLBACK MODE (queue backend down — PostgREST 503 PGRST002; claim/heartbeat markers on #6605 per doc/fleet/queue-fallback-mode.md, posted via gh because the installed fleet 0.1.0 binary has no fallback verb — that gap is filed as #6728).
Problem
fleet dispatch-test scanfetched every GitHub list once with per_page=100 and no page parameter: in-progress runs, per-run jobs, workflows, and forks past item 100 were silently invisible, soactivewas a lower bound presented as exact and a saturated home could be chosen as free.Change (pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs only)
fetch_all_pages(fetch): requests pages until a short page, merges them into one body shaped like a single-page response (object bodies keep their shape; total_count is rewritten to the merged length so it can never again describe only page 1). Past a loud cap (100 pages × 100) it errors rather than presenting a truncated count as exact; a mid-walk transport error fails the scan.Github::get_paginatedwires the driver to the real transport.Tests (cargo test -p fleet-dispatch-test → 20 passed, laptop)
New: 150 runs over 2 pages all visited + total_count corrected; a 250-job run counts active jobs from pages 2–3 (180); pilot workflow on page 2 is present; 101 forks over 2 pages all discovered; full-page-then-empty stops the walk; page-2 transport error propagates. Existing counting tests unchanged and green. Changed lines are rustfmt-clean (the file has pre-existing fmt drift in unrelated regions, left untouched).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.