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

WIP: create lightweight internal JSON API #19241

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Feb 5, 2025

This PR starts to create a new internal API per #19204. These files are sharded by OS/arch, and contain the tap's formula renames, tap migrations, etc. The only information it contains about each individual formula is the name, pkg_version, and bottle hash.

Known to-dos (just for my own notes, some of these will probably end up being in separate PRs):

  • Include the bottle rebuild in the formula information (needed to download the correct bottle manifest)
  • Actually write the necessary data to the manifest
  • Figure out where in the formula load process to download the manifest
  • Cleanup existing API v3 code, as it's mostly being replaced by this new strategy

This PR is a work-in-progress, I'm just uploading it so other people can mess around with the code I started to write at the AGM. Anyone, please feel free to push commits or supercede this PR!

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 so far, nice work!

hash = {
"name" => name,
"pkg_version" => pkg_version.to_s,
"sha256" => bottle_hash["files"][bottle_tag.to_sym]&.fetch("sha256"),
Copy link
Member

Choose a reason for hiding this comment

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

Could slim things even more and consider not setting this key at all unless we have a non-nil sha256 (pulling this into an if below)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, makes sense! I figured I might do some testing to see if doing an array instead of a hash is significantly better, too. I wasn't sure whether, once gzipped, that would make a huge difference or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants