fix(quarantine): Walk paginated /quarantines pages#12
Merged
Conversation
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 ApprovalWonderful, this rule succeeded.
🟢 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the quarantine client to use the Mergify API’s paginated /quarantines endpoint by following RFC 5988 Link: ... rel="next" headers, avoiding statement timeouts triggered by large, unpaginated quarantine sets.
Changes:
- Add pagination support in
Mergify::RSpec::Quarantineby iterating overnextlinks and concatenating results. - Ensure
per_page=100is requested to bound response size per call. - Update specs to reflect the new query params and to cover multi-page and mid-pagination error behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lib/mergify/rspec/quarantine.rb |
Implements pagination by walking RFC 5988 next links and aggregating quarantined test names across pages. |
spec/mergify/rspec/quarantine_spec.rb |
Updates stubbing to include per_page and adds coverage for pagination success and failure cases. |
spec/mergify/rspec/ci_insights_spec.rb |
Updates quarantine endpoint stubs to include per_page in the expected query. |
spec/integration/quarantine_spec.rb |
Updates integration stub expectations to include per_page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The Mergify API kept the unpaginated `GET /v1/ci/{owner}/repositories/{repo}/quarantines` shortcut for backward compatibility but its OpenAPI now states the shortcut "is expected to go away once all callers paginate." Repositories with large quarantine sets (e.g. PSPDFKit at 2,463 entries) trigger statement timeouts on the unpaginated path. Walking RFC 5988 `next` links bounds each request and lets the server drop the shortcut.
References: MRGFY-7391
Change-Id: I20253459ac4b306f562b78090b20d5412cba5e0a
50b909d to
1033cfa
Compare
Contributor
Author
Revision history
|
kozlek
approved these changes
May 27, 2026
JulianMaurin
approved these changes
May 27, 2026
Contributor
Merge Queue Status
This pull request spent 22 seconds in the queue, including 4 seconds running CI. Required conditions to merge
|
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.
The Mergify API kept the unpaginated
GET /v1/ci/{owner}/repositories/{repo}/quarantinesshortcut for backward compatibility but its OpenAPI now states the shortcut "is expected to go away once all callers paginate." Repositories with large quarantine sets (e.g. PSPDFKit at 2,463 entries) trigger statement timeouts on the unpaginated path. Walking RFC 5988nextlinks bounds each request and lets the server drop the shortcut.References: MRGFY-7391