You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2024/02/16 20:27:33 UTC

(solr) branch main updated: Build: ge.gradle add tags (#2264)

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

dsmiley pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 200c9bf325c Build: ge.gradle add tags (#2264)
200c9bf325c is described below

commit 200c9bf325c3526decc1036d2ab9b948e0e6a896
Author: David Smiley <ds...@apache.org>
AuthorDate: Fri Feb 16 15:27:28 2024 -0500

    Build: ge.gradle add tags (#2264)
    
    Add tags to make key information more easily noticed and filterable on ge.apache.org
---
 gradle/ge.gradle | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/gradle/ge.gradle b/gradle/ge.gradle
index c718d41af81..a37660edde6 100644
--- a/gradle/ge.gradle
+++ b/gradle/ge.gradle
@@ -15,10 +15,14 @@
  * limitations under the License.
  */
 
-def isCIBuild = System.getenv().keySet().find { it ==~ /(?i)((JENKINS|HUDSON)(_\w+)?|CI)/ } != null
+// see globals.gradle
+def isCIBuild = System.getenv().keySet().any { it ==~ /(?i)((JENKINS|HUDSON)(_\w+)?|CI)/ }
+
+// https://docs.gradle.com/enterprise/gradle-plugin/
 
 gradleEnterprise {
     server = "https://ge.apache.org"
+
     buildScan {
         capture { taskInputFiles = true }
         uploadInBackground = !isCIBuild
@@ -27,6 +31,25 @@ gradleEnterprise {
         obfuscation {
             ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0"} }
         }
+
+        tag("JDK" + System.getProperty("java.version").find(/\d+/)) // major version
+        value("Java Vendor", System.getProperty("java.vendor"))
+        value("Java Version", System.getProperty("java.version"))
+
+        // Jenkins job name, less redundant "Solr" parts
+        String jenkinsJobName = System.getenv("JOB_NAME")
+        if (jenkinsJobName) { // looks like "Solr/Solr-Smoketest-9.5"
+            tag(jenkinsJobName.replaceAll(/Solr\W/,"")) // like "Smoketest-9.5"
+        }
+
+        // https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
+        if (System.getenv("GITHUB_BASE_REF")) { // only exists for PRs
+            tag("PR")
+        }
+        String ghWorkflowName = System.getenv("GITHUB_WORKFLOW")
+        if (ghWorkflowName) {
+            tag(ghWorkflowName)
+        }
     }
 }