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

API: Load casks/formula from JSON with missing keys #16420

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?

Related to the discussion in #16410 and the first bullet point in #16410 (comment).

We'd like to reduce the size of the API JSON and to do that we are going to remove unused and/or blank elements from the cask/formula definition. This will reduce the amount of data that has to go over the wire and make it easier to load this data into memory.

Beyond the code I've changed here, there are a few other spots that I've decided not to update to handle null values because they should always be present anyway and if they're missing, we'll have bigger problems to deal with.

bottles_stable["files"].each do |tag, bottle_spec|

json_cask[:artifacts].each do |artifact|

We'd like to reduce the size of the API JSON and to do that we are
going to remove unused and/or blank elements from the cask/formula
definition. This will reduce the amount of data that has to go
over the wire and make it easier to load this data into memory.
@apainintheneck apainintheneck marked this pull request as ready for review January 2, 2024 04:40
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, great work as usual @apainintheneck!

@MikeMcQuaid MikeMcQuaid merged commit 3e027de into master Jan 2, 2024
24 checks passed
@MikeMcQuaid MikeMcQuaid deleted the allow-cask-formula-loading-from-api-hash-missing-more-keys branch January 2, 2024 17:14
@github-actions github-actions bot added the outdated PR was locked due to age label Feb 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 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

2 participants