Skip to content

Commit

Permalink
Bug 1245760 - Display the failed buildbot step in the log summary pan…
Browse files Browse the repository at this point in the history
…e if nothing else.
  • Loading branch information
martiansideofthemoon committed Mar 30, 2016
1 parent d3af720 commit 71f7872
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
22 changes: 18 additions & 4 deletions ui/plugins/failure_summary/controller.js
@@ -1,9 +1,9 @@
"use strict";

treeherder.controller('BugsPluginCtrl', [
'$scope', 'ThLog', 'ThJobArtifactModel','$q', 'thTabs', '$timeout',
'$scope', 'ThLog', 'ThJobArtifactModel','$q', 'thTabs', '$timeout', 'thUrl',
function BugsPluginCtrl(
$scope, ThLog, ThJobArtifactModel, $q, thTabs, $timeout) {
$scope, ThLog, ThJobArtifactModel, $q, thTabs, $timeout, thUrl) {

var $log = new ThLog(this.constructor.name);

Expand Down Expand Up @@ -33,7 +33,7 @@ treeherder.controller('BugsPluginCtrl', [
requestPromise = $q.defer();

ThJobArtifactModel.get_list({
name: "Bug suggestions",
name__in: "Bug suggestions,text_log_summary",
"type": "json",
job_id: newValue
}, {timeout: requestPromise})
Expand All @@ -42,7 +42,7 @@ treeherder.controller('BugsPluginCtrl', [
// dirty check for every element pushed
var suggestions = [];
if(artifact_list.length > 0){
var artifact = artifact_list[0];
var artifact = _.find(artifact_list, {"name": "Bug suggestions"});
angular.forEach(artifact.blob, function (suggestion) {
suggestion.bugs.too_many_open_recent = (
suggestion.bugs.open_recent.length > bug_limit
Expand All @@ -63,7 +63,21 @@ treeherder.controller('BugsPluginCtrl', [
);
suggestions.push(suggestion);
});
var errors = [];
if (suggestions.length === 0 && artifact_list.length > 1) {
artifact = _.find(artifact_list, {"name": "text_log_summary"});
angular.forEach(artifact.blob.step_data.steps, function(step) {
if (step.result !== "success") {
errors.push({
"name": step.name,
"result": step.result,
"lvURL": thUrl.getLogViewerUrl(artifact.job_id) + "#L" + step.finished_linenumber
});
}
});
}
$scope.suggestions = suggestions;
$scope.errors = errors;
$scope.bugSuggestionsLoaded = true;
} else if ($scope.selectedJob && $scope.logParseStatus === "parsed") {
$scope.bugSuggestionsLoaded = false;
Expand Down
20 changes: 19 additions & 1 deletion ui/plugins/failure_summary/main.html
Expand Up @@ -63,7 +63,25 @@

</li>

<li ng-if="!tabs.failureSummary.is_loading && jobLogsAllParsed && bugSuggestionsLoaded && job_log_urls.length && suggestions.length == 0">
<li>
<span ng-if="errors.length > 0">
<div>
<span>No Bug Suggestions Available.</span>
</div>
<span><b>Unsuccessful Execution Steps</b></span>
<li ng-repeat="error in errors">
<ul>
<li>{{error.name}} : {{error.result}}.
<a title="Open in Log Viewer"
target="_blank"
href="{{error.lvURL}}">View log</a>
</li>
</ul>
</li>
</span>
</li>

<li ng-if="!tabs.failureSummary.is_loading && jobLogsAllParsed && bugSuggestionsLoaded && job_log_urls.length && suggestions.length == 0 && errors.length == 0">
<div class="failure-summary-line-empty">
<span>Failure summary is empty</span>
</div>
Expand Down

0 comments on commit 71f7872

Please sign in to comment.