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

dev-cmd/generate-cask-api: start generating cask internal JSON v3 #16798

Merged
merged 2 commits into from Mar 8, 2024

Conversation

apainintheneck
Copy link
Contributor

@apainintheneck apainintheneck commented Mar 2, 2024

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

Part of #16410

This adds a new file to the output of brew generate-cask-api which represents the new internal JSON v3 file. It involves removing a bunch of unneeded hash keys while removing blank ones as well.

I've made some slight changes to the cask loader as well but more might be necessary before this starts loading things correctly. The full loader code will be added in a separate PR.

Changes

Skippable hash fields

  • appcast
    • This is disabled right now and no longer used in the core cask tap.
  • deprecated
    • Not used
  • disabled
    • Not used
  • full_token
    • Not used
  • tap
    • Will be included in tap api hash
  • tap_git_head
    • Will be included in tap api hash
  • ruby_source_checksum
    • Replaced by ruby_source_sha256 to match formula API hash

Nilable hash fields

  • languages
  • container
  • deprecation_date
  • deprecation_reason
  • disable_date
  • disable_reason
  • caveats
  • depends_on
  • conflicts_with
  • url_specs

New hash fields

  • caskfile_only
    • allows us to reduce the size of the artifacts array
  • ruby_source_sha256
    • to match formula API hash

Updated cask loader

  • to handle new ruby_source_sha256 field

Post Merge

@apainintheneck apainintheneck added cask Homebrew Cask install from api Relates to API installs labels Mar 2, 2024
@apainintheneck
Copy link
Contributor Author

Before:

-rw-r--r--  1 kevinrobell  staff   6.5M Mar  2 15:29 cask.jws.json

After:

-rw-r--r--  1 kevinrobell  wheel   4.2M Mar  2 17:38 homebrew-cask.json

@apainintheneck apainintheneck force-pushed the build-cask-internal-json-v3 branch 4 times, most recently from c8e9bac to df2397c Compare March 3, 2024 19:43
@apainintheneck apainintheneck marked this pull request as ready for review March 3, 2024 20:33
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.

Looks good! A few non-blocking thoughts/comments.

Library/Homebrew/cask/cask.rb Show resolved Hide resolved
Library/Homebrew/cask/cask.rb Outdated Show resolved Hide resolved
Library/Homebrew/tap.rb Outdated Show resolved Hide resolved
@apainintheneck apainintheneck force-pushed the build-cask-internal-json-v3 branch 2 times, most recently from c6c5fcd to b5c9651 Compare March 6, 2024 05:05
@apainintheneck
Copy link
Contributor Author

I'll merge this in tomorrow after I finish testing some things to make doubly sure that I'm not breaking current API JSON generation.

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.

Looking good, thanks for making those changes ❤️

This adds a new file to the output of `brew generate-cask-api` which
represents the new internal JSON v3 file. It involves removing
a bunch of unneeded hash keys while removing blank ones as well.

I've made some slight changes to the cask loader as well but more
might be necessary before this starts loading things correctly.
The full loader code will be added in a separate PR.
@apainintheneck
Copy link
Contributor Author

apainintheneck commented Mar 8, 2024

Waiting on discussion in #16826 (comment)

Edit: It seems like that field isn't necessary.

@apainintheneck apainintheneck merged commit e22ace5 into master Mar 8, 2024
26 checks passed
@apainintheneck apainintheneck deleted the build-cask-internal-json-v3 branch March 8, 2024 07:12
apainintheneck added a commit to apainintheneck/formulae.brew.sh that referenced this pull request Mar 8, 2024
This is now getting generated by the main brew repo after my PR
got merged in and this PR is a follow-up to make sure to sign it.

The next step after this will be to build out the loader code.

- Homebrew/brew#16798
@apainintheneck apainintheneck mentioned this pull request Mar 15, 2024
7 tasks
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cask Homebrew Cask install from api Relates to API installs outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants