You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by bo...@apache.org on 2023/01/20 15:43:43 UTC

[kyuubi] branch master updated: [KYUUBI #4187] [Improvement] Print revision commit time on server startup

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

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


The following commit(s) were added to refs/heads/master by this push:
     new cd00e69c9 [KYUUBI #4187] [Improvement] Print revision commit time on server startup
cd00e69c9 is described below

commit cd00e69c9646f8ef5e837e1daf65fcc34061724f
Author: liangbowen <li...@gf.com.cn>
AuthorDate: Fri Jan 20 23:43:29 2023 +0800

    [KYUUBI #4187] [Improvement] Print revision commit time on server startup
    
    ### _Why are the changes needed?_
    
    - commit date is more readable and helpful to determine earlier/later version, especially for snapshot branch
    - adding revision commit date from git to `kyuubi-version-info.properties`
    - Print revision date on server startup
    
    ![image](https://user-images.githubusercontent.com/1935105/213330684-26ef3b3f-eaf3-4cb1-b0cb-81dba30dbee3.png)
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4187 from bowenliang123/print-revision-date.
    
    Closes #4187
    
    b0b0a6c8 [liangbowen] print revision date on server startup
    
    Authored-by: liangbowen <li...@gf.com.cn>
    Signed-off-by: liangbowen <li...@gf.com.cn>
---
 build/kyuubi-build-info                                                 | 1 +
 kyuubi-common/src/main/scala/org/apache/kyuubi/package.scala            | 2 ++
 kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala         | 1 +
 .../src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala          | 2 +-
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/build/kyuubi-build-info b/build/kyuubi-build-info
index a3da7ccae..8ac7ee2e2 100755
--- a/build/kyuubi-build-info
+++ b/build/kyuubi-build-info
@@ -32,6 +32,7 @@ echo_build_properties() {
   echo kyuubi_trino_version="$9"
   echo user="$USER"
   echo revision=$(git rev-parse HEAD)
+  echo revision_time=$(git show -s --format=%ci HEAD)
   echo branch=$(git rev-parse --abbrev-ref HEAD)
   echo date=$(date -u +%Y-%m-%dT%H:%M:%SZ)
   echo url=$(git config --get remote.origin.url)
diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/package.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/package.scala
index 11871c5d0..e05ad9fbe 100644
--- a/kyuubi-common/src/main/scala/org/apache/kyuubi/package.scala
+++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/package.scala
@@ -53,6 +53,7 @@ package object kyuubi {
     val trino_version: String = props.getProperty("kyuubi_trino_version", unknown)
     val branch: String = props.getProperty("branch", unknown)
     val revision: String = props.getProperty("revision", unknown)
+    val revisionTime: String = props.getProperty("revision_time", unknown)
     val user: String = props.getProperty("user", unknown)
     val repoUrl: String = props.getProperty("url", unknown)
     val buildDate: String = props.getProperty("date", unknown)
@@ -68,6 +69,7 @@ package object kyuubi {
   val TRINO_COMPILE_VERSION: String = BuildInfo.trino_version
   val BRANCH: String = BuildInfo.branch
   val REVISION: String = BuildInfo.revision
+  val REVISION_TIME: String = BuildInfo.revisionTime
   val BUILD_USER: String = BuildInfo.user
   val REPO_URL: String = BuildInfo.repoUrl
   val BUILD_DATE: String = BuildInfo.buildDate
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala
index f75f299ae..5973fc6e7 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala
@@ -49,6 +49,7 @@ class UtilsSuite extends KyuubiFunSuite {
     assert(props.getProperty("kyuubi_trino_version") === TRINO_COMPILE_VERSION)
     assert(props.getProperty("branch") === BRANCH)
     assert(props.getProperty("revision") === REVISION)
+    assert(props.getProperty("revision_time") === REVISION_TIME)
     assert(props.getProperty("user") === BUILD_USER)
     assert(props.getProperty("url") === REPO_URL)
     assert(props.getProperty("date") === BUILD_DATE)
diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala
index 731ad5df6..fbdaf85cc 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala
@@ -82,7 +82,7 @@ object KyuubiServer extends Logging {
         |                /\___/
         |                \/__/
        """.stripMargin)
-    info(s"Version: $KYUUBI_VERSION, Revision: $REVISION, Branch: $BRANCH," +
+    info(s"Version: $KYUUBI_VERSION, Revision: $REVISION ($REVISION_TIME), Branch: $BRANCH," +
       s" Java: $JAVA_COMPILE_VERSION, Scala: $SCALA_COMPILE_VERSION," +
       s" Spark: $SPARK_COMPILE_VERSION, Hadoop: $HADOOP_COMPILE_VERSION," +
       s" Hive: $HIVE_COMPILE_VERSION, Flink: $FLINK_COMPILE_VERSION," +