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

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Mar 14, 2024

When we have a livecheck in a formula, Repology is purely informational - it is never used to perform the actual bump. In a CI autobump environment, this is wasted network requests and adds a couple seconds to each bump so let's skip it.

Library/Homebrew/dev-cmd/bump.rb Outdated Show resolved Hide resolved
@@ -112,6 +112,12 @@ def bump
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.

@apainintheneck
Copy link
Contributor

I'm curious as to how much faster this will make things.

@Bo98
Copy link
Member Author

Bo98 commented Mar 14, 2024

I could definitely (unscientifically) feel the change locally. The current autobump is quite slow at one hour: https://github.com/Homebrew/homebrew-core/actions/workflows/autobump.yml, so we'll see what it's like after merging this.

#16886 also removes a slow open PR check that will save a couple seconds per formula too.

Not going to suddenly make it 10 minutes but if the two together make it say 50-55 minutes I consider that successful.

And if not, it'll at least mean we're no longer sending thousands of network requests to Repology servers on a regular basis.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense! I wonder if it's worth scoping exclusively to our CI but can always adjust if others complain.

@Bo98 Bo98 merged commit 8102e23 into master Mar 16, 2024
26 checks passed
@Bo98 Bo98 deleted the bump-no-repology branch March 16, 2024 03:13
@Bo98
Copy link
Member Author

Bo98 commented Mar 16, 2024

https://github.com/Homebrew/homebrew-core/actions/runs/8304989363/job/22731571713

2x faster (~1hr -> ~30 mins)

@MikeMcQuaid
Copy link
Member

Amazing work again @Bo98!

@github-actions github-actions bot added the outdated PR was locked due to age label Apr 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants