Repository navigation
fix(cargo-target-janitor): paginate both deletion-safety liveness reads (#6618) - #6724
Merged
Merged
Conversation
|
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 19 minutes. 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. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6618
Both of the janitor's deletion-safety liveness reads were single-page reads with a silent cap, so a truncated source was indistinguishable from a complete one — the one degraded shape that did not stop cleanup:
queue_claimsnow offset-paginates (limit=1000&offset=N) until a short page, and raisesSafetyErrorif the read would need more than 100 pages — a possibly-truncated claimed set fails closed.open_pr_branchesnow pages the REST pulls endpoint (per_page=100&page=Nviagh api) until a short page, raisingSafetyErrorpast 200 pages. Invalid/non-list responses still raiseSafetyErroras before. The plan-time read and the apply-loop re-check both call this one function (andqueue_claims) — no second, weaker copy.queue_task_statesdispositioned by construction: its locally-built ID set is chunked at 500 IDs per query withlimit=1000, so no chunk's page can ever truncate its answer (previously onelimit=1000read over the whole set).Tests (
infra/cargo-target-janitor/tests/test_cargo_target_janitor.py, stub PostgREST module honouring limit/offset and stubghhonouring per_page/page): over-page cases for both reads (1005 claimed, 600 PRs), at-cap boundaries (exactly 1000 claimed / 500 PRs), fail-closed when pages never end (both reads), and chunking past 1000 IDs forqueue_task_states(3 queries, all 1200 states). 20/20 pass on the laptop (13 existing + 7 new). Venue note per the filing: the janitor's tests still run in no workflow — #5952 tracks that gap; these were run on the laptop.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.