Skip to content

fix(brew): generate canonical Formula/ocm.rb alongside versioned pin#1997

Merged
fabianburth merged 3 commits into
open-component-model:mainfrom
fabianburth:fix/canonical-brew-formula
Jun 10, 2026
Merged

fix(brew): generate canonical Formula/ocm.rb alongside versioned pin#1997
fabianburth merged 3 commits into
open-component-model:mainfrom
fabianburth:fix/canonical-brew-formula

Conversation

@fabianburth

@fabianburth fabianburth commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Users who install via brew install open-component-model/tap/ocm accumulate a new keg per release (ocm@0.40.0, ocm@0.41.0, …) instead of upgrading in place. Root cause is in this repo's release pipeline.

The publish workflow only ever generated Formula/ocm@<version>.rb and pointed Aliases/ocm at the latest one. Brew aliases shadow same-named formula files and resolve to the target, so brew install …/ocm installed a versioned formula. Homebrew treats versioned formulas as separate packages and installs them side-by-side, hence the pile-up.

Generate both files on every release:

  • Formula/ocm.rb (class Ocm) — canonical, overwritten each release; brew install ocm upgrades in place.
  • Formula/ocm@<version>.rb (class OcmAT<digits>) — opt-in pin; users who want a specific version run brew install ocm@X.Y.Z.

Drop the Aliases/ocm symlink creation in the workflow and remove any stale symlink left over from earlier runs.

Companion cleanup in the tap (bumps Formula/ocm.rb to v0.43.0 manually so users aren't stuck on v0.18.0 until the next release, and removes the existing Aliases/ocm): open-component-model/homebrew-tap#47

Test plan

  • go test ./... in hack/brew passes
  • Generator output for v0.43.0 byte-identical to the existing tap files (both Formula/ocm.rb and Formula/ocm@0.43.0.rb)
  • Locally tapped a synthetic tap with both generated files: brew info …/ocm resolves to canonical formula 0.43.0; brew info …/ocm@0.43.0 still resolves to the versioned formula
  • Reviewer sanity-checks the workflow diff

The release pipeline previously only generated Formula/ocm@<version>.rb
and pointed Aliases/ocm at the latest versioned file. Because brew aliases
shadow same-named formula files and resolve to the target, brew install
of the canonical name installed a versioned formula. Homebrew treats
versioned formulas as separate packages, so each release accumulated a
new keg side-by-side instead of upgrading in place.

Generate both files on every release:

  - Formula/ocm.rb (class Ocm) — canonical, overwritten each release;
    `brew install ocm` upgrades in place.
  - Formula/ocm@<version>.rb (class OcmAT<digits>) — opt-in pin; users
    who want a specific version run `brew install ocm@X.Y.Z`.

Drop the Aliases/ocm symlink creation in the workflow and remove any
stale symlink left over from earlier runs, so brew install resolves to
the canonical formula instead of the alias.

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
The Aliases/ocm symlink is removed in the tap repo, so the workflow
doesn't need to clean it up on every release. Drop both the rm step
and the Aliases/* add-paths entry.

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
@github-actions github-actions Bot added the size/m Medium label Jun 9, 2026
fabianburth added a commit to open-component-model/open-component-model that referenced this pull request Jun 10, 2026
## Summary

Add a callout to the legacy install docs explaining the one-time
migration step for users who installed the OCM CLI via Homebrew before
the tap was fixed.

Background: earlier tap releases installed the CLI as a version-pinned
formula (e.g. \`ocm@0.43.0\`), so brew treated each release as a
separate package and accumulated side-by-side kegs instead of upgrading
in place. The tap is now fixed to use the canonical \`Formula/ocm.rb\`
(open-component-model/homebrew-tap#47, with the
release pipeline change in
open-component-model/ocm#1997), but existing
users stay stuck on their pinned version until they manually uninstall
it and reinstall the canonical formula.

## Test plan

- [x] Render the legacy install docs and verify the callout displays
correctly.
- [x] Reviewer sanity-checks the wording.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
fabianburth added a commit to open-component-model/homebrew-tap that referenced this pull request Jun 10, 2026
## Summary

`brew install` of this tap currently installs each release as a
side-by-side keg instead of upgrading in place, so users pile up
`ocm@0.18.0`, `ocm@0.40.0`, …, `ocm@0.43.0` over time.

Two issues, two commits:

- **`Formula/ocm.rb` was stale at v0.18.0.** The release pipeline only
ever updated the versioned `ocm@<version>.rb` files. Bump it to v0.43.0
to match the latest release.
- **`Aliases/ocm` shadowed `Formula/ocm.rb` and pointed at the latest
versioned formula.** Brew aliases take precedence over same-named
formula files, so `brew install …/ocm` resolved to `ocm@0.43.0` (a
versioned formula). Homebrew treats versioned formulas as separate
packages, hence the pile-up. Remove the alias so the canonical
`Formula/ocm.rb` is what resolves.

The companion change in `open-component-model/ocm` updates the release
pipeline to keep `Formula/ocm.rb` in sync going forward and stop
creating the alias:
open-component-model/ocm#1997

## Migration

Existing users on the alias path stay on `ocm@0.43.0` because brew sees
that formula still exists in the tap and there's no `ocm` keg to
upgrade. One-time migration:

```sh
brew uninstall ocm@0.43.0
brew install open-component-model/tap/ocm
```

**WE NEED TO FLAG THIS IN THE RELEASE NOTES AND ON THE WEBSITE!**
**Also, this is a pre-requisite for the updated release flow to work. So
it needs to be merged before the next ocm release.**

## Test plan

- [x] Locally tapped this branch via symlink. `brew info …/ocm` resolves
to canonical `name: "ocm"`, `aliases: []`, stable 0.43.0.
- [x] `brew info …/ocm@0.43.0` still resolves to the versioned formula
(opt-in pin still works).
- [x] Reviewer sanity-checks the diff.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
@fabianburth fabianburth merged commit 6f08a66 into open-component-model:main Jun 10, 2026
24 checks passed
@fabianburth fabianburth deleted the fix/canonical-brew-formula branch June 10, 2026 09:09
ocmbot Bot pushed a commit to open-component-model/open-component-model that referenced this pull request Jun 10, 2026
## Summary

Add a callout to the legacy install docs explaining the one-time
migration step for users who installed the OCM CLI via Homebrew before
the tap was fixed.

Background: earlier tap releases installed the CLI as a version-pinned
formula (e.g. \`ocm@0.43.0\`), so brew treated each release as a
separate package and accumulated side-by-side kegs instead of upgrading
in place. The tap is now fixed to use the canonical \`Formula/ocm.rb\`
(open-component-model/homebrew-tap#47, with the
release pipeline change in
open-component-model/ocm#1997), but existing
users stay stuck on their pinned version until they manually uninstall
it and reinstall the canonical formula.

## Test plan

- [x] Render the legacy install docs and verify the callout displays
correctly.
- [x] Reviewer sanity-checks the wording.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com> 18bfd88
matthiasbruns pushed a commit to knp-sap/ocm that referenced this pull request Jun 15, 2026
…pen-component-model#1997)

## Summary

Users who install via `brew install open-component-model/tap/ocm`
accumulate a new keg per release (`ocm@0.40.0`, `ocm@0.41.0`, …) instead
of upgrading in place. Root cause is in this repo's release pipeline.

The publish workflow only ever generated `Formula/ocm@<version>.rb` and
pointed `Aliases/ocm` at the latest one. Brew aliases shadow same-named
formula files and resolve to the target, so `brew install …/ocm`
installed a versioned formula. Homebrew treats versioned formulas as
separate packages and installs them side-by-side, hence the pile-up.

Generate **both** files on every release:

- `Formula/ocm.rb` (class `Ocm`) — canonical, overwritten each release;
`brew install ocm` upgrades in place.
- `Formula/ocm@<version>.rb` (class `OcmAT<digits>`) — opt-in pin; users
who want a specific version run `brew install ocm@X.Y.Z`.

Drop the `Aliases/ocm` symlink creation in the workflow and remove any
stale symlink left over from earlier runs.

Companion cleanup in the tap (bumps `Formula/ocm.rb` to v0.43.0 manually
so users aren't stuck on v0.18.0 until the next release, and removes the
existing `Aliases/ocm`):
open-component-model/homebrew-tap#47

## Test plan

- [x] `go test ./...` in `hack/brew` passes
- [x] Generator output for v0.43.0 byte-identical to the existing tap
files (both `Formula/ocm.rb` and `Formula/ocm@0.43.0.rb`)
- [x] Locally tapped a synthetic tap with both generated files: `brew
info …/ocm` resolves to canonical formula 0.43.0; `brew info
…/ocm@0.43.0` still resolves to the versioned formula
- [x] Reviewer sanity-checks the workflow diff

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
sk31337 pushed a commit to sk31337/open-component-model that referenced this pull request Jun 19, 2026
…n-component-model#2802)

## Summary

Add a callout to the legacy install docs explaining the one-time
migration step for users who installed the OCM CLI via Homebrew before
the tap was fixed.

Background: earlier tap releases installed the CLI as a version-pinned
formula (e.g. \`ocm@0.43.0\`), so brew treated each release as a
separate package and accumulated side-by-side kegs instead of upgrading
in place. The tap is now fixed to use the canonical \`Formula/ocm.rb\`
(open-component-model/homebrew-tap#47, with the
release pipeline change in
open-component-model/ocm#1997), but existing
users stay stuck on their pinned version until they manually uninstall
it and reinstall the canonical formula.

## Test plan

- [x] Render the legacy install docs and verify the callout displays
correctly.
- [x] Reviewer sanity-checks the wording.

---------

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: sk31337 <sk31337@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/github-actions Changes on GitHub Actions or within `.github/` directory kind/bugfix Bug size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants