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

Release ocb to a Homebrew tap. #5689

Closed
wants to merge 1 commit into from

Conversation

jpeach
Copy link
Contributor

@jpeach jpeach commented Jul 15, 2022

Description:

Update the goreleaser configuration so that ocb releases will
automatically update the OpenTelementry Homebrew tap.

Link to tracking Issue:

This fixes #5680.

Testing:

Tested with a private tap at https://github.com/jpeach/homebrew-tap.

$ brew info ocb
jpeach/tap/ocb: stable 1.2
This program generates a custom OpenTelemetry Collector from a given configuration.
https://opentelemetry.io/docs/collector/custom-collector/
/opt/homebrew/Cellar/ocb/1.2 (3 files, 6.4MB) *
  Built from source on 2022-07-15 at 15:40:03
From: https://github.com/jpeach/homebrew-tap/blob/HEAD/Formula/ocb.rb
License: Apache-2.0
==> Dependencies
Optional: go ✘
==> Options
--with-go
	Build with go support
$ brew install ocb
==> Downloading https://github.com/jpeach/homebrew-tap/releases/download/v1.2/ocb_1.2_darwin_arm64
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/514126043/14de5f50-8d99-4003-ac7e-522bf5510e37?X-Amz
######################################################################## 100.0%
==> Installing ocb from jpeach/tap
🍺  /opt/homebrew/Cellar/ocb/1.2: 3 files, 6.4MB, built in 1 second
==> Running `brew cleanup ocb`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
$ which ocb
/opt/homebrew/bin/ocb
$ ocb version
builder version 1.2

Documentation:

None. If we land this, I can go update the docs in a separate PR.

Update the goreleaser configuration so that ocb releases will
automatically update the OpenTelementry Homebrew tap.

This fixes open-telemetry#5680.

Signed-off-by: James Peach <[email protected]>
@jpeach jpeach requested review from a team and tigrannajaryan July 15, 2022 05:53
@jpeach
Copy link
Contributor Author

jpeach commented Jul 15, 2022

@tigrannajaryan With this PR, all we need for infra is a new open-telemetry/homebrew-tap repo. You can use brew tap-new to populate the bare repository, but in my experiment it wasn't necessary.

This should work without any other changes to the release process as long as the goreleaser github token has repo access to the homebrew-tap repository.

@tigrannajaryan
Copy link
Member

@open-telemetry/collector-approvers @open-telemetry/collector-contrib-approvers this needs a discussion before moving forward.

@mx-psi
Copy link
Member

mx-psi commented Jul 15, 2022

@jpeach How difficult would it be to add this to homebrew-core instead? There's already an OpenTelemetry-related package (https://formulae.brew.sh/formula/opentelemetry-cpp), so it may be possible to have the builder there too?

@jpeach
Copy link
Contributor Author

jpeach commented Jul 15, 2022

@jpeach How difficult would it be to add this to homebrew-core instead? There's already an OpenTelemetry-related package (https://formulae.brew.sh/formula/opentelemetry-cpp), so it may be possible to have the builder there too?

@flier What do you think? Since core already accepted opentelemetry-cpp, I expect that ocb would be OK. I doubt that core would issue a Github token to make changes directly to the Homebrew repo, so we would need to make a PR on each release. Is there any tooling for that, or is it generally a manual change?

@flier
Copy link

flier commented Jul 18, 2022

I think it depends on your expected release schedule, in my experience homebrew-core takes about 1-2 weeks to receive a new formula Homebrew/homebrew-core#101407, or faster to 1-2 days if it's just a version update Homebrew/homebrew-core#104155.

So, if your release cycle is longer than one week, homebrew-core will be fine.

For the release PR, if you want to fully automate it, you can add action directly to the github workflow.

@codecov
Copy link

codecov bot commented Jul 18, 2022

Codecov Report

Merging #5689 (b6dbf7e) into main (a831d51) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #5689      +/-   ##
==========================================
+ Coverage   91.40%   91.44%   +0.03%     
==========================================
  Files         192      192              
  Lines       11416    11416              
==========================================
+ Hits        10435    10439       +4     
+ Misses        781      778       -3     
+ Partials      200      199       -1     
Impacted Files Coverage Δ
pdata/internal/common.go 92.59% <0.00%> (+0.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a831d51...b6dbf7e. Read the comment docs.

@mx-psi
Copy link
Member

mx-psi commented Jul 18, 2022

So, if your release cycle is longer than one week, homebrew-core will be fine.

Our release cycle is two weeks long, so that should be fine.

For the release PR, if you want to fully automate it, you can add action directly to the github workflow.

I would be okay with that (but I am not a maintainer on this repo, so I will let them speak :))

@jpkrohling
Copy link
Member

For the release PR, if you want to fully automate it, you can add action directly to the github workflow.

Isn't that taken care of by goreleaser?

@jpeach
Copy link
Contributor Author

jpeach commented Jul 19, 2022

For the release PR, if you want to fully automate it, you can add action directly to the github workflow.

Isn't that taken care of by goreleaser?

I don't think so. Goreleaser updates the tap directly with a formula that installs the pre-built release binaries (example). It doesn't make a PR with an update, it just pushes the new formula.

So for Homebrew core, I expect we would want a standard Go tool formula that builds the release tag from scratch (pre-built binaries are distributed as bottles, typically not just installed in the formula). To get an automatic update, the PR action would probably need to update the version tag on the formula. Looking at the docs for the Github action that flier mentioned, that looks fairly doable. Maybe in special cases if the build changes radically you would need a manual PR to do the update.

So, overall, it seems doable, though a bit hard to test.

@jpeach
Copy link
Contributor Author

jpeach commented Jul 21, 2022

Closing, since it looks like the consensus is to try to do this in core Homebrew.

@jpeach jpeach closed this Jul 21, 2022
@jpeach jpeach deleted the homebrew-release-ocb branch July 21, 2022 08:53
@hannahchan
Copy link

Has this made it into Homebrew core yet? I can't seem to find any references to Homebrew and ocb outside of these PRs. Is there a link somewhere we can follow?

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.

Add a homebrew tap release for ocb
6 participants