You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/11/17 17:08:08 UTC

[GitHub] [pinot] klsince commented on a change in pull request #7782: expose API with git branch and commit info

klsince commented on a change in pull request #7782:
URL: https://github.com/apache/pinot/pull/7782#discussion_r751450700



##########
File path: pinot-common/src/main/java/org/apache/pinot/common/Utils.java
##########
@@ -145,4 +149,36 @@ public static void logVersions() {
 
     return componentVersions;
   }
+
+  public static String getGitInfo() {
+    // unless Utils was somehow loaded on the bootclasspath, this will not be null
+    // and will find all manifests
+    ClassLoader classLoader = Utils.class.getClassLoader();
+    if (classLoader != null) {
+      try {
+        Enumeration<URL> manifests = classLoader.getResources("META-INF/MANIFEST.MF");
+        while (manifests.hasMoreElements()) {
+          URL url = manifests.nextElement();
+          try (InputStream stream = url.openStream()) {
+            Manifest manifest = new Manifest(stream);
+            Attributes attributes = manifest.getMainAttributes();
+            if (attributes != null) {
+              String implementationTitle = attributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE);

Review comment:
       nit: leave a comment that those info are injected via configs in that pom.xml file




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org