This is an automated email from the ASF dual-hosted git repository.

xuba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b90227da [AMORO-2813] Improve the version info about the project 
(#2821)
5b90227da is described below

commit 5b90227da9582a127dded0e348b3e8d013afbd2f
Author: Congxian Qiu <[email protected]>
AuthorDate: Fri May 10 21:18:23 2024 +0800

    [AMORO-2813] Improve the version info about the project (#2821)
    
    * [AMORO-2813] Improve the version info about the project
    
    Before this commit, there will only show the version about the project in 
the topbar,
    but this may not enough for some cases, in this commit we enahcned the 
version info
    by including the abbrev.
    
    * fixup! [AMORO-2813] Improve the version info about the project
---
 amoro-ams/amoro-ams-server/pom.xml                                  | 2 +-
 .../apache/amoro/server/dashboard/controller/VersionController.java | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/amoro-ams/amoro-ams-server/pom.xml 
b/amoro-ams/amoro-ams-server/pom.xml
index bdf665070..b3c0efcb2 100644
--- a/amoro-ams/amoro-ams-server/pom.xml
+++ b/amoro-ams/amoro-ams-server/pom.xml
@@ -375,7 +375,7 @@
                     <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
                     <generateGitPropertiesFilename>
-                        ${project.build.outputDirectory}/arctic/git.properties
+                        ${project.build.outputDirectory}/amoro/git.properties
                     </generateGitPropertiesFilename>
                     <includeOnlyProperties>
                         
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
diff --git 
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/VersionController.java
 
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/VersionController.java
index e7a75a815..2fad7f7f4 100644
--- 
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/VersionController.java
+++ 
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/VersionController.java
@@ -35,13 +35,15 @@ public class VersionController {
   public void getVersionInfo(Context ctx) {
     Properties prop = new Properties();
     InputStream is =
-        
VersionController.class.getClassLoader().getResourceAsStream("arctic/git.properties");
+        
VersionController.class.getClassLoader().getResourceAsStream("amoro/git.properties");
     String version = "UNKNOWN";
     String commitTime = "UNKNOWN";
+    String abbrev = "UNKNOWN";
     if (is != null) {
       try {
         prop.load(is);
         version = prop.getProperty("git.build.version");
+        abbrev = prop.getProperty("git.commit.id.abbrev");
         commitTime = prop.getProperty("git.commit.time");
       } catch (Exception e) {
         LOG.warn("Failed to find git.properties.");
@@ -49,7 +51,7 @@ public class VersionController {
     }
 
     VersionInfo versionInfo = new VersionInfo();
-    versionInfo.setVersion(version);
+    versionInfo.setVersion(String.format("%s(%s)", version, abbrev));
     versionInfo.setCommitTime(commitTime);
     ctx.json(OkResponse.of(versionInfo));
   }

Reply via email to