Skip to content
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

Merged
merged 6 commits into from
Jan 4, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion Library/Homebrew/dev-cmd/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
issyl0 marked this conversation as resolved.
Show resolved Hide resolved
EOS
switch "--full-name",
description: "Print formulae and casks with fully-qualified names."
Expand Down Expand Up @@ -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)

Check warning on line 96 in Library/Homebrew/dev-cmd/livecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/livecheck.rb#L96

Added line #L96 was not covered by tests
issyl0 marked this conversation as resolved.
Show resolved Hide resolved

formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask|

Check warning on line 98 in Library/Homebrew/dev-cmd/livecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/livecheck.rb#L98

Added line #L98 was not covered by tests
name = formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
if (autobump_core + autobump_cask).include?(name)
issyl0 marked this conversation as resolved.
Show resolved Hide resolved
odebug "Skipping #{name} as it is autobumped."
true

Check warning on line 102 in Library/Homebrew/dev-cmd/livecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/livecheck.rb#L102

Added line #L102 was not covered by tests
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
Expand Down Expand Up @@ -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))
issyl0 marked this conversation as resolved.
Show resolved Hide resolved
end

sig { returns(Pathname) }
def autobump_cask_path
@autobump_cask_path ||= T.let(Tap.fetch("homebrew/cask").path/".github/autobump.txt", T.nilable(Pathname))

Check warning on line 142 in Library/Homebrew/dev-cmd/livecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/livecheck.rb#L142

Added line #L142 was not covered by tests
end
end
end
end
Loading