Bug 1066377 - Change how try repos are identified

This commit is contained in:
Wes Kocher 2017-05-01 16:48:00 -07:00 коммит произвёл KWierso
Родитель 084dec8c36
Коммит a4a65ed594
5 изменённых файлов: 25 добавлений и 4 удалений

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

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-09 18:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('model', '0008_push_job_child_references'),
]
operations = [
migrations.AddField(
model_name='repository',
name='is_try_repo',
field=models.BooleanField(default=False),
),
]

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

@ -90,6 +90,7 @@ class Repository(models.Model):
active_status = models.CharField(max_length=7, blank=True, default='active', db_index=True)
performance_alerts_enabled = models.BooleanField(default=False)
expire_performance_data = models.BooleanField(default=True)
is_try_repo = models.BooleanField(default=False)
class Meta:
db_table = 'repository'

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

@ -27,7 +27,7 @@
<span class="result-set-buttons">
<button class="btn btn-sm btn-resultset cancel-all-jobs-btn"
ng-attr-title="{{getCancelJobsTitle()}}"
ng-show="currentRepo.repository_group.name == 'try' || user.is_staff"
ng-show="currentRepo.is_try_repo || user.is_staff"
data-ignore-job-clear-on-click
ng-disabled="!canCancelJobs()"
ng-click="confirmCancelAllJobs()">

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

@ -443,7 +443,7 @@ treeherder.controller('PluginCtrl', [
// Can we backfill? At the moment, this only ensures we're not in a 'try' repo.
$scope.canBackfill = function() {
return $scope.user.loggedin && $scope.currentRepo &&
$scope.currentRepo.repository_group.name !== 'try';
!$scope.currentRepo.is_try_repo;
};
$scope.backfillButtonTitle = function() {
@ -459,7 +459,7 @@ treeherder.controller('PluginCtrl', [
title = title.concat("must be logged in to backfill a job / ");
}
if ($scope.currentRepo.repository_group.name === 'try') {
if ($scope.currentRepo.is_try_repo) {
title = title.concat("backfill not available in this repository");
}

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

@ -164,7 +164,7 @@ treeherder.controller('PinboardCtrl', [
return $scope.hasPinnedJobs() && $scope.user.loggedin &&
(thPinboard.hasRelatedBugs() ||
(thisClass.failure_classification_id !== 4 && thisClass.failure_classification_id !== 2) ||
$rootScope.currentRepo.repository_group.name === "try" ||
$rootScope.currentRepo.is_try_repo ||
$rootScope.currentRepo.repository_group.name === "project repositories" ||
(thisClass.failure_classification_id === 4 && thisClass.text.length > 0) ||
(thisClass.failure_classification_id === 2 && thisClass.text.length > 7));