Bug 1181573 - show description of the push when comparing two revisions

This commit is contained in:
Tiramisu 1993 2015-07-21 18:38:15 +08:00 коммит произвёл William Lachance
Родитель 3c45da855f
Коммит aba6e1dea4
6 изменённых файлов: 45 добавлений и 28 удалений

Просмотреть файл

@ -191,6 +191,7 @@ to { opacity: 0; }
.push-information {
font-size: 18px;
color: #777;
margin-left: -4px;
}
.vertical-box {

Просмотреть файл

@ -91,12 +91,12 @@ perf.controller('CompareResultsCtrl', [
$scope.testList = [];
$scope.platformList = [];
var timeRange = PhCompare.getInterval($scope.originalTimestamp, $scope.newTimestamp);
var resultSetIds = [$scope.originalResultSetID];
var timeRange = PhCompare.getInterval($scope.originalResultSet.push_timestamp, $scope.newResultSet.push_timestamp);
var resultSetIds = [$scope.originalResultSet.id];
// Optimization - if old/new branches are the same collect data in one pass
if (_.isEqual($scope.originalProject, $scope.newProject)) {
resultSetIds = [$scope.originalResultSetID, $scope.newResultSetID];
resultSetIds = [$scope.originalResultSet.id, $scope.newResultSet.id];
}
PhSeries.getSeriesSummaries(
@ -112,8 +112,8 @@ perf.controller('CompareResultsCtrl', [
timeRange,
resultSetIds);
}).then(function(resultMaps) {
var originalResultsMap = resultMaps[$scope.originalResultSetID];
var newResultsMap = resultMaps[$scope.newResultSetID];
var originalResultsMap = resultMaps[$scope.originalResultSet.id];
var newResultsMap = resultMaps[$scope.newResultSet.id];
// Optimization - we collected all data in a single pass
if (newResultsMap) {
@ -135,9 +135,9 @@ perf.controller('CompareResultsCtrl', [
return PhCompare.getResultsMap($scope.newProject.name,
newSeriesData.seriesList,
timeRange,
[$scope.newResultSetID]);
[$scope.newResultSet.id]);
}).then(function(resultMaps) {
var newResultsMap = resultMaps[$scope.newResultSetID];
var newResultsMap = resultMaps[$scope.newResultSet.id];
$scope.dataLoading = false;
displayResults(originalResultsMap, newResultsMap);
});
@ -199,11 +199,9 @@ perf.controller('CompareResultsCtrl', [
var resultSet = resultSets[0];
//TODO: this is a bit hacky to pass in 'original' as a text string
if (rsid == 'original') {
$scope.originalResultSetID = resultSet.id;
$scope.originalTimestamp = resultSet.push_timestamp;
$scope.originalResultSet = resultSet;
} else {
$scope.newResultSetID = resultSet.id;
$scope.newTimestamp = resultSet.push_timestamp;
$scope.newResultSet = resultSet;
}
}, function(error) {
$scope.errors.push(error);
@ -269,11 +267,9 @@ perf.controller('CompareSubtestResultsCtrl', [
var resultSet = resultSets[0];
//TODO: this is a bit hacky to pass in 'original' as a text string
if (rsid == 'original') {
$scope.originalResultSetID = resultSet.id;
$scope.originalTimestamp = resultSet.push_timestamp;
$scope.originalResultSet = resultSet;
} else {
$scope.newResultSetID = resultSet.id;
$scope.newTimestamp = resultSet.push_timestamp;
$scope.newResultSet = resultSet;
}
}, function(error) {
$scope.errors.push(error);
@ -369,12 +365,12 @@ perf.controller('CompareSubtestResultsCtrl', [
return;
}
var timeRange = PhCompare.getInterval($scope.originalTimestamp, $scope.newTimestamp);
var resultSetIds = [$scope.originalResultSetID];
var timeRange = PhCompare.getInterval($scope.originalResultSet.push_timestamp, $scope.newResultSet.push_timestamp);
var resultSetIds = [$scope.originalResultSet.id];
// Optimization - if old/new branches are the same collect data in one pass
if ($scope.originalProject == $scope.newProject) {
resultSetIds = [$scope.originalResultSetID, $scope.newResultSetID];
resultSetIds = [$scope.originalResultSet.id, $scope.newResultSet.id];
}
PhSeries.getSubtestSummaries(
@ -390,8 +386,8 @@ perf.controller('CompareSubtestResultsCtrl', [
timeRange,
resultSetIds);
}).then(function(seriesMaps) {
var originalSeriesMap = seriesMaps[$scope.originalResultSetID];
var newSeriesMap = seriesMaps[$scope.newResultSetID];
var originalSeriesMap = seriesMaps[$scope.originalResultSet.id];
var newSeriesMap = seriesMaps[$scope.newResultSet.id];
[originalSeriesMap, newSeriesMap].forEach(function (seriesMap) {
// If there is no data for a given signature, handle it gracefully
if (seriesMap) {

Просмотреть файл

@ -32,3 +32,19 @@ treeherder.directive(
}
};
});
treeherder.directive(
'revisionInformation', function() {
return {
restrict: 'E',
templateUrl: 'partials/perf/revisiondescribe.html',
scope: {
originalProject: '=',
originalRevision: '=',
newProject: '=',
newRevision: '=',
originalResultSet: '=',
newResultSet: '='
}
};
});

Просмотреть файл

@ -9,10 +9,7 @@
</div>
<div id="subtest-summary" ng-if="!dataLoading && !errors.length">
<h1>Perfherder Compare Revisions</h1>
<ul class="list-inline push-information">
<li><strong>Base</strong> - <a href="{{originalRevision|getRevisionUrl:originalProject.name}}">{{originalRevision}}</a> ({{originalProject.name}})</li>
<li><strong>New</strong> - <a href="{{newRevision|getRevisionUrl:newProject.name}}">{{newRevision}}</a> ({{newProject.name}})</li>
</ul>
<revision-information original-project="originalProject" original-revision="originalRevision" original-result-set="originalResultSet" new-project="newProject" new-revision="newRevision" new-result-set="newResultSet"></revision-information>
<div class="alert alert-warning" role="alert" ng-if="testNoResults">
<strong>tests with no results:</strong>
{{testNoResults}}

Просмотреть файл

@ -6,10 +6,7 @@
</div>
<div id="subtest-summary" ng-if="!dataLoading && !errors.length">
<h1>{{subtestTitle}} subtest summary</h1>
<ul class="list-inline push-information">
<li><strong>Base</strong> - <a href="{{originalRevision|getRevisionUrl:originalProject.name}}">{{originalRevision}}</a> ({{originalProject.name}})</li>
<li><strong>New</strong> - <a href="{{newRevision|getRevisionUrl:newProject.name}}">{{newRevision}}</a> ({{newProject.name}})</li>
</ul>
<revision-information original-project="originalProject" original-revision="originalRevision" original-result-set="originalResultSet" new-project="newProject" new-revision="newRevision" new-result-set="newResultSet"></revision-information>
<p><a href="perf.html#/compare?originalProject={{originalProject.name}}&originalRevision={{originalRevision}}&newProject={{newProject.name}}&newRevision={{newRevision}}">Show all tests and platforms</a></p>
<div id="error" ng-if="!dataLoading && errors.length" ng-repeat="error in errors">
<div>{{error}}</div>

Просмотреть файл

@ -0,0 +1,10 @@
<ul class="list-inline push-information">
<li>
<strong>Base</strong> - <a href="{{originalProject.getRevisionHref(originalRevision)}}">{{originalRevision}}</a> ({{originalProject.name}}) - {{originalResultSet.author}} -
<span>{{originalResultSet.comments}}</span>
</li>
<li>
<strong>New</strong> - <a href="{{newProject.getRevisionHref(originalRevision)}}">{{newRevision}}</a> ({{newProject.name}}) - {{newResultSet.author}} -
<span>{{newResultSet.comments}}</span>
</li>
</ul>