Skip to content

Commit

Permalink
Show build event (buildState) in admin log.
Browse files Browse the repository at this point in the history
  • Loading branch information
netwolfuk committed Nov 30, 2017
1 parent 366eaad commit a600a99
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import lombok.Data;
import lombok.NoArgsConstructor;
import webhook.teamcity.BuildStateEnum;

@Data @NoArgsConstructor
public class WebHookExecutionStats {
Expand All @@ -25,6 +26,7 @@ public class WebHookExecutionStats {
Header[] responseHeaders;
boolean errored = false;
boolean enabled = true;
BuildStateEnum buildState;

public WebHookExecutionStats(String url) {
this.url = url;
Expand Down
1 change: 1 addition & 0 deletions tcwebhooks-core/src/main/java/webhook/WebHookImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public void setEnabled(Boolean enabled) {
@Override
public void setEnabledForBuildState(BuildStateEnum buildState, boolean enabled) {
this.setEnabled(enabled);
this.getExecutionStats().setBuildState(buildState);
if (!enabled) {
this.getExecutionStats().setStatusReason("WebHook not enabled for buildState '" + buildState.getShortName() + "'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
<h2 class="noBorder">Recent WebHook Errors</h2>
The following table shows the 20 most recent webhook errors.
<table class="settings">
<tr><th colspan="1" style="text-align: left;padding:0.5em;">Date</th><th>URL</th><th>Error</th></tr>
<tr><th colspan="1" style="text-align: left;padding:0.5em;">Date</th><th>URL</th><th>Build Event</th><th>Error</th></tr>
<c:forEach items="${history}" var="historyItem">
<tr>
<td>${historyItem.webHookExecutionStats.initTimeStamp}</td>
<td>${historyItem.webHookExecutionStats.url}</td>
<td><c:out value="${historyItem.webHookExecutionStats.buildState.shortDescription}">undefined</c:out></td>
<td title="x-tcwebhooks-request-id: ${historyItem.webHookExecutionStats.trackingId}">${historyItem.webHookExecutionStats.statusCode} :: ${historyItem.webHookExecutionStats.statusReason}</td>
</tr>

Expand Down

0 comments on commit a600a99

Please sign in to comment.