Move GitHub build trigger behind a feature flag.
This commit is contained in:
parent
2112333875
commit
0057ced98c
6 changed files with 12 additions and 4 deletions
|
@ -146,3 +146,6 @@ class DefaultConfig(object):
|
|||
|
||||
# Feature Flag: Whether super users are supported.
|
||||
FEATURE_SUPER_USERS = False
|
||||
|
||||
# Feature Flag: Whether to support GitHub build triggers.
|
||||
FEATURE_GITHUB_BUILD = False
|
||||
|
|
|
@ -119,6 +119,7 @@ def github_oauth_attach():
|
|||
|
||||
|
||||
@callback.route('/github/callback/trigger/<path:repository>', methods=['GET'])
|
||||
@route_show_if(features.GITHUB_BUILD)
|
||||
@require_session_login
|
||||
@parse_repository_name
|
||||
def attach_github_build_trigger(namespace, repository):
|
||||
|
|
|
@ -1180,10 +1180,11 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
|||
fetchRepository();
|
||||
}
|
||||
|
||||
function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams, $rootScope, $location, UserService, Config) {
|
||||
function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams, $rootScope, $location, UserService, Config, Features) {
|
||||
var namespace = $routeParams.namespace;
|
||||
var name = $routeParams.name;
|
||||
|
||||
$scope.Features = Features;
|
||||
$scope.permissions = {'team': [], 'user': []};
|
||||
$scope.logsShown = 0;
|
||||
$scope.deleting = false;
|
||||
|
@ -1897,6 +1898,7 @@ function V1Ctrl($scope, $location, UserService) {
|
|||
function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService, PlanService, KeyService, Features) {
|
||||
UserService.updateUserIn($scope);
|
||||
|
||||
$scope.Features = Features;
|
||||
$scope.githubRedirectUri = KeyService.githubRedirectUri;
|
||||
$scope.githubClientId = KeyService.githubClientId;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Github -->
|
||||
<div class="repo-option">
|
||||
<div class="repo-option" ng-show="Features.GITHUB_BUILD">
|
||||
<input type="radio" id="initGithub" name="initialize" ng-model="repo.initialize" value="github">
|
||||
<i class="fa fa-github fa-lg" style="padding: 6px; padding-left: 10px; padding-right: 12px;"></i>
|
||||
<label for="initGithub">Link to a GitHub Repository</label>
|
||||
|
|
|
@ -315,8 +315,9 @@
|
|||
|
||||
<!-- Right controls -->
|
||||
<div class="right-controls">
|
||||
<span ng-show="!Features.GITHUB_BUILD" class="pull-left">No build trigger types enabled.</span>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" ng-disabled="!Features.GITHUB_BUILD">
|
||||
New Trigger
|
||||
<b class="caret"></b>
|
||||
</button>
|
||||
|
|
|
@ -38,4 +38,5 @@ class TestConfig(DefaultConfig):
|
|||
LICENSE_USER_LIMIT = 500
|
||||
LICENSE_EXPIRATION = datetime.now() + timedelta(weeks=520)
|
||||
LICENSE_EXPIRATION_WARNING = datetime.now() + timedelta(weeks=520)
|
||||
|
||||
|
||||
FEATURE_GITHUB_BUILD = True
|
||||
|
|
Reference in a new issue