Repository navigation
Commit eb7c066
authored
fix(release): read the Homebrew lane version from the formula's version stanza (#358)
## 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 #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
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue (external PRs: issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] 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.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 0f518b5 commit eb7c066
2 files changed
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
165 | 176 | | |
166 | 177 | | |
167 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
168 | 194 | | |
169 | 195 | | |
170 | 196 | | |
| |||
0 commit comments