Skip to content

Commit aba973e

Browse files
committed
Add build failure reasons to monitoring and overview pages
1 parent d264ce4 commit aba973e

File tree

3 files changed

+19
-27
lines changed

3 files changed

+19
-27
lines changed

app/views/_triggers.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
</div>
2020
<div class="build-phase">
2121
<status-icon status="build.status.phase"></status-icon>
22-
{{build.status.phase}}<span ng-if="(build | isIncompleteBuild) && trigger.imageChangeParams.automatic">. A new deployment will be created automatically once the build completes.</span>
22+
<span ng-if="!build.status.message || build.status.phase === 'Cancelled'">{{build.status.phase}}.</span>
23+
<span ng-if="build.status.message && build.status.phase !== 'Cancelled'">{{build.status.message}}.</span>
24+
<span ng-if="(build | isIncompleteBuild) && trigger.imageChangeParams.automatic">A new deployment will be created automatically once the build completes.</span>
2325
</div>
2426
<span am-time-ago="build.metadata.creationTimestamp" class="build-timestamp"></span>
2527
<div ng-if="'builds/log' | canI : 'get'" class="build-links">
+11-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<status-icon status="build.status.phase" disable-animation fixed-width="true"></status-icon>
2-
{{build.status.phase | sentenceCase}}
3-
<span ng-switch="build.status.phase" class="hide-ng-leave">
4-
<span ng-switch-when="Complete"> in {{(build.status.startTimestamp || build.metadata.creationTimestamp) | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>
5-
<span ng-switch-when="Failed">after <span ng-if="!build.status.startTimestamp">waiting </span>{{(build.status.startTimestamp || build.metadata.creationTimestamp) | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>
6-
<span ng-switch-when="Cancelled"> after {{(build.status.startTimestamp || build.metadata.creationTimestamp) | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>
7-
<span ng-switch-when="Running"> for <time-only-duration-until-now timestamp="build.status.startTimestamp" time-only></time-only-duration-until-now></span>
8-
<span ng-switch-when="New">, waiting for <time-only-duration-until-now timestamp="build.metadata.creationTimestamp"></time-only-duration-until-now></span>
9-
<span ng-switch-when="Pending"> for <time-only-duration-until-now timestamp="build.metadata.creationTimestamp"></time-only-duration-until-now></span>
10-
<span ng-switch-default>
11-
<span ng-if="build.status.startTimestamp">, finished in {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>
12-
<span ng-if="!build.status.startTimestamp">, waited for {{build.metadata.creationTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>
13-
</span>
14-
</span>
2+
<span ng-if="!build.status.reason || build.status.phase === 'Cancelled'">{{build.status.phase}}</span>
3+
<span ng-if="build.status.reason && build.status.phase !== 'Cancelled'">{{build.status.reason | sentenceCase}}</span><span
4+
ng-switch="build.status.phase" class="hide-ng-leave" ng-if="build.status.startTimestamp"><span
5+
ng-switch-when="Complete">, ran for {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span><span
6+
ng-switch-when="Failed">, ran for {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span><span
7+
ng-switch-when="Cancelled"> after {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span><span
8+
ng-switch-when="Running"> for <time-only-duration-until-now timestamp="build.status.startTimestamp" time-only></time-only-duration-until-now></span><span
9+
ng-switch-when="New"></span><span
10+
ng-switch-when="Pending"></span><span
11+
ng-switch-default>, ran for {{build.status.startTimestamp | duration : build.status.completionTimestamp}}</span>
12+
</span>

dist/scripts/templates.js

+5-13
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
745745
"</div>\n" +
746746
"<div class=\"build-phase\">\n" +
747747
"<status-icon status=\"build.status.phase\"></status-icon>\n" +
748-
"{{build.status.phase}}<span ng-if=\"(build | isIncompleteBuild) && trigger.imageChangeParams.automatic\">. A new deployment will be created automatically once the build completes.</span>\n" +
748+
"<span ng-if=\"!build.status.message || build.status.phase === 'Cancelled'\">{{build.status.phase}}.</span>\n" +
749+
"<span ng-if=\"build.status.message && build.status.phase !== 'Cancelled'\">{{build.status.message}}.</span>\n" +
750+
"<span ng-if=\"(build | isIncompleteBuild) && trigger.imageChangeParams.automatic\">A new deployment will be created automatically once the build completes.</span>\n" +
749751
"</div>\n" +
750752
"<span am-time-ago=\"build.metadata.creationTimestamp\" class=\"build-timestamp\"></span>\n" +
751753
"<div ng-if=\"'builds/log' | canI : 'get'\" class=\"build-links\">\n" +
@@ -5635,18 +5637,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
56355637

56365638
$templateCache.put('views/directives/build-status.html',
56375639
"<status-icon status=\"build.status.phase\" disable-animation fixed-width=\"true\"></status-icon>\n" +
5638-
"{{build.status.phase | sentenceCase}}\n" +
5639-
"<span ng-switch=\"build.status.phase\" class=\"hide-ng-leave\">\n" +
5640-
"<span ng-switch-when=\"Complete\"> in {{(build.status.startTimestamp || build.metadata.creationTimestamp) | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>\n" +
5641-
"<span ng-switch-when=\"Failed\">after <span ng-if=\"!build.status.startTimestamp\">waiting </span>{{(build.status.startTimestamp || build.metadata.creationTimestamp) | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>\n" +
5642-
"<span ng-switch-when=\"Cancelled\"> after {{(build.status.startTimestamp || build.metadata.creationTimestamp) | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>\n" +
5643-
"<span ng-switch-when=\"Running\"> for <time-only-duration-until-now timestamp=\"build.status.startTimestamp\" time-only></time-only-duration-until-now></span>\n" +
5644-
"<span ng-switch-when=\"New\">, waiting for <time-only-duration-until-now timestamp=\"build.metadata.creationTimestamp\"></time-only-duration-until-now></span>\n" +
5645-
"<span ng-switch-when=\"Pending\"> for <time-only-duration-until-now timestamp=\"build.metadata.creationTimestamp\"></time-only-duration-until-now></span>\n" +
5646-
"<span ng-switch-default>\n" +
5647-
"<span ng-if=\"build.status.startTimestamp\">, finished in {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>\n" +
5648-
"<span ng-if=\"!build.status.startTimestamp\">, waited for {{build.metadata.creationTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span>\n" +
5649-
"</span>\n" +
5640+
"<span ng-if=\"!build.status.reason || build.status.phase === 'Cancelled'\">{{build.status.phase}}</span>\n" +
5641+
"<span ng-if=\"build.status.reason && build.status.phase !== 'Cancelled'\">{{build.status.reason | sentenceCase}}</span><span ng-switch=\"build.status.phase\" class=\"hide-ng-leave\" ng-if=\"build.status.startTimestamp\"><span ng-switch-when=\"Complete\">, ran for {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span><span ng-switch-when=\"Failed\">, ran for {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span><span ng-switch-when=\"Cancelled\"> after {{build.status.startTimestamp | timeOnlyDurationFromTimestamps : build.status.completionTimestamp}}</span><span ng-switch-when=\"Running\"> for <time-only-duration-until-now timestamp=\"build.status.startTimestamp\" time-only></time-only-duration-until-now></span><span ng-switch-when=\"New\"></span><span ng-switch-when=\"Pending\"></span><span ng-switch-default>, ran for {{build.status.startTimestamp | duration : build.status.completionTimestamp}}</span>\n" +
56505642
"</span>"
56515643
);
56525644

0 commit comments

Comments
 (0)