Skip to content

Commit

Permalink
Bug 1168453 - Switch default branches for perfherder
Browse files Browse the repository at this point in the history
* Graphs: Defaults to m-i
* Compare: Defaults to m-i for base, try for new
  • Loading branch information
TheTeraByte authored and wlach committed Jul 31, 2015
1 parent 47d4e81 commit 414e9df
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
24 changes: 19 additions & 5 deletions ui/js/compareperf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@

perf.controller('CompareChooserCtrl', [
'$state', '$stateParams', '$scope', 'ThRepositoryModel', 'ThResultSetModel',
'phCompareDefaultNewRepo', 'phCompareDefaultOriginalRepo',
function CompareChooserCtrl($state, $stateParams, $scope,
ThRepositoryModel, ThResultSetModel) {
ThRepositoryModel, ThResultSetModel,
phCompareDefaultNewRepo,
phCompareDefaultOriginalRepo) {
ThRepositoryModel.get_list().success(function(projects) {
$scope.projects = projects;
$scope.originalTipList = [];
$scope.newTipList = [];
$scope.originalProject = _.findWhere(projects, { name: $stateParams.originalProject }) || projects[0];
$scope.newProject = _.findWhere(projects, { name: $stateParams.newProject }) || projects[0];
$scope.originalRevision = $stateParams.originalRevision ? $stateParams.originalRevision : '';
$scope.newRevision = $stateParams.newRevision ? $stateParams.newRevision : '';

$scope.originalProject = _.findWhere(projects, {
name: ($stateParams.originalProject ?
$stateParams.originalProject : phCompareDefaultOriginalRepo)
}) || projects[0];
$scope.newProject = _.findWhere(projects, {
name: ($stateParams.newProject ?
$stateParams.newProject : phCompareDefaultNewRepo)
}) || projects[0];

$scope.originalRevision = ($stateParams.originalRevision ?
$stateParams.originalRevision : '');
$scope.newRevision = ($stateParams.newRevision ?
$stateParams.newRevision : '');

var getRevisionTips = function(projectName, list) {
// due to we push the revision data into list,
// so we need clear the data before we push new data into it.
Expand Down
13 changes: 6 additions & 7 deletions ui/js/graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,15 +729,14 @@ perf.controller('GraphsCtrl', [
perf.controller('TestChooserCtrl', function($scope, $modalInstance, $http,
projects, optionCollectionMap,
timeRange, thServiceDomain,
PhSeries, defaultProjectName,
defaultPlatform, testsDisplayed) {
thDefaultRepo, PhSeries,
defaultProjectName, defaultPlatform,
testsDisplayed) {
$scope.timeRange = timeRange;
$scope.projects = projects;
if (defaultProjectName) {
$scope.selectedProject = _.findWhere(projects, {name: defaultProjectName});
} else {
$scope.selectedProject = projects[0];
}
$scope.selectedProject = _.findWhere(projects, {
name: defaultProjectName ? defaultProjectName : thDefaultRepo
});
$scope.loadingTestData = false;

var series = [];
Expand Down
4 changes: 4 additions & 0 deletions ui/js/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ treeherder.value("thDefaultRepo", "mozilla-inbound");

treeherder.value("thDateFormat", "EEE MMM d, H:mm:ss");

treeherder.value("phCompareDefaultOriginalRepo", "mozilla-inbound");

treeherder.value("phCompareDefaultNewRepo", "try");

treeherder.value("phTimeRanges", [
{ "value":86400, "text": "Last day" },
{ "value":604800, "text": "Last 7 days" },
Expand Down

0 comments on commit 414e9df

Please sign in to comment.