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

Enable typing in Homebrew::Upgrade #14628

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Feb 14, 2023

  • 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 enabled typing in the Homebrew::Upgrade module

@BrewTestBot
Copy link
Member

Review period will end on 2023-02-15 at 19:10:57 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 14, 2023
@@ -209,7 +209,7 @@ def install_formula(formula_installer, upgrade:)
ensure
# restore previous installation state if build failed
begin
linked_kegs.each(&:link) if linked_kegs.present? && !f.latest_version_installed?
Copy link
Member Author

Choose a reason for hiding this comment

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

The f here always results in a NameError here, afaitct. I believe this was a bug that was introduced in the beginning: https://github.com/Homebrew/brew/pull/12024/files#diff-338a6a0ff7eb3b254fa3b6ca7d9225e7e283521c05acbdcda7f4eb8dc996bc05R206

(You should be able to replicate this by removing the rescue and running test/cmd/install_spec.)

However: 1) it wasn't covered by tests (it seems linked_kegs is always present?), 2) it's wrapped in a bare rescue (which I would discourage, but I don't have sufficient context here to know how to better target it), and 3) the file was untyped.

formula is my best guess as to the original intent, and I've rearranged things a bit so that it's covered in tests.

cc @FnControlOption @MikeMcQuaid

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 again @dduugg!

@MikeMcQuaid MikeMcQuaid added the critical Critical change which should be shipped as soon as possible. label Feb 15, 2023
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 15, 2023
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@MikeMcQuaid MikeMcQuaid merged commit 933cf0b into Homebrew:master Feb 15, 2023
@github-actions github-actions bot added the outdated PR was locked due to age label Mar 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants