Skip to content

Single source of truth for version - #52

Merged
dennisvang merged 11 commits into
masterfrom
dev/47-dry-version
Aug 20, 2026
Merged

Single source of truth for version#52
dennisvang merged 11 commits into
masterfrom
dev/47-dry-version

Conversation

@dennisvang

@dennisvang dennisvang commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

This creates a version string based on git tags during the build phase.
The version string is based on the latest tag and is always in git's long format, e.g. v1.2.3-0-gfc7760f if the latest tag is v1.2.3.
If the repo has no git tags (yet), we fall back on the abbreviated commit hash, e.g. fc7760f.

  • removed name and version from package.json
  • added gitDescribeVersion helper vite.config.ts to get the app version from git during the Vite build phase

Note that gitDescribeVersion runs git describe, synchronously, using child_process.spawnSync, and fails intentionally if the version string is empty.

fixes #47

@dennisvang dennisvang added the dev Related to development, like CI/CD, refactoring, etc. End-users should not notice these changes. label Jul 20, 2026
@dennisvang
dennisvang requested a review from mihailefter July 20, 2026 11:40
@mihailefter

Copy link
Copy Markdown
Collaborator

Hi @dennisvang! I think that, when running npm run build, the container has no access to the .git directory, so it cannot get the version. Also, is the git binary present in the node image?
I also get the impression that we would start making use of tag versioning, or?

@dennisvang

Copy link
Copy Markdown
Collaborator Author

I also get the impression that we would start making use of tag versioning, or?

Yes, the release process uses git tags for versioning, same as for the fdp repo, etc.

The .git dir is only needed to get a version description based on git tags in the build stage.
The .git dir is not copied to the final image.
@dennisvang

dennisvang commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

[...] I think that, when running npm run build, the container has no access to the .git directory, so it cannot get the version.

@mihailefter Yes,good point. That was true for the npm run build call in the Dockerfile, because .git was still in .dockerignore.

I just removed .git from the .dockerignore so it is now included in the build context.
This should not be a problem, because only the build output is copied into the final image.

[...] Also, is the git binary present in the node image?

Yes, git is available in the image used for the dockerfile build stage.

@dennisvang

dennisvang commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

@mihailefter I also updated the PR description.

@dennisvang

Copy link
Copy Markdown
Collaborator Author

@mihailefter do you think this is ready to be merged?

@mihailefter mihailefter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @dennisvang! This can be merged, indeed.

@dennisvang
dennisvang merged commit a43b99f into master Aug 20, 2026
5 checks passed
@dennisvang
dennisvang deleted the dev/47-dry-version branch August 20, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev Related to development, like CI/CD, refactoring, etc. End-users should not notice these changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single source of truth for client version

2 participants