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@bugseng.com>
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
[stefano: remove unneeded exports]
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
Nicola Vetrini authored and Stefano Stabellini committed 2025-07-11 16:58:34 -07:00
1 parent 163c6b5898
commit bea38de1bd
3 files changed
+29 -12

No files matched your search

@@ -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
@@ -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"
+1
View File
@@ -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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.