.../eclair_analysis/ECLAIR/action.helpers | 10 +++---- .../eclair_analysis/ECLAIR/action.settings | 30 ++++++++++++++----- automation/gitlab-ci/analyze.yaml | 3 ++ 3 files changed, 31 insertions(+), 12 deletions(-)
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>
---
Changes in V2:
- Use single variable for eclair_report host and port
- Introduced variable in analyze.yaml for the public url used in logs
This needs to be committed in coordination with setting up the proxy
indicated in analyze.yaml
---
.../eclair_analysis/ECLAIR/action.helpers | 10 +++----
.../eclair_analysis/ECLAIR/action.settings | 30 ++++++++++++++-----
automation/gitlab-ci/analyze.yaml | 3 ++
3 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/automation/eclair_analysis/ECLAIR/action.helpers b/automation/eclair_analysis/ECLAIR/action.helpers
index 9d4ae1f979f6..3a4c9d2b2855 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 1577368b613b..a9904377252a 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 5b00b9f25ca6..9cec0f65a439 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -8,7 +8,10 @@
ENABLE_ECLAIR_BOT: "n"
AUTO_PR_BRANCH: "staging"
AUTO_PR_REPOSITORY: "xen-project/xen"
+ ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
script:
+ - export ECLAIR_ECDF_DIR
+ - export ECLAIR_REPORT_HOST
- ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
artifacts:
when: always
--
2.43.0
On Mon, Jul 07, 2025 at 05:28:26PM +0200, Nicola Vetrini wrote:
> diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
> index 5b00b9f25ca6..9cec0f65a439 100644
> --- a/automation/gitlab-ci/analyze.yaml
> +++ b/automation/gitlab-ci/analyze.yaml
> @@ -8,7 +8,10 @@
> ENABLE_ECLAIR_BOT: "n"
> AUTO_PR_BRANCH: "staging"
> AUTO_PR_REPOSITORY: "xen-project/xen"
> + ECLAIR_ANALYSIS_RESULTS: "https://eclair-analysis-logs.xenproject.org"
> script:
> + - export ECLAIR_ECDF_DIR
> + - export ECLAIR_REPORT_HOST
I don't think these two "export" do anything useful, unless for some
reason there's a "before_script" in yamls that set those two variables
without exporting them. Otherwise, those two are expected to be CI
variables, so they should already be in the environment, so no need to
export them again.
> - ./automation/scripts/eclair 2>&1 | tee "${LOGFILE}"
> artifacts:
> when: always
Beside this one comment, the patch looks good to me:
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Thanks,
--
Anthony PERARD
© 2016 - 2025 Red Hat, Inc.