Skip to content

Derive release version from the git tag instead of hard-coded versions - #684

Merged
LarsLaskowski merged 1 commit into
mainfrom
feature/version-from-release-tag
Dec 1, 2026
Merged

LarsLaskowski merged 1 commit into
mainfrom
feature/version-from-release-tag

Conversation

@LarsLaskowski

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

Before every release the version had to be bumped by hand in SharedAssemblyInfo.cs, F1ServerApp/package.json and F1ServerApp/package-lock.json, matching the vX.Y.Z tag. The backend assembly version never matched the release anyway, because the 1.19.* wildcard filled build/revision from the build date/time.

This change makes the release tag the single source of truth:

  • Release workflow: passes the version derived from the tag as a VERSION build arg to both Docker builds.
  • Server image: Dockerfile builds and publishes with /p:Version=${VERSION} (default 0.0.0).
  • Web app image: F1ServerApp/Dockerfile runs npm version "$VERSION" --no-git-tag-version --allow-same-version before npm run build, inside the image only, so the footer shows the release version.
  • Assembly metadata: SharedAssemblyInfo.cs is removed together with GenerateAssemblyInfo=false in all projects. Version, product, description, company and copyright are now set once in Directory.Build.props and generated by the SDK, so they apply uniformly to every project, including the tools (F1ReplayClient, F1PacketTester, F1SessionFolderRename) and the tests. The previously conflicting values are unified to e-networld.com.
  • Placeholder version: the repository only holds 0.0.0 (Directory.Build.props, package.json, package-lock.json); local and CI builds report it on purpose.
  • Deterministic builds: <Deterministic>false</Deterministic> (only needed for the wildcard version) and the now redundant <Deterministic>true</Deterministic> in F1PacketTester are removed.
  • Runtime / observability: new ServiceInformation in F1Server.Observability provides the service name and the informational version; the startup output and all OpenTelemetry resources use it instead of the hard-coded "1.0".
  • Documentation: the versioning section in docs/ARCHITECTURE.md and the agent/Copilot instructions describe the new process.

🎫 Issues

Closes #683

👩‍💻 Reviewer Notes

  • The Docker images were not built locally; the first tagged release is the end-to-end check. Expected result for tag vX.Y.Z: server startup logs version: X.Y.Z, the web app footer shows X.Y.Z, and OpenTelemetry reports service.version = X.Y.Z.
  • IncludeSourceRevisionInInformationalVersion is disabled so the informational version stays X.Y.Z without a +<commit> suffix.
  • No version bump commit is needed before future releases anymore.

📑 Test Plan

  • Built the solution with -p:Version=1.20.3 and verified that all assemblies (server, libraries, tools, tests) carry file version 1.20.3.0, product version 1.20.3, product F1-Telemetry, company e-networld.com and the shared copyright.
  • Ran npm version 1.20.3 --no-git-tag-version --allow-same-version on a copy of package.json/package-lock.json to confirm the Dockerfile step updates all version entries.
  • Existing unit tests are unaffected.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.

Backend-specific (.NET)

  • I have added or updated a repository, service, or processor in F1Server.*.
  • I have added or updated Unit Tests in F1Server.Tests for the change.
  • I have kept multi-database support in sync across F1Server.Db.MsSqlMigrations, F1Server.Db.MySqlMigrations and F1Server.Db.PostgreSqlMigrations.

Frontend-specific (Angular)

  • I have added a new Angular component or service in F1ServerApp.
  • I have modified an existing Angular component or service.
  • I have kept the frontend models/services in sync with the backend Data/ViewData contracts.

⏭ Next Steps

  • Create the next release via a vX.Y.Z tag only and verify the reported versions.

The release workflow now passes the version derived from the vX.Y.Z tag to both
Docker builds, so no file has to be bumped before a release. SharedAssemblyInfo.cs
is replaced by SDK-generated assembly metadata from Directory.Build.props, which
now applies uniformly to all projects including the tools, and the repository only
keeps the placeholder version 0.0.0. Startup output and OpenTelemetry report the
assembly version instead of a hard-coded 1.0.
@LarsLaskowski LarsLaskowski added the enhancement New feature or request label Dec 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@LarsLaskowski
LarsLaskowski merged commit dc775d4 into main Dec 1, 2026
6 of 7 checks passed
@LarsLaskowski
LarsLaskowski deleted the feature/version-from-release-tag branch December 1, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Derive release version from the git tag instead of hard-coded versions

1 participant