-
-
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
dev-cmd/livecheck: Skip autobumped formulae #18984
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ | |||||||||
Check for newer versions of formulae and/or casks from upstream. | ||||||||||
If no formula or cask argument is passed, the list of formulae and | ||||||||||
casks to check is taken from `HOMEBREW_LIVECHECK_WATCHLIST` or | ||||||||||
`~/.homebrew/livecheck_watchlist.txt`. | ||||||||||
`~/.homebrew/livecheck_watchlist.txt`, excluding autobumped formulae. | ||||||||||
EOS | ||||||||||
switch "--full-name", | ||||||||||
description: "Print formulae and casks with fully-qualified names." | ||||||||||
|
@@ -90,6 +90,20 @@ | |||||||||
end | ||||||||||
end | ||||||||||
|
||||||||||
# Skip packages that are autobumped by BrewTestBot, if there are any. | ||||||||||
if autobump_core_path.exist? && autobump_cask_path.exist? | ||||||||||
autobump_core = File.read(autobump_core_path).lines.map(&:strip) | ||||||||||
autobump_cask = File.read(autobump_cask_path).lines.map(&:strip) | ||||||||||
Comment on lines
+95
to
+96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or |
||||||||||
|
||||||||||
formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask| | ||||||||||
name = formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name | ||||||||||
if (autobump_core + autobump_cask).include?(name) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this logic will work as intended if a formula and cask both share the same name and the formula/cask is only in one of the autobump lists. For example, if the cask is in its autobump list but the formula isn't, the formula would still be skipped like the cask. Instead, we should only be checking the autobump file from the I could be wrong but it may be technically possible for a tap other than core/cask to have an The basic idea is to identify the taps that are in use for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, thanks for reminding me of packages with the same name in both core and cask! |
||||||||||
odebug "Skipping #{name} as it is autobumped." | ||||||||||
true | ||||||||||
end | ||||||||||
end | ||||||||||
end | ||||||||||
|
||||||||||
formulae_and_casks_to_check = formulae_and_casks_to_check.sort_by do |formula_or_cask| | ||||||||||
formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name | ||||||||||
end | ||||||||||
|
@@ -117,6 +131,16 @@ | |||||||||
def watchlist_path | ||||||||||
@watchlist_path ||= T.let(File.expand_path(Homebrew::EnvConfig.livecheck_watchlist), T.nilable(String)) | ||||||||||
end | ||||||||||
|
||||||||||
sig { returns(Pathname) } | ||||||||||
def autobump_core_path | ||||||||||
@autobump_core_path ||= T.let(Tap.fetch("homebrew/core").path/".github/autobump.txt", T.nilable(Pathname)) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
maybe? |
||||||||||
end | ||||||||||
|
||||||||||
sig { returns(Pathname) } | ||||||||||
def autobump_cask_path | ||||||||||
@autobump_cask_path ||= T.let(Tap.fetch("homebrew/cask").path/".github/autobump.txt", T.nilable(Pathname)) | ||||||||||
end | ||||||||||
end | ||||||||||
end | ||||||||||
end |
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.
If we add a way to disable this filtering behavior, this statement may not always be true. It may be better to simply leave out this added language (i.e., overarching assumptions about what livecheck will/won't check apply here).
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.