The global comment is indeed overridden but variables are not available/evaluated.
My Template:
<#if qualityGate??>
## <@g gate=qualityGate/> The SonarQube analysis indicates that quality gate is <@s status=qualityGate.status/> <@g gate=qualityGate/>
<#list qualityGate.conditions() as condition>
<@c condition=condition/>
</#list>
</#if>
<#macro g gate><#if gate.status == OK>✔️<#else>❌</#if></#macro>
<#macro c condition>* [${condition.metricName}](${sonarUrl}component_measures?branch=${refName?url('ISO-8859-1')}&id=YOUR_PROJECT_ID&view=list&metric=${condition.metricKey}) <@s status=condition.status/>: Actual value ${condition.actual}<#if condition.status == WARN> is ${condition.symbol} ${condition.warning}</#if><#if condition.status == ERROR> is ${condition.symbol} ${condition.error}</#if> <@s_emoji status=condition.status/></#macro>
<#macro s status><#if status == OK>passed<#elseif status == WARN>warning<#elseif status == ERROR>failed<#else>unknown</#if></#macro>
<#macro s_emoji status><#if status == OK>✔️<#elseif status == WARN>⚠️<#elseif status == ERROR>❌<#else>❔</#if></#macro>
<#assign newIssueCount = issueCount() notReportedIssueCount = issueCount(false)>
<#assign hasInlineIssues = newIssueCount gt notReportedIssueCount extraIssuesTruncated = notReportedIssueCount gt maxGlobalIssues>
---
### Report [**is available here**](${sonarUrl}dashboard?branch=${refName?url('ISO-8859-1')}&id=YOUR_PROJECT_ID) for more details.
<#if newIssueCount == 0>
SonarQube analysis reported no issues ! 👏
<#else>
**SonarQube analysis reported ${newIssueCount} new issue<#if newIssueCount gt 1>s</#if>:**
<#assign newIssuesBlocker = issueCount(BLOCKER) newIssuesCritical = issueCount(CRITICAL) newIssuesMajor = issueCount(MAJOR) newIssuesMinor = issueCount(MINOR) newIssuesInfo = issueCount(INFO)>
<#if newIssuesBlocker gt 0>
* ${emojiSeverity(BLOCKER)} ${newIssuesBlocker} Blocker
</#if>
<#if newIssuesCritical gt 0>
* ${emojiSeverity(CRITICAL)} ${newIssuesCritical} Critical
</#if>
<#if newIssuesMajor gt 0>
* ${emojiSeverity(MAJOR)} ${newIssuesMajor} Major
</#if>
<#if newIssuesMinor gt 0>
* ${emojiSeverity(MINOR)} ${newIssuesMinor} Minor
</#if>
<#if newIssuesInfo gt 0>
* ${emojiSeverity(INFO)} ${newIssuesInfo} Info
</#if>
<#if !disableIssuesInline && hasInlineIssues>
Watch the comments in the merge request to review them.
</#if>
<#if notReportedIssueCount gt 0>
<#if !disableIssuesInline>
<#if hasInlineIssues || extraIssuesTruncated>
<#if notReportedIssueCount <= maxGlobalIssues>
#### ${notReportedIssueCount} extra issue<#if notReportedIssueCount gt 1>s</#if>
<#else>
#### Top ${maxGlobalIssues} extra issue<#if maxGlobalIssues gt 1>s</#if>
</#if>
</#if>
Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:
<#elseif extraIssuesTruncated>
#### Top ${maxGlobalIssues} issue<#if maxGlobalIssues gt 1>s</#if>
</#if>
<#assign reportedIssueCount = 0>
<#list issues(false) as issue>
<#if reportedIssueCount < maxGlobalIssues>
1. ${print(issue)}
</#if>
<#assign reportedIssueCount++>
</#list>
<#if notReportedIssueCount gt maxGlobalIssues>
* ... ${notReportedIssueCount-maxGlobalIssues} more
</#if>
</#if>
</#if>
The generated message:
## ✔️ The SonarQube analysis indicates that quality gate is passed ✔️
* [](component_measures?branch=develop&id=com.xxx.dsp.xxx.apps:cart-web&view=list&metric=) passed: Actual value ✔️
* [](component_measures?branch=develop&id=com.xxx.dsp.xxx.apps:cart-web&view=list&metric=) passed: Actual value ✔️
* [](component_measures?branch=develop&id=com.xxx.dsp.xxx.apps:cart-web&view=list&metric=) passed: Actual value ✔️
---
### Report [**is available here**](dashboard?branch=develop&id=com.xxx.dsp.xxx.apps:cart-web) for more details.
SonarQube analysis reported no issues ! 👏
Hello,
Use versions:
I would like to override the default template when using _sonarscanner. I succeed to do it with maven by using this command for java projects:
For Angular projets I use this command:
The global comment is indeed overridden but variables are not available/evaluated. My Template:
The generated message:
Have you any idea please ?