feat(wbfy): track the latest Bun in mise.toml - #1254
Conversation
`mise.toml`'s `bun` pin only moved when it could not prove the `minimumBunVersion` floor, so a repository pinned at 1.3.14 stayed there after 1.4.0 shipped (Renovate does not manage mise.toml pins). Bun now follows `mise latest bun` — capped to the running Bun's major and floored by the running Bun itself — the same way `node` and `fnox` already track their latest resolvable version. `mise latest` honors the machine's minimum-release-age gate, so a freshly published Bun reaches repositories only once that window elapses. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves how Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The Bun version drifts in the night, / We pin it to keep it in sight. / With mise we track, / No looking back, / To keep all our builds running right. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the Bun version pinning logic in mise.toml generation to resolve and pin the latest available Bun version of the current major version using mise latest bun, falling back to the running Bun version if needed. The review feedback correctly points out that the newly added test assertion is fragile because it directly compares the output of mise latest bun without applying the same fallback and major-version validation logic, which could cause test failures when offline or when a new major version of Bun is released.
| const content = await generateFrom({ 'mise.toml': '[tools]\nbun = "1.3.14"\n' }); | ||
|
|
||
| const bunVersion = /bun = "(\d+\.\d+\.\d+)"/u.exec(content)?.[1]; | ||
| expect(bunVersion).toBe(spawnSyncAndReturnStdout('mise', ['latest', 'bun'], '.')); |
There was a problem hiding this comment.
The test assertion is fragile and will fail if mise is offline (returning an empty/error string) or if a future major version of Bun (e.g., 2.0.0) is released. In those cases, resolveLatestBunVersion safely falls back to currentBunVersion (1.3.14), but this assertion expects the raw output of mise latest bun directly, causing a mismatch.
Use the same resolution logic in the test to make it robust.
| expect(bunVersion).toBe(spawnSyncAndReturnStdout('mise', ['latest', 'bun'], '.')); | |
| const latestBun = spawnSyncAndReturnStdout('mise', ['latest', 'bun'], '.'); | |
| const expectedBun = | |
| semver.valid(latestBun) && semver.major(latestBun) === 1 && semver.gt(latestBun, '1.3.14') | |
| ? latestBun | |
| : '1.3.14'; | |
| expect(bunVersion).toBe(expectedBun); |
| import { generateMiseToml } from '../../src/generators/miseToml.js'; | ||
| import { fsUtil } from '../../src/utils/fsUtil.js'; | ||
| import { promisePool } from '../../src/utils/promisePool.js'; | ||
| import { spawnSyncAndReturnStdout } from '../../src/utils/spawnUtil.js'; |
There was a problem hiding this comment.
Import semver to safely compute the expected Bun version in the test assertion, handling potential offline fallbacks or future major version releases.
| import { spawnSyncAndReturnStdout } from '../../src/utils/spawnUtil.js'; | |
| import semver from 'semver'; | |
| import { spawnSyncAndReturnStdout } from '../../src/utils/spawnUtil.js'; |
Why
generateMiseTomlonly rewrote thebunpin when the existing value could not prove theminimumBunVersionfloor (1.3.14). A repository already pinned at 1.3.14 therefore stayed there after Bun 1.4.0 shipped — Renovate does not managemise.tomlpins, so the drift never self-healed.nodeandfnoxalready track their latest resolvable version.What
bunnow followsmise latest bun, capped to the running Bun's major and floored by the running Bun itself (the startup guard proved it meetsminimumBunVersion), so the pin never drops below the floor when mise is offline or resolves nothing.latest, ranges,prefix:, aliases and a missing entry are all replaced with the concrete version. A pin ahead of what mise resolves is kept (that machine's release-age gate simply still hides it).mise latesthonors the machine's minimum-release-age gate, so a freshly published Bun reaches repositories only once that window elapses.Repositories pick the new pin up through the existing
mise installpaths (the generated post-merge hook andwb setup).