Skip to content

fix(web): put the release-please version marker on the value line - #524

Merged
mforce merged 1 commit into
mainfrom
fix/release-version-sync-marker
Aug 13, 2026
Merged

fix(web): put the release-please version marker on the value line#524
mforce merged 1 commit into
mainfrom
fix/release-version-sync-marker

Conversation

@mforce

@mforce mforce commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Fixes #458 (reopened).

Bug

#459 added web/.env.production (VITE_APP_VERSION) plus a release-please-config.json extra-files entry to keep it in lockstep with version.txt on every release PR. On the first real release (#461, v0.0.4) it silently didn't fire — version.txt bumped to 0.0.4, web/.env.production stayed at 0.0.3. Caught by Codex review on #461: #461 (comment)

Root cause

Release-please's generic file updater only matches a semver pattern on the same line as the x-release-please-version marker comment, not the line below it. #459 placed the marker above the value:

# x-release-please-version
VITE_APP_VERSION=0.0.3

The marker's own line has no semver pattern on it, so the updater silently finds nothing to replace — no error, no warning, just a no-op.

#459 avoided a trailing same-line marker on the assumption that dotenv-style .env parsing doesn't strip inline # comments. That's backwards: dotenv (which Vite's env loading is built on) strips an inline # comment on an unquoted value by default since v15+.

Fix

VITE_APP_VERSION=0.0.3 # x-release-please-version

Marker now shares the value's line, so the updater has a semver pattern to match. Updated docs/decisions/351-releases.md's note accordingly.

Verification

  • npm run typecheck: clean.
  • Real npm run build, then grepped the bundled output — 0.0.3 bakes in clean with no stray #/comment text, confirming dotenv strips the trailing marker correctly.
  • Simulated release-please's own marker-matching regex (/\d+\.\d+\.\d+/ against any line containing x-release-please-version) against the new file content — matches, where it didn't before.

Note

This fixes the mechanism going forward. The already-open v0.0.4 release PR (#461) still has the stale 0.0.3 in web/.env.production from before this fix — that PR's branch needs a one-time manual sync before merging, separate from this change.

release-please's generic updater only matches a semver pattern on the
same line as the x-release-please-version marker, not the line below
it. #459 placed the marker above the value, so it silently never
matched — v0.0.4 (#461) bumped version.txt but left
web/.env.production at 0.0.3, caught by review.

Move the marker to a trailing comment on the value's own line.
dotenv (Vite's env loader) strips inline # comments on unquoted
values, so the runtime value stays clean — verified via a real
npm run build and a grep of the bundled output.

Fixes #458
@mforce
mforce merged commit 6e67668 into main Aug 13, 2026
8 checks passed
@mforce
mforce deleted the fix/release-version-sync-marker branch August 13, 2026 07:46
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.

Display app version in the SPA, sourced from release-please's version.txt

1 participant