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
Livecheck: Skip archived stable URLs in formulae #10208
Livecheck: Skip archived stable URLs in formulae #10208
Conversation
Review period will end on 2021-01-05 at 00:00:00 UTC. |
Review period ended. |
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.
Looks good but might be worth splitting into separate function/functions in livecheck.rb
The If so, could you explain a bit more about what form you would prefer this to take (e.g., a separate method only for the "skipped" part of |
Yes, I think probably.
This, ideally, unless you see no chance this list will ever be added to. |
The latest commit incorporates the following changes:
@MikeMcQuaid I may take another pass at this later but I don't think there will be substantial changes (if any). Feel free to review whenever you have time. |
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.
Nice work so far! Made a bunch of comments that apply elsewhere, have avoided repeating myself too much but assume I mean the same thing everywhere with e.g. nilable
and unless
skip_result = skip_conditions(formula_or_cask, json: json, full_name: full_name, quiet: quiet) | ||
next skip_result if skip_result != false | ||
skip_info = SkipConditions.skip_information(formula_or_cask, full_name: full_name, verbose: verbose) | ||
if skip_info.is_a?(Hash) |
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.
This type checking feels non-idiomatic , particularly considering it's a no-op if the type doesn't match.
skip_message = if formula_or_cask.livecheck.skip_msg.is_a?(String) && | ||
formula_or_cask.livecheck.skip_msg.present? |
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.
This type check also feels like a smell given it's a no-op when it's not matched
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
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 again @samford!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?This PR modifies livecheck to automatically skip formulae that have a
stable
URL from the Google Code Archive or Internet Archive, as these won't receive updates. I checked the PR history for related formulae and didn't see any that were updated while they were in this state, so I think it's safe to skip these formulae by default.I initially considered restricting these automatic skips to formulae with a related
stable
archive URL but nohead
URL, as it may be possible to check for a new version in an upstream repository. However, I looked through formulae with this criteria and the upstream repositories weren't useful (i.e., they simply contained older versions than what Google Code Archive provides).That said, it's possible to override these automatic skips with a
livecheck
block (if there's another source to check), so this should be fine. However, if there was another source to check, we should just update thestable
URL to use that instead (so these skips wouldn't apply in that case).Some time ago, I created a related PR to remove Google Code Archive
livecheck
blocks from formulae: Homebrew/homebrew-core#64606I'm planning to create a follow-up PR in homebrew-core to remove the
livecheck
blocks that skip some of these formulae, as they'll no longer be necessary.