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

[WIP] bump: bump synced formula together #19213

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bevanjkay
Copy link
Member

@bevanjkay bevanjkay commented Feb 3, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

TODO:

  • Add tests
  • Update brew bump-cask-pr

@bevanjkay bevanjkay force-pushed the bump-synced-versions branch 3 times, most recently from d589d3a to 2a31737 Compare February 3, 2025 18:19
Copy link
Member

@nandahkrishna nandahkrishna left a comment

Choose a reason for hiding this comment

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

Thanks @bevanjkay, I think the overall logic looks good here – it's just that the diff is a bit scary because everything's been moved into a loop over the list of formulae to bump together (and pr_info contains multiple commits, and only after all these commits are created should the audit checks be run).

Once you get the time to add tests I'd be happy to review this in more detail and even test it out.

Comment on lines +84 to +85
comma_array "--synced-with=",
description: "Also bump formula synced with <formula> in the same PR."
Copy link
Member

Choose a reason for hiding this comment

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

I think we should just have a flag like --bump-synced, which bumps synced formulae based on the list/JSON file in homebrew-core, rather than having to pass the list of synced formulae here.

@@ -498,7 +498,7 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a
return
end

return if duplicate_pull_requests.present?
# return if duplicate_pull_requests.present?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# return if duplicate_pull_requests.present?
return if duplicate_pull_requests.present?

I think we discussed this at the end of the AGM, but this is just a reminder 😆.


pr_message = args.message

# run_audit(formula, alias_rename, old_contents)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# run_audit(formula, alias_rename, old_contents)
run_audit(formula, alias_rename, old_contents)

Again, just a reminder – and for context to others looking at this PR, these lines have been commented out just to make testing easy.

shallow = !git_dir.empty? && File.exist?("#{git_dir}/shallow")
changed_files = [sourcefile_path]
changed_files += additional_files if additional_files.present?
# safe_system "git", "fetch", "--unshallow", "origin" if shallow
Copy link
Member

Choose a reason for hiding this comment

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

Potentially another reminder to uncomment.

@bevanjkay
Copy link
Member Author

I think that ideally I will extract the loop logic into a separate function to make it a bit clearer.
This one has been difficult to test because it's not often that an opportunity arises to bump synced formula - but when I have some time I will try to replicate this in a test tap.

I have ran some singular bumps with this branch checked out, and there is currently an issue where the PR title is incorrect.

Looking to get back to this PR in the next week or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants