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/bump: skip Repology checks in CI for livecheckables #16887

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
end
end

sig { params(formula_or_cask: T.any(Formula, Cask::Cask), args: CLI::Args).returns(T::Boolean) }
def skip_repology?(formula_or_cask, args:)
(ENV["CI"].present? && args.open_pr? && formula_or_cask.livecheckable?) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really call brew bump on CI to do anything other than open PRs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(formula_or_cask.is_a?(Formula) && formula_or_cask.versioned_formula?)

Check warning on line 118 in Library/Homebrew/dev-cmd/bump.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump.rb#L117-L118

Added lines #L117 - L118 were not covered by tests
end

sig { params(formulae_and_casks: T::Array[T.any(Formula, Cask::Cask)], args: CLI::Args).void }
def handle_formula_and_casks(formulae_and_casks, args)
Livecheck.load_other_tap_strategies(formulae_and_casks)
Expand Down Expand Up @@ -147,11 +153,7 @@
Repology::HOMEBREW_CASK
end

package_data = if formula_or_cask.is_a?(Formula) && formula_or_cask.versioned_formula?
nil
else
Repology.single_package_query(name, repository:)
end
package_data = Repology.single_package_query(name, repository:) unless skip_repology?(formula_or_cask, args:)

retrieve_and_display_info_and_open_pr(
formula_or_cask,
Expand Down Expand Up @@ -481,6 +483,8 @@
puts <<~EOS
Current #{version_label} #{current_versions}
Latest livecheck version: #{new_versions}
EOS
puts <<~EOS unless skip_repology?(formula_or_cask, args:)
Latest Repology version: #{repology_latest}
EOS
if formula_or_cask.is_a?(Formula) && formula_or_cask.synced_with_other_formulae?
Expand Down