Repository navigation
fix(ci): follow GitLab x-next-page past filtered short pages - #2912
Merged
BartWaardenburg merged 7 commits intoSep 27, 2026
Merged
BartWaardenburg merged 7 commits into
BartWaardenburg merged 7 commits into
Conversation
GitLab removes discussions and notes the token may not see after slicing a page, so page 1 can return 99 of 100 items while x-next-page names page 2. The review lookup and the sticky summary lookup treated a short page as the last one, never saw their own earlier threads, and posted every finding again on each pipeline. Follow x-next-page when GitLab sends it; keep the page-size rule only when the header is missing.
Keeps one GitLab GET builder so the token-leak source guard still sees three PRIVATE-TOKEN paths.
BartWaardenburg
enabled auto-merge (squash)
September 26, 2026 14:25
Collaborator
|
Released in v3.31.0. Thanks @Jerc92. |
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.
What
GitLab inline reviews stop posting the same comment again on every pipeline.
fallow ci post-reviewandci reconcile-reviewnow read every page of an MR's discussions, so they find the threads Fallow already opened. The sticky summary lookup (ci post-pr-comment) gets the same fix, so it no longer risks creating a second summary comment.gitlab_get_pagereturns the page together with GitLab'sx-next-pageheader, read as "another page follows".gitlab_has_more_pagestrusts that header. The old rule (a page shorter than 100 is the last one) applies only when the header is missing.x-next-pagenames another page.PRIVATE-TOKENpaths.with_retryable_statusis now a thin wrapper over a genericwith_retryable_response, so the reader gets the final response's headers without a second retry loop.Why
GitLab removes discussions and notes the token may not see after it cuts a page. So a page can hold 99 items while more pages follow. Fallow treated any short page as the last one. It never reached its own threads on later pages, planned every finding as new, and resolved nothing.
Measured on a real MR with 760 discussions, as seen by the project bot that runs the review job:
x-next-pageFallow stopped after page 1, so every pipeline posted all current findings again; one finding had 18 copies, 7 still open. A user who can see the hidden discussion gets 100 items on page 1, which is why the bug didn't show when checked from a personal account.
Test plan
cargo test -p fallow-cli --test integration reconcile_review: 50 passed. The three new tests fail onmain:gitlab_post_review_follows_next_page_past_a_filtered_short_page:mainposts the comment againgitlab_post_review_follows_next_page_past_a_fully_filtered_pagegitlab_sticky_comment_lookup_follows_next_page_past_a_filtered_short_page:mainplanscreateinstead ofupdatecargo test -p fallow-cli --lib: 2996 passed, including the newgitlab_has_more_pages_trusts_next_page_header_over_page_sizeand theapi::testssource guardscargo clippy -p fallow-cli --all-targets -- -D warningscargo fmt --all -- --checknpm run verify:fastx-next-pageheaders.main: 7 posted, 0 stale, the same as the CI job. This branch: 7 skipped, 20 stale seen.The two GitHub list loops still use the page-size rule. GitHub paginates with
Linkheaders, and there's no evidence that it drops items after slicing, so they are unchanged. The GitLab sticky note lookup still stops silently at 100 pages, as before.