Skip to content

feat(wbfy): track the latest Bun in mise.toml - #1254

Closed
exKAZUu wants to merge 1 commit into
mainfrom
feat/track-latest-bun-in-mise-toml
Closed

feat(wbfy): track the latest Bun in mise.toml#1254
exKAZUu wants to merge 1 commit into
mainfrom
feat/track-latest-bun-in-mise-toml

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Aug 20, 2026

Copy link
Copy Markdown
Member

Why

generateMiseToml only rewrote the bun pin when the existing value could not prove the minimumBunVersion floor (1.3.14). A repository already pinned at 1.3.14 therefore stayed there after Bun 1.4.0 shipped — Renovate does not manage mise.toml pins, so the drift never self-healed. node and fnox already track their latest resolvable version.

What

  • bun now follows mise latest bun, capped to the running Bun's major and floored by the running Bun itself (the startup guard proved it meets minimumBunVersion), so the pin never drops below the floor when mise is offline or resolves nothing.
  • Only an exact pin at or above the resolved version is kept; 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 latest honors 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 install paths (the generated post-merge hook and wb setup).

`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>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 wbfy manages Bun version pins in mise.toml. By moving from a static minimum-version check to a dynamic resolution strategy that tracks the latest available Bun version, the tool ensures that project configurations stay current without manual intervention. The changes also enforce concrete version pinning to guarantee that CI environments consistently use a version of Bun that supports required features like globalStore and publicHoistPattern.

Highlights

  • Automated Bun Version Tracking: Updated generateMiseToml to automatically track the latest available Bun version via mise latest bun, ensuring that repositories do not remain stuck on older, outdated pins.
  • Improved Pinning Logic: Replaced imprecise version selectors (like 'latest' or ranges) with concrete pins, while maintaining compatibility with the minimum required Bun version to ensure generated configurations remain valid.
  • Major Version Guardrails: Added logic to ensure the tracked Bun version stays within the same major version as the running Bun, preventing unexpected major version upgrades.
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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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'], '.'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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.

Suggested change
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';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Import semver to safely compute the expected Bun version in the test assertion, handling potential offline fallbacks or future major version releases.

Suggested change
import { spawnSyncAndReturnStdout } from '../../src/utils/spawnUtil.js';
import semver from 'semver';
import { spawnSyncAndReturnStdout } from '../../src/utils/spawnUtil.js';

@exKAZUu exKAZUu closed this Aug 20, 2026
@exKAZUu
exKAZUu deleted the feat/track-latest-bun-in-mise-toml branch August 20, 2026 14:59
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