Repository navigation
build: let a packaged build say which build it is (opt-in APP_BUILD) - #244
Merged
Merged
Conversation
__APP_VERSION__ comes from package.json, so every image built between two releases calls itself 1.3.7 and the one question a bug report turns on — which build were you running? — has no answer from inside the app. Twice today a "I tested it, no change" could not be told apart from a stale cached build. vite.config.js appends process.env.APP_BUILD as "1.3.7+<build>" when it is set, and web/Dockerfile takes it as a build-arg in the build stage (the existing VERSION arg lives in the runtime stage, which is after vite has already run). Unset — every upstream and self-hoster build — the string is exactly package.json's version as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kurktchiev
force-pushed
the
gh/build-identity
branch
from
September 21, 2026 19:41
5dcb6b1 to
9d60cad
Compare
DuarteSantos8
added a commit
that referenced
this pull request
Sep 28, 2026
…the app does, so a build that sets APP_BUILD runs them against its own installed version
Owner
|
Thanks @kurktchiev. With Released in v1.3.9: https://github.com/DuarteSantos8/openGym/releases/tag/v1.3.9 |
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.
__APP_VERSION__is read fromfrontend/package.json, so every image built between two releases reports the same number. From inside the app there is no way to tell one build of1.3.7from another — which means the question a bug report turns on, which build were you running?, has no answer, and "I tested it, no change" cannot be told apart from a stale service-worker cache.That happened to me twice in one day on a self-hosted deployment: two rounds of testing a timer change were unresolvable because the tester's phone reported
v1.3.7either way.The change
Two lines of substance:
frontend/vite.config.js— whenprocess.env.APP_BUILDis set,__APP_VERSION__becomes`${pkgVersion}+${APP_BUILD}`. Unset, it is exactlypkgVersion, as now.web/Dockerfile— takesARG APP_BUILD=""in the build stage and passes it tonpm run build. (The existingVERSION/VCS_REFargs live in the runtime stage, which is after vite has already run, so they cannot reach the bundle.)Nothing else moves. Settings → About and the footer already render
__APP_VERSION__, so a build that sets it readsopenGym v1.3.7+2026-09-17.3and one that does not readsopenGym v1.3.7.Why opt-in rather than always-on
A release build should say
1.3.7and nothing else — that is the number people are asked for, and1.3.7+abc1234in a release would be noise. The suffix is for builds that are not releases: CI artifacts, nightlies, a self-hoster's own image.docker compose up --buildwithout the arg is unchanged, which is the path almost every self-hoster takes.Suggested use in CI:
--build-arg APP_BUILD=$CI_PIPELINE_IDor a date stamp.Checked
npm testinfrontend/— 1468 passing across 100 filesnpm run buildwithAPP_BUILD=demo.1→ the bundle contains1.3.7+demo.1npm run buildwith it unset → the bundle contains no+suffix at all, i.e. the string is byte-identical to today'sprocess.envis already how vite config reads its environment🤖 Generated with Claude Code