[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging-4.19] automation/eclair: Make report browsing URL configurable.



commit 55ed136a54eaf0e1ea6711b76776738f439a5875
Author:     Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
AuthorDate: Mon Jul 7 17:28:26 2025 +0200
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Oct 27 14:37:06 2025 +0000

    automation/eclair: Make report browsing URL configurable.
    
    Currently, the URL where the ECLAIR MISRA C scan reports are saved
    is hardcoded; making it configurable allows multiple runners and storage
    servers to be used without resorting to publishing all artifacts
    to the same report server.
    
    Additionally, reports will be accessed publicly by using a proxy,
    therefore the address that needs to be printed in GitLab analysis logs
    is that of the public url, rather than the location where they are stored.
    
    Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
    [stefano: remove unneeded exports]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    (cherry picked from commit bea38de1bdda68bbcc2a865f1bcd5bce8e2a521e)
---
 automation/eclair_analysis/ECLAIR/action.helpers  | 10 ++++----
 automation/eclair_analysis/ECLAIR/action.settings | 30 +++++++++++++++++------
 automation/gitlab-ci/analyze.yaml                 |  1 +
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/action.helpers 
b/automation/eclair_analysis/ECLAIR/action.helpers
index 9d4ae1f979..3a4c9d2b28 100644
--- a/automation/eclair_analysis/ECLAIR/action.helpers
+++ b/automation/eclair_analysis/ECLAIR/action.helpers
@@ -58,7 +58,7 @@ summary() {
         ;;
     esac
 
-    
currentDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
+    
currentDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/PROJECT.ecd;/by_service.html#service&kind"
     if [ -z "${newReports}" ]; then
         fixedMsg="No fixed reports as there is no baseline"
         unfixedMsg="Unfixed reports: ${unfixedReports}"
@@ -69,11 +69,11 @@ summary() {
         unfixedMsg="Unfixed reports: ${unfixedReports} [new: ${newReports}]"
         case "${event}" in
         pull_request | auto_pull_request)
-            
referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
+            
referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/base/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=base
             ;;
         push)
-            
referenceDbReportsUrl="${eclairReportUrlPrefix}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
+            
referenceDbReportsUrl="${eclairResultsUrl}/fs${jobDir}/prev/PROJECT.ecd;/by_service.html#service&kind"
             reference_kind=previous
             ;;
         *)
@@ -92,7 +92,7 @@ summary() {
 ${fixedMsg}${eol}
 ${unfixedMsg}                                                                  
            ${eol}
 <a href="https://www.bugseng.com/eclair";>
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 <h3>${jobHeadline}</h3>
 <a href="${indexHtmlUrl}">Browse analysis summary</a>
@@ -106,7 +106,7 @@ EOF
         fi
         cat <<EOF >"${summaryTxt}"
 <a href="https://www.bugseng.com/eclair";>
-  <img src="${eclairReportUrlPrefix}/rsrc/eclair.svg" width="100" />
+  <img src="${eclairResultsUrl}/rsrc/eclair.svg" width="100" />
 </a>
 Analysis Summary
 
diff --git a/automation/eclair_analysis/ECLAIR/action.settings 
b/automation/eclair_analysis/ECLAIR/action.settings
index 1577368b61..a990437725 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -14,9 +14,6 @@ autoPRRepository="${AUTO_PR_REPOSITORY:-}"
 # Customized
 autoPRBranch="${AUTO_PR_BRANCH:-}"
 
-# Customized
-artifactsRoot=/var/local/eclair
-
 case "${ci}" in
 github)
     # To be customized
@@ -166,16 +163,35 @@ esac
 
 ECLAIR_BIN_DIR=/opt/bugseng/eclair/bin/
 
-artifactsDir="${artifactsRoot}/xen-project.ecdf/${repository}/ECLAIR_${ANALYSIS_KIND}"
+# Artifacts URL served by the eclair_report server
+if [ -z "${ECLAIR_ECDF_DIR}" ]
+then
+  echo "WARNING: No ecdf dir supplied, using default"
+fi
+artifactsEcdfDir="${ECLAIR_ECDF_DIR:-/var/local/eclair/xen-project.ecdf}"
+artifactsDir="${artifactsEcdfDir}/${repository}/ECLAIR_${ANALYSIS_KIND}"
 subDir="${subDir}${variantSubDir}"
 jobHeadline="${jobHeadline}${variantHeadline}"
 
-# Customized
-eclairReportUrlPrefix=https://saas.eclairit.com:3787
+# Remote eclair_report hosting server
+if [ -z "${ECLAIR_REPORT_HOST}" ]
+then
+  echo "WARNING: No eclair_report host supplied, using default"
+fi
+
+# URL to browse eclair reports
+if [ -z "${ECLAIR_ANALYSIS_RESULTS}" ]
+then
+  echo "WARNING: No URL to browse analysis results is set, using default"
+fi
+
+eclairReportHost="${ECLAIR_REPORT_HOST:-saas.eclairit.com:3787}"
+eclairReportUrlPrefix="https://${eclairReportHost}";
+eclairResultsUrl="${ECLAIR_ANALYSIS_RESULTS:-${eclairReportUrlPrefix}}"
 
 jobDir="${artifactsDir}/${subDir}/${jobId}"
 updateLog="${analysisOutputDir}/update.log"
 cleanRegressionsLog="${analysisOutputDir}/clean_regressions.log"
 commentLog="${analysisOutputDir}/comment.json"
-indexHtmlUrl="${eclairReportUrlPrefix}/fs${jobDir}/index.html"
+indexHtmlUrl="${eclairResultsUrl}/fs${jobDir}/index.html"
 summaryTxt="${analysisOutputDir}/summary.txt"
diff --git a/automation/gitlab-ci/analyze.yaml 
b/automation/gitlab-ci/analyze.yaml
index 02e0ea692c..2d7062671f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,6 +8,7 @@
     ENABLE_ECLAIR_BOT: "n"
     AUTO_PR_BRANCH: "staging"
     AUTO_PR_REPOSITORY: "xen-project/xen"
+    ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org";
   script:
     - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
   artifacts:
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.