Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 3.14 KB

CONTRIBUTING.md

File metadata and controls

43 lines (26 loc) · 3.14 KB

While we are in a period of private development, we need to overcome two challenges in order to install development versions with homebrew: homebrew tap visibility, and artifact visibility.

Using a private homebrew tap

First, we need a way to use a homebrew tap that is defined in a private repository. For this, we can provide an additional argumetn to the brew tap command telling it to use the ssh git url to clone. This should allow anyone in the engineering github org to access these formulas.

# This version of the tap command (with git url) is only for employees
brew tap pinecone-io/tap [email protected]:pinecone-io/homebrew-tap

After we launch, people should use the command shown in the README which does not include this second argument of the git url; when the argument is not specified, homebrew will make a https call to what it expects will be a public repository.

Even though I think this form of the command with the git url would work for most people even after we launch, it would fail for anyone who doesn't have an ssh key setup on github. Which is probably a small but non-zero number of our potential users.

Public download urls for private development

We don't need privacy in a strict security sense, but mostly only in a marketing sense. This is fortunate, since homebrew and github don't expose an easy to way to pass authentication in order to access protected resources.

The challenge comes because the formula that is automatically generated by the CLI goreleaser config will link to github release artifacts which are not downloadable by homebrew while the CLI repository is set to private.

To work around this limitation, we have added a section to the goreleaser configuration (blob) that also places built artifacts into a google cloud storage bucket (project: production-sdk, bucket: pinecone-cli) with public visiblity. These we can download using an alternate version of the foruma: pinecone-dev

brew install pinecone-io/tap/pinecone-dev

The non-dev pinecone.rb formula installable as brew install pinecone-io/tap/pinecone is what the public should use after release. But it won't work as long as the CLI repository is private due to the download links being inaccessible by homebrew.

Updating the pinecone-dev formula

The pinecone-dev.rb formula is updated by running the update-dev-formula.yaml workflow. This should be automatically triggered after every run of the publish workflow in the CLI repo, so in general it shouldn't need to be run manually.

Adding / changing / deleting formulas.

The brew update command is used for finding and installing updates for formulas you have previously used. This is meant for the end users of a formula.

If you've made significant changes to the brew tap structure (e.g. renaming or adding new formulas) you many need to untap and retap in order for homebrew to figure out new formulas exist. I'm not 100% clear on how this works, but I've gotten into some weird states before that seem to be cleaned up most easily by just removing something and starting fresh.

brew untap pinecone-io/tap
brew tap pinecone-io/tap [email protected]:pinecone-io/homebrew-tap