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

Bukama pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dist-tool.git


The following commit(s) were added to refs/heads/master by this push:
     new b6ed24e  Change broken images to unicode icons, fix build time (#192)
b6ed24e is described below

commit b6ed24ed3a3c4ad0e96bd5c5abf675f31aaf299f
Author: Matthias Bünger <[email protected]>
AuthorDate: Tue Jul 14 16:54:39 2026 +0200

    Change broken images to unicode icons, fix build time (#192)
    
    Change broken images to unicode icons, fix build time
    
    Change images to unicode icons to avoid missing images and CSP policy 
violations.
    Also fix build time
---
 pom.xml                                            |  1 +
 .../tools/jobs/master/ListMasterJobsReport.java    | 28 ++++++++++++++++++----
 src/site/resources/css/site.css                    |  3 +++
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 32b9bde..7452a76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -267,6 +267,7 @@
         <configuration>
           <excludes combine.children="append">
             <exclude>.repository/**</exclude>
+            <exclude>**/*.css</exclude>
             <!-- jenkins with local maven repository -->
             <exclude>src/test/resources/**/*.html</exclude>
             <exclude>**/*.svg</exclude>
diff --git 
a/src/main/java/org/apache/maven/dist/tools/jobs/master/ListMasterJobsReport.java
 
b/src/main/java/org/apache/maven/dist/tools/jobs/master/ListMasterJobsReport.java
index 92b9b17..e60fef6 100644
--- 
a/src/main/java/org/apache/maven/dist/tools/jobs/master/ListMasterJobsReport.java
+++ 
b/src/main/java/org/apache/maven/dist/tools/jobs/master/ListMasterJobsReport.java
@@ -18,6 +18,8 @@
  */
 package org.apache.maven.dist.tools.jobs.master;
 
+import java.time.Instant;
+import java.time.ZoneId;
 import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
@@ -79,7 +81,7 @@ public class ListMasterJobsReport extends AbstractJobsReport {
         List<Result> repoStatus = Flux.fromIterable(repositoryNames)
                 .flatMap(
                         repo -> JsonRetry.getAsync(MAVENBOX_JOBS_BASE_URL + 
repo
-                                        + 
"/api/json?tree=jobs[name,url,color,lastBuild[result,number]]")
+                                        + 
"/api/json?tree=jobs[name,url,color,lastBuild[result,number,timestamp]]")
                                 .flatMap(jsonNode -> buildResult(repo, 
jsonNode))
                                 .onErrorResume(e -> {
                                     getLog().warn("Failed to read status for " 
+ repo + " Jenkins job "
@@ -112,13 +114,29 @@ public class ListMasterJobsReport extends 
AbstractJobsReport {
                             + n.get("lastBuild").get("number").asText();
                     Result result = new Result(repository, buildUrl);
                     result.setStatus(status);
-                    // 
https://ci-maven.apache.org/static/67d6365a/images/24x24/blue.png
-                    result.setIcon("https://ci-maven.apache.org/static/48x48/";
-                            + n.get("color").asText().toLowerCase() + ".png");
+                    result.setIcon(retrieveIcon(status));
+
+                    long timestamp =
+                            lastBuild != null ? 
lastBuild.get("timestamp").asLong() : 0L;
+                    if (timestamp != 0L) {
+                        result.setLastBuild(
+                                
ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), 
ZoneId.systemDefault()));
+                    }
+
                     return result;
                 }));
     }
 
+    private String retrieveIcon(String status) {
+        return switch (status) {
+            case "FAILURE" -> "&#10060;"; // (red) CROSS MARK
+            case "SUCCESS" -> "&#9989;"; // (green) WHITE HEAVY CHECK MARK
+            case "UNKNOWN" -> "&#2754;"; // White Question Mark Ornament (same 
as default)
+            case "UNSTABLE" -> "&#9888;&#65039;"; // WARNING SIGN rendered as 
yellow
+            default -> "&#2754;"; // White Question Mark Ornament (same as 
Unknown)
+        };
+    }
+
     private void generateReport(List<Result> repoStatus) {
         Sink sink = getSink();
 
@@ -162,7 +180,7 @@ public class ListMasterJobsReport extends 
AbstractJobsReport {
         sink.rawText("<span");
         if ((r.getLastBuild() == null)
                 || 
r.getLastBuild().isBefore(ZonedDateTime.now().minusMonths(1))) {
-            sink.rawText(" style=\"color:red\"");
+            sink.rawText(" class=\"text-red\"");
         }
         sink.rawText(">("
                 + ((r.getLastBuild() == null) ? "-" : 
r.getLastBuild().format(DateTimeFormatter.ISO_LOCAL_DATE))
diff --git a/src/site/resources/css/site.css b/src/site/resources/css/site.css
new file mode 100644
index 0000000..f7d7a39
--- /dev/null
+++ b/src/site/resources/css/site.css
@@ -0,0 +1,3 @@
+.text-red {
+    color:red
+}

Reply via email to