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

cask: remove os_versions #15240

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

apainintheneck
Copy link
Contributor

  • 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?

Fixes #15227.

Overview

This was originally used by the API but was replaced months ago by SimulateSystem. Essentially, it's only current use was in the Cask::Cask#to_h method but is not used internally at all when creating cask instances from the API JSON.

Details

It was added to brew in #11915 and added to the formulae.brew.sh website in Homebrew/formulae.brew.sh#539. The use in the formulae.brew.sh website was later removed in Homebrew/formulae.brew.sh@b5704d4 so the only remaining references are in the main brew repo.

The Cask::Cask#os_versions method was only called in Cask::Cask#to_h to create the versions field in the JSON representation. It is not referenced at all in Cask::CaskLoader so isn't needed when loading cask instances from the JSON.

An added bonus is that removing this will speed up JSON generation a lot. It was very slow before because it required reloading casks a bunch of times.

Before

Screen Shot 2023-04-16 at 1 56 55 PM

After

Screen Shot 2023-04-16 at 1 54 10 PM

I also updated some test fixtures to remove the versions field.

This was originally used by the API but was replaced months
ago by SimulateSystem. Essentially, it's only current use
was in the #to_h method but is not used internally at all
when creating cask instances from the API JSON.
@apainintheneck apainintheneck added the cask Homebrew Cask label Apr 16, 2023
@apainintheneck apainintheneck self-assigned this Apr 16, 2023
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.

Very nice, thanks again @apainintheneck!

@MikeMcQuaid MikeMcQuaid merged commit 0b3910d into Homebrew:master Apr 17, 2023
@apainintheneck apainintheneck deleted the remove-cask-os-versions branch May 14, 2023 19:40
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cask Homebrew Cask outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

brew info --eval-all --json=v2 no longer works
3 participants