Skip to content
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

refactor: centralize version management in all modules #2722

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lavanyavijayk
Copy link

@lavanyavijayk lavanyavijayk commented Jan 14, 2025

  • 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

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

  • Replaced hardcoded version strings in classes like CommonVersion, RpcVersion, CoreVersion, and API.
  • Added a version.properties file with resource filtering for dynamic version retrieval.
  • Updated startup scripts (start-pd.sh, start-store.sh) to reflect the new version.
  • Ensured compliance with Apache license requirements for new files.
  • Refactored the version handling logic to avoid redundant version updates in code.

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

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • [x ] Need tests and can be verified as follows:
    • xxx

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

- 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
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 14, 2025
@imbajin imbajin changed the title Centralize version management. refactor: centralize version management in all Jan 14, 2025
@imbajin imbajin changed the title refactor: centralize version management in all refactor: centralize version management in all modules Jan 14, 2025
@VGalaxies
Copy link
Contributor

@lavanyavijayk There is an issue with the version number here for compilation error, it should be updated to ${hugegraph-commons.version}.

@lavanyavijayk
Copy link
Author

lavanyavijayk commented Jan 18, 2025

@lavanyavijayk There is an issue with the version number here for compilation error, it should be updated to ${hugegraph-commons.version}.
@VGalaxies Thank you for pointing that out. I have made the changes.

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?
I attempted to dynamically assign the revision value to CoreVersion.DEFAULT_VERSION (/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/version/CoreVersion.java), but it caused a compilation error. The issue arises because CoreVersion.DEFAULT_VERSION is also used as an annotation value in /hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/server/ApplicationConfig.java, which requires a constant expression. Should I defer this change for now?

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.36%. Comparing base (57e9f56) to head (de6bffb).

❗ There is a different number of reports uploaded between BASE (57e9f56) and HEAD (de6bffb). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (57e9f56) HEAD (de6bffb)
8 5
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2722      +/-   ##
============================================
- Coverage     46.81%   40.36%   -6.46%     
+ Complexity     1049      611     -438     
============================================
  Files           754      754              
  Lines         60327    60328       +1     
  Branches       7691     7691              
============================================
- Hits          28244    24349    -3895     
- Misses        29265    33423    +4158     
+ Partials       2818     2556     -262     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants