-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bump: skip PR checking when up to date or livecheck fails #18812
Conversation
0137f2e
to
2ccded4
Compare
`brew bump` will check for PRs related to a package even if the package version and livecheck version are the same. We're presumably only interested in related PRs when the livecheck version differs, so we can reduce GitHub API requests by skipping the check(s) when the versions are equal. We use `bump` in `autobump` workflows, so this should help with recent rate limiting issues (e.g., 3203 out of 3426 autobumped formulae were up to date in a recent run). This also reworks the output for duplicate PRs, making it clear when `bump` skipped checking PRs (as printing "none" would suggest that PRs were checked) and only printing the "Maybe duplicate" information when checked. This makes it a little easier to understand what `bump` has done internally from the output.
This expands test coverage for `BumpVersionParser`, bringing line coverage to 100% and branch coverage to 95.45%. This is the best we can do for branch coverage, as Sorbet will catch an invalid argument type before the method is executed, so we can't exercise the method in a test to get 100% coverage.
`brew bump` will check for PRs related to a package even if livecheck fails to identify new versions. This reworks related conditions to ensure that related PR checks are only run when livecheck returns version information.
2ccded4
to
1cbcc44
Compare
While tinkering with this some more, I noticed that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @samford! Left some comments but for a follow-up PR as feels important to merge this as-is for now to help our rate limits.
Maybe duplicate pull requests: #{maybe_duplicate_pull_requests || "none"} | ||
EOS | ||
if !args.no_pull_requests? && | ||
(new_version.general != "unable to get versions") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to extract unable to get versions
(and, from below, none
) into constants.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew bump
will check for PRs related to a package even if the package version and livecheck version are the same. We're presumably only interested in related PRs when the livecheck version differs, so we can reduce GitHub API requests by skipping the check(s) when the versions are equal. We usebump
inautobump
workflows, so this should help with recent rate limiting issues (e.g., 3,203 out of 3,266 autobumped formulae were up to date in a recent run butbump
still checked them for duplicate PRs).This also reworks the output for duplicate PRs, making it clear when
bump
skipped checking PRs (as printing "none" would suggest that PRs were checked) and only printing the "Maybe duplicate" information when checked. This makes it a little easier to understand whatbump
has done internally from the output.Lastly, this expands test coverage for
BumpVersionParser
, bringing line coverage to 100% and branch coverage to 95.45%. This is the best we can do for branch coverage, as Sorbet will catch an invalid argument type before the#parse_version
method is executed, so we can't exercise the method in a test to get 100% coverage.