Skip to content

Refactor FormulaCreator args and call parse_url automatically #20116

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

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

abitrolly
Copy link
Contributor

@abitrolly abitrolly commented Jun 15, 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?

This PR makes all FormulaCreator params, except URL optional, to make test calls less verbose.

Calls parse_url in constructor to ensure that supplied URL is automatically parsed (as discussed in https://github.com/Homebrew/brew/pull/20025/files#r2123010882).

The change includes fix from #20115 that restores tests run on Linux.

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.

Thanks for splitting this out. A few nits but looks good so far.

@abitrolly abitrolly force-pushed the create-tests branch 3 times, most recently from b4539e5 to 4c8a0df Compare June 16, 2025 18:07
@abitrolly
Copy link
Contributor Author

abitrolly commented Jun 17, 2025

@MikeMcQuaid addressed all comments. What to do with brew typecheck failure? Should I revert types?

EDIT: Nevermind. This is ready for review.

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@MikeMcQuaid
Copy link
Member

@abitrolly Please stop pushing to this PR. I'm going to fix it.

@MikeMcQuaid
Copy link
Member

@abitrolly Please test the latest version here. I've completed the typechecking and refactoring.

Copy link
Contributor Author

@abitrolly abitrolly left a comment

Choose a reason for hiding this comment

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

Now I see what you mean by combining parsing logic into constructor. The assignment of instance variables became more clear. Looks good.

I kind of disagree with the way test data is processed, but that's not a blocker. Just a personal preference from Go/Python side.

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.

@abitrolly Can you clarify whether you tested this or not? Please can we move this to a conclusion? For refactoring with no functionality change this PR has wasted a lot of time and I am losing my patience with the amount of back and forth required here.

Co-authored-by: Anatoli Babenia <anatoli@rainforce.org>
@abitrolly
Copy link
Contributor Author

@MikeMcQuaid I've tested it with brew tests and manually run with and without new name. Works as expected.

brew create https://github.com/buildpacks/pack/archive/refs/tags/v0.37.0.tar.gz -d

@abitrolly
Copy link
Contributor Author

The conclusion is that it is ready long ago. )

@MikeMcQuaid MikeMcQuaid self-requested a review June 17, 2025 14:18
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 17, 2025
@MikeMcQuaid
Copy link
Member

Thanks @abitrolly.

Merged via the queue into Homebrew:master with commit 3c30845 Jun 17, 2025
33 checks passed
@abitrolly abitrolly deleted the create-tests branch June 17, 2025 14:46
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