Skip to content

Commit

Permalink
Include warnings-ng reports in templates (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
strangelookingnerd authored Jan 16, 2024
1 parent 4e04aa4 commit 258cb56
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
.test-failed {
color: #E74C3C;
}
.td-title-issues {
font-weight: bold;
font-size: 120%;
}
</STYLE>
<BODY>
<!-- BUILD RESULT -->
Expand Down Expand Up @@ -236,6 +240,40 @@
<br/>
<% } %>

<!-- WARNINGS-NG REPORT -->
<%
try {
def aggregationAction = it.getAction("io.jenkins.plugins.analysis.core.model.AggregationAction")
if ( aggregationAction != null ) { %>
<table class="section">
<tr class="tr-title">
<td class="td-title" colspan="5">${hudson.Util.xmlEscape(aggregationAction.getDisplayName())}</td>
</tr>
<tr>
<td class="td-title-issues">Tool</td>
<td class="td-title-issues">Low</td>
<td class="td-title-issues">Normal</td>
<td class="td-title-issues">High</td>
<td class="td-title-issues">Error</td>
</tr>
<% aggregationAction.getTools().each {
tool -> %>
<tr>
<td><a href="${tool.getLatestUrl()}">${hudson.Util.xmlEscape(tool.getName())}</a></td>
<td>${tool.getLowSize()}</td>
<td>${tool.getNormalSize()}</td>
<td>${tool.getHighSize()}</td>
<td>${tool.getErrorSize()}</td>
</tr>
<% } %>
</table>
<br/>
<%
}
} catch(e) {
// we don't do anything
} %>

<!-- CONSOLE OUTPUT -->
<%
if ( build.result == hudson.model.Result.FAILURE ) { %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ CHANGE SET
<% }
} %>

<%
try {
def aggregationAction = it.getAction("io.jenkins.plugins.analysis.core.model.AggregationAction")
if ( aggregationAction != null ) { %>
${aggregationAction.getDisplayName().toUpperCase()}
<% aggregationAction.getTools().each {
tool -> %>
Tool: ${tool.getName()}
Report: ${tool.getLatestUrl()}
Low: ${tool.getLowSize()}, Normal: ${tool.getNormalSize()}, High: ${tool.getHighSize()}, Error: ${tool.getErrorSize()}
<% }
}
} catch(e) {
// we don't do anything
} %>

<% if(build.result==hudson.model.Result.FAILURE) { %>
CONSOLE OUTPUT
Expand Down
25 changes: 25 additions & 0 deletions src/main/resources/hudson/plugins/emailext/templates/html.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,31 @@ TD.console { font-family:Courier New; }
<BR/>
</j:if>

<!-- WARNINGS-NG REPORT -->

<j:set var="aggregationAction" value="${it.getAction('io.jenkins.plugins.analysis.core.model.AggregationAction')}" />
<j:if test="${aggregationAction!=null}">
<table width="100%">
<tr><td class="bg1" colspan="5"><b>${aggregationAction.getDisplayName()}</b></td></tr>
<tr>
<td class="bg2">Tool</td>
<td class="bg2">Low</td>
<td class="bg2">Normal</td>
<td class="bg2">High</td>
<td class="bg2">Error</td>
</tr>
<j:forEach var="tool" items="${aggregationAction.getTools()}">
<tr>
<td><a href="${tool.getLatestUrl()}">${tool.getName()}</a></td>
<td>${tool.getLowSize()}</td>
<td>${tool.getNormalSize()}</td>
<td>${tool.getHighSize()}</td>
<td>${tool.getErrorSize()}</td>
</tr>
</j:forEach>
</table>
<br/>
</j:if>

<!-- CONSOLE OUTPUT -->

Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/hudson/plugins/emailext/templates/text.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,15 @@ By packages
</j:if>
</j:if>

<!-- WARNINGS-NG REPORT -->
<j:set var="aggregationAction" value="${it.getAction('io.jenkins.plugins.analysis.core.model.AggregationAction')}" />
<j:if test="${aggregationAction!=null}">
<j:whitespace>${aggregationAction.getDisplayName().toUpperCase()}&#10;</j:whitespace>
<j:forEach var="tool" items="${aggregationAction.getTools()}">
<j:whitespace>Tool: ${tool.getName()}&#10;</j:whitespace>
<j:whitespace>Report: ${tool.getLatestUrl()}&#10;</j:whitespace>
<j:whitespace>Low: ${tool.getLowSize()}, Normal: ${tool.getNormalSize()}, High: ${tool.getHighSize()}, Error: ${tool.getErrorSize()}&#10;</j:whitespace>
<j:whitespace>&#10;</j:whitespace>
</j:forEach>
</j:if>
</j:jelly>

0 comments on commit 258cb56

Please sign in to comment.