Skip to content

fix: write .version directly instead of hardcoding the version in urls - #98

Merged
bougyman merged 4 commits into
mainfrom
fix-homebrew-bump-version-file
Aug 12, 2026
Merged

fix: write .version directly instead of hardcoding the version in urls#98
bougyman merged 4 commits into
mainfrom
fix-homebrew-bump-version-file

Conversation

@bougyman

Copy link
Copy Markdown
Member

Summary

Test plan

  • Verified against a real copy of the formula: correct .version/sha256 output, url lines left untouched
  • Confirmed idempotent - a repeated bump with the same inputs produces identical output
  • Confirmed the resulting formula evaluates to the correct version/url/sha256 via a small Homebrew-Formula-DSL stub
  • actionlint clean on main.yaml
  • mix format --check-formatted/mix usage_rules.sync --check clean in app/

🤖 Generated with Claude Code

ci/bump_homebrew_formula.rb now writes Formula/linear-cli/.version to
the release tag directly (the formula's own single source of truth,
per rubyists/homebrew-tap's matching change) instead of rewriting a
literal version number inside each url - the url lines are now a
constant `v#{version}/<asset>` in the formula's own source, so only
the sha256 that follows each one actually needs updating per release.

Verified against a real copy of the formula: correct .version/sha256
output, url lines left untouched, idempotent on a repeated run with
the same inputs, and the resulting formula evaluates to the correct
version/url/sha256 via a small Homebrew-Formula-DSL stub.

Also bumps the vendor/rubyists-homebrew-tap submodule pointer to the
merged fix (rubyists/homebrew-tap#6).
Copilot AI lite review requested due to automatic review settings August 12, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Homebrew formula bump script so releases are driven by the formula’s .version file (as the single source of truth) and only sha256 entries are updated, leaving url lines untouched because they interpolate #{version}.

Changes:

  • Write Formula/linear-cli/.version based on the provided release tag.
  • Update per-platform sha256 values by matching the formula’s constant v#{version}/<asset> URL pattern.
  • Simplify the substitution logic to only replace the checksum portion of each url/sha256 pair.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ci/bump_homebrew_formula.rb Outdated
Comment thread ci/bump_homebrew_formula.rb Outdated
Comment thread ci/bump_homebrew_formula.rb
Copilot's review on #98 flagged three real issues in
ci/bump_homebrew_formula.rb, all verified against the actual behavior
before fixing:

- TAG's "v" prefix was assumed, never validated - a bare "1.5.0" would
  silently write a .version that doesn't match what the formula's
  hardcoded v#{version} url actually requests. Now aborts loudly if
  TAG doesn't start with "v".
- .version was written before the validation loop that can abort on a
  missing checksum or pattern mismatch, so a failure mid-run could
  leave .version bumped while the formula's actual sha256/url stayed
  on the old release. Both writes now happen only after every asset's
  checked and every pattern's matched.
- The sha256 match pattern accepted any-length hex ([a-f0-9]+) instead
  of exactly 64 chars, risking a match against malformed content.
  Tightened to [a-fA-F0-9]{64}.
…byists/linear-cli into fix-homebrew-bump-version-file
@bougyman
bougyman merged commit 170ba1e into main Aug 12, 2026
2 checks passed
@bougyman
bougyman deleted the fix-homebrew-bump-version-file branch August 12, 2026 22:13
bougyman pushed a commit that referenced this pull request Aug 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.4.1](v1.4.0...v1.4.1)
(2026-08-12)


### Bug Fixes

* write .version directly instead of hardcoding the version in urls
([#98](#98))
([170ba1e](170ba1e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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