Skip to content

feat: implement end-to-end project release version tracking#240

Open
plexoos wants to merge 3 commits intomainfrom
feat-auto-version
Open

feat: implement end-to-end project release version tracking#240
plexoos wants to merge 3 commits intomainfrom
feat-auto-version

Conversation

@plexoos
Copy link
Member

@plexoos plexoos commented Mar 25, 2026

  • bump the project version to 0.3.0 in CMake and Python metadata
  • add git-aware version resolution in CMake with support for CI/Docker overrides
  • propagate the release tag into Docker builds from the release workflow
  • generate version metadata macros in the configured header
  • expose project version, git version, and git revision through the Config API

Copilot AI review requested due to automatic review settings March 25, 2026 13:57
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Cpp-linter Review

Used clang-format v20.1.2

Click here for the full clang-format patch
diff --git a/src/config.cpp b/src/config.cpp
index 649bd87..bf3a33e 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -21,3 +21,12 @@ using namespace std;
-const char* Config::Version() { return GPHOX_VERSION; }
-const char* Config::GitVersion() { return GPHOX_GIT_VERSION; }
-const char* Config::GitRevision() { return GPHOX_GIT_REVISION; }
+const char *Config::Version()
+{
+    return GPHOX_VERSION;
+}
+const char *Config::GitVersion()
+{
+    return GPHOX_GIT_VERSION;
+}
+const char *Config::GitRevision()
+{
+    return GPHOX_GIT_REVISION;
+}
diff --git a/src/config.h b/src/config.h
index 9b67047..06b38b6 100644
--- a/src/config.h
+++ b/src/config.h
@@ -25 +25 @@ class Config
-  static const char* Version();
+  static const char *Version();
@@ -28 +28 @@ class Config
-  static const char* GitVersion();
+  static const char *GitVersion();
@@ -31 +31 @@ class Config
-  static const char* GitRevision();
+  static const char *GitRevision();

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review March 25, 2026 14:00

outdated suggestion

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements end-to-end build/release version tracking by deriving a git-based version during CMake configure, embedding version metadata into generated headers, and wiring CI/Docker to provide a version when .git is unavailable.

Changes:

  • Add CMake git version detection (git describe / rev-parse) with fallback to PROJECT_VERSION, plus optional CI/Docker override.
  • Expose version metadata in generated config header and via new gphox::Config accessors.
  • Bump project/package version to 0.3.0 and pass release tag into Docker builds from GitHub Actions.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/config_path.h.in Adds preprocessor macros for project and git version metadata for compile-time embedding.
src/config.h Declares Config::Version/GitVersion/GitRevision accessors.
src/config.cpp Implements the new version accessors by returning generated macro values.
cmake/GitVersion.cmake New module to compute PROJECT_GIT_VERSION/PROJECT_GIT_REVISION from git, with fallback.
Dockerfile Adds PROJECT_VERSION build arg and forwards it into CMake as an override when set.
CMakeLists.txt Bumps project version to 0.3.0, includes GitVersion, and supports override variable.
.github/workflows/release.yaml Passes the release tag name into Docker build args as PROJECT_VERSION.
pyproject.toml Bumps Python package version to 0.3.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@plexoos plexoos self-assigned this Mar 25, 2026
plexoos added 3 commits March 25, 2026 16:48
- bump project and Python package version to 0.2.0

- add git-aware CMake version resolution with CI override support

- propagate release tag into Docker builds from the release workflow

- generate version metadata macros in the configured header
- add Config accessors for project version, git version, and git revision

- surface generated release metadata to runtime consumers
@plexoos plexoos force-pushed the feat-auto-version branch from f1de1da to ae04271 Compare March 25, 2026 21:10
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.

2 participants