feat: implement end-to-end project release version tracking#240
Open
feat: implement end-to-end project release version tracking#240
Conversation
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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 toPROJECT_VERSION, plus optional CI/Docker override. - Expose version metadata in generated config header and via new
gphox::Configaccessors. - Bump project/package version to
0.3.0and 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.
- 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
f1de1da to
ae04271
Compare
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.
Uh oh!
There was an error while loading. Please reload this page.