feat: Look at 100 recent builds instead of just 30. - #73
Merged
Conversation
CircleCI limits the number of returned builds to 30 by default, but the endpoint supports up to 100. When using CircleCI workflows, it's entirely possible for a single push to trigger more than 30 builds, which can result in a behavior where sleet will be unable to find some of the "overflow" builds. Bumping this to 100 makes it still possible but much less likely.
Owner
|
Thanks for the PR! Also happy to see that people are using and enjoying Sleet! This change makes so much sense! I will get this merged and a version cut this evening! |
coreyja
reviewed
Mar 6, 2020
| def url | ||
| "https://circleci.com/api/v1.1/project/github/#{github_user}/#{github_repo}/tree/#{branch}?filter=completed" | ||
| "https://circleci.com/api/v1.1/project/github/#{github_user}/#{github_repo}/tree/#{branch}" \ | ||
| '?filter=completed&limit=100' |
Owner
There was a problem hiding this comment.
Weird that I decided to just throw query params in the URL lol
Always fun to see the decisions you made a few years ago!
Like you breaking the query params to a new line!
coreyja
approved these changes
Mar 7, 2020
coreyja
left a comment
Owner
There was a problem hiding this comment.
Looks great to me, thanks again for the contribution!
Owner
|
@temochka This is out and released as version Thanks again for the contribution! |
Contributor
Author
|
The pleasure is mine. Thank you for the quick turnaround ❤️ |
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.
Hey @coreyja! 👋 thank you for sleet :)
CircleCI limits the number of returned builds to 30 by default, but the
endpoint supports up to 100. When using CircleCI workflows, it's
entirely possible for a single push to trigger more than 30 builds,
which can result in a behavior where sleet will be unable to find some
of the "overflow" builds.
Bumping this to 100 keeps it still possible but much less likely.
A more future-proof solution would be to paginate the builds until a match is found or some artificial limit is reached (probably don’t want this to be infinite), but the existing structure makes this approach a little more difficult to implement without dropping caching. Wonder if you have any thoughts about this.