fix(web): put the release-please version marker on the value line - #524
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #458 (reopened).
Bug
#459 added
web/.env.production(VITE_APP_VERSION) plus arelease-please-config.jsonextra-filesentry to keep it in lockstep withversion.txton every release PR. On the first real release (#461, v0.0.4) it silently didn't fire —version.txtbumped to0.0.4,web/.env.productionstayed at0.0.3. Caught by Codex review on #461: #461 (comment)Root cause
Release-please's
genericfile updater only matches a semver pattern on the same line as thex-release-please-versionmarker comment, not the line below it. #459 placed the marker above the value: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
.envparsing 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
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.npm run build, then grepped the bundled output —0.0.3bakes in clean with no stray#/comment text, confirming dotenv strips the trailing marker correctly./\d+\.\d+\.\d+/against any line containingx-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.3inweb/.env.productionfrom before this fix — that PR's branch needs a one-time manual sync before merging, separate from this change.