-
Notifications
You must be signed in to change notification settings - Fork 578
refactor: centralize version management in all modules #2722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Improved version management by introducing Maven's property - Replaced hardcoded version strings with dynamic retrieval - Added version.properties to support runtime version access - Ensured updated version in scripts and classes
|
@lavanyavijayk There is an issue with the version number here for compilation error, it should be updated to |
I also want to get more details for the following. The ticket mentions a change in /hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/version/ApiVersion.java, but it is unclear which string should be replaced with the revision value. Could you confirm this before proceeding? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2722 +/- ##
=============================================
- Coverage 46.98% 34.94% -12.04%
+ Complexity 821 382 -439
=============================================
Files 745 745
Lines 60060 60060
Branches 7669 7669
=============================================
- Hits 28218 20989 -7229
- Misses 29018 36822 +7804
+ Partials 2824 2249 -575 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes version management by replacing hardcoded version strings with dynamic retrieval from Maven's revision property via a filtered version.properties file.
- Replaces hardcoded version strings in API.java, RpcVersion.java, and CommonVersion.java with a call to VersionUtil.getVersionNumber().
- Introduces getVersionNumber() in VersionUtil.java to load the version dynamically from version.properties.
- Updates startup scripts (not shown here) and ensures compliance with Apache license requirements.
Reviewed Changes
Copilot reviewed 4 out of 9 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/API.java | Replaces hardcoded version with dynamic retrieval via VersionUtil. |
| hugegraph-commons/hugegraph-rpc/src/main/java/org/apache/hugegraph/version/RpcVersion.java | Updates version initialization to use dynamic version from VersionUtil. |
| hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/version/CommonVersion.java | Updates version initialization to use dynamic version from VersionUtil. |
| hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/util/VersionUtil.java | Adds a method to load the version from a properties file. |
Files not reviewed (5)
- hugegraph-commons/hugegraph-common/pom.xml: Language not supported
- hugegraph-commons/hugegraph-common/src/main/resources/version.properties: Language not supported
- hugegraph-pd/hg-pd-service/pom.xml: Language not supported
- hugegraph-server/hugegraph-dist/src/assembly/travis/start-pd.sh: Language not supported
- hugegraph-server/hugegraph-dist/src/assembly/travis/start-store.sh: Language not supported
Comments suppressed due to low confidence (1)
hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/util/VersionUtil.java:242
- Consider adding a null check for the InputStream before calling PROPS.load(is) to prevent a potential NullPointerException in case version.properties is not found.
try (InputStream is = VersionUtil.class.getResourceAsStream("/version.properties")) {
Purpose of the PR
This PR centralizes version management across the project by leveraging Maven's ${revision} property and a filtered version.properties file for dynamic runtime access to the version. It removes the need for hardcoded version strings and ensures consistent versioning across all modules.
Main Changes
Need More Clarity on
file path - /hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/version/ApiVersion.java had a change mentioned in the ticket but not sure which string needs to be replaced with the revision value. need confirmation to go ahead and make the change.
##Working On
Attempted to update CoreVersion.DEFAULT_VERSION(file path - /hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/version/CoreVersion.java) to dynamically use the revision value, but encountered an error during compilation, so the change is not yet applied.
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need