Skip to content

fix(release): read the Homebrew lane version from the formula's version stanza - #358

Merged
elkaix merged 1 commit into
mainfrom
fix/brew-lane-version-stanza
Oct 2, 2026
Merged

elkaix merged 1 commit into
mainfrom
fix/brew-lane-version-stanza

Conversation

@elkaix

@elkaix elkaix commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Requirement or Bug

The nightly workflow has failed on main every scheduled run since 2026-09-28 (runs 36405927270, 36551889134, 36698004633, 36814079854, 36847459152). After PR #356 shipped the Homebrew formula from native release tarballs, the release-reconciliation script can no longer read the formula's version, so the Homebrew lane fails on every nightly.

Bug Reproduction Steps

  1. Let a release publish with the feat(release): ship the Homebrew formula from native release tarballs #356 formula shape (done: @pymodel/pythinker-code@2.5.0).
  2. Run node scripts/release/release-status.mjs on main (commit before this PR).
  3. The Homebrew lane reports FAIL | Formula/pythinker-code.rb (no version) — the step exits 1 and the nightly run goes red (drift issue "Release lane drift detected").

Root Cause

brewFormulaVersion extracted the version from the old npm-tarball formula shape via the regex /pythinker-code-(\d+\.\d+\.\d+)\.tgz/. PR #356 rewrote the generated formula to pin native per-platform tarballs (pythinker-code-<target>.tar.gz, no version in the filename) and to declare an explicit version "X.Y.Z" stanza instead. The lane checker — a consumer of the formula shape — was not updated, so it now always reports the formula as unreadable. This is a fundamental fix: the parser now reads the stanza the generator actually writes (renderFormula in scripts/release/update-brew-formula.mjs).

Code Changes

  • scripts/release/release-status.mjs — brewFormulaVersion now extracts the version from the formula's version "…" stanza.
  • scripts/release/release-status.test.mjs — the fixture formula now renders the native-tarball shape (version stanza + native tarball URL), and a new test proves a formula without a version stanza fails the lane with "no pythinker-code tarball version".

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
Homebrew lane version detection in nightly reconciliation version parsed from a pythinker-code-<version>.tgz npm-tarball URL version parsed from the formula's version "…" stanza maintainers reading the drift issue's "Observed" column for a tap still serving the pre-#356 npm-tarball formula: they now see "unavailable" instead of the old version number none — the pre-#356 formula shape is no longer produced by any pipeline

Nothing else observable changes: the CLI, desktop app, extension, installers, and updaters do not consume brewFormulaVersion; it is internal to the release reconciliation script and the nightly workflow.

Test coverage: scripts/release/release-status.test.mjs — lane-aligned test (native-shape fixture), lagging-formula test, and the new missing-stanza test (pnpm run test:release, 59/59).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Bug Fixes
    • Homebrew release status now reflects the version declared in the formula, rather than inferring it from the release archive’s filename. This keeps the reported version accurate when archive naming differs from the formula. If the formula does not contain a valid version declaration, the version is reported as unavailable.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: PyModel/pythinker-code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 050bd009-39c2-425e-a0ae-42e412176024

📥 Commits

Reviewing files that changed from the base of the PR and between 0f518b5 and 5097150.

📒 Files selected for processing (2)
  • scripts/release/release-status.mjs
  • scripts/release/release-status.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The release status script now reads the Homebrew version from its formula’s version declaration. Tests use formula text and verify the reported result when no matching tarball version is present.

Changes

Homebrew version parsing

Layer / File(s) Summary
Formula version extraction and validation
scripts/release/release-status.mjs, scripts/release/release-status.test.mjs
brewFormulaVersion extracts the quoted version declaration and validates it. The fixture supplies formula text, and a test checks the unsuccessful result when no matching tarball version is available.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 50971

The change updates how Homebrew’s release version is read, and the supplied context identifies no concrete impact that should block merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title uses the required conventional-commit prefix and imperative wording, but it is 78 characters and exceeds the 72-character limit. Shorten the title to 72 characters or fewer, for example: "fix(release): read Homebrew version from formula stanza".
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the bug, reproduction steps, root cause, code changes, behavior changes, affected users, test coverage, and checklist. It is complete and directly related to the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@5097150
npx https://pkg.pr.new/@pymodel/pythinker-code@5097150

commit: 5097150

@elkaix
elkaix merged commit eb7c066 into main Oct 2, 2026
27 checks passed
@elkaix
elkaix deleted the fix/brew-lane-version-stanza branch October 2, 2026 03:13
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.

1 participant