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

Next gen api formula json v3 #16541

Merged

Commits on Feb 4, 2024

  1. formula: add #to_api_hash

    This will be used internally to generate a slimmer api hash representation
    of formulas that will require less space and be faster to load.
    
    Changes:
    - Added #to_api_hash
    - Modified #to_hash_with_variations to work with both #to_hash and #to_api_hash
    - Modified #bottle_hash to have compact representation for the api hash
    - Added #urls_hash to share url hash generation logic between the hash methods
    apainintheneck authored and p-linnane committed Feb 4, 2024
    Configuration menu
    Copy the full SHA
    c1d85bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d2dd80b View commit details
    Browse the repository at this point in the history
  3. formula: share dependencies serialization logic

    Note: This changes where the "head_dependencies" key in the hash
    shows up but not the hash's contents.
    
    "head_dependencies" now shows up directly after all of the other
    dependency keys. Before it was always at the end of the hash after
    variations.
    apainintheneck authored and p-linnane committed Feb 4, 2024
    Configuration menu
    Copy the full SHA
    6960973 View commit details
    Browse the repository at this point in the history
  4. dev-cmd/generate-formula-api: generate homebrew-core.json

    This adds the code to generate the homebrew-core.json file which
    represents the entire tap instead of just the previous array of
    formula hashes. Any shared logic has been moved into the top-level
    hash scope including aliases, renames, tap_git_head and tap_migrations.
    
    I also added a check to skip adding the variations hash to the api
    hash if it is empty.
    
    Now we're down to 10MB from 24MB!!!
    apainintheneck authored and p-linnane committed Feb 4, 2024
    Configuration menu
    Copy the full SHA
    ba3a0f8 View commit details
    Browse the repository at this point in the history
  5. Address review feedback

    - move caveats serialization to a method
    - remove unnecessary nesting where the hash would only have one key
    
    Also, removed comment about checking disable and deprecation reasons.
    apainintheneck authored and p-linnane committed Feb 4, 2024
    Configuration menu
    Copy the full SHA
    d9a98ac View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3c503cd View commit details
    Browse the repository at this point in the history
  7. formula: change how #to_hash is defined for backwards compatibility

    Now the output of commands like `brew info --json=` and
    `brew generate-formula-api` should be the same as before along with
    the additional files for the internal API. Before this commit the
    hash key order had changed.
    apainintheneck authored and p-linnane committed Feb 4, 2024
    Configuration menu
    Copy the full SHA
    54b54b7 View commit details
    Browse the repository at this point in the history