diff --git a/config.py b/config.py index 46b884a3c..2d267febe 100644 --- a/config.py +++ b/config.py @@ -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 diff --git a/endpoints/callbacks.py b/endpoints/callbacks.py index 3292b349e..9727d8847 100644 --- a/endpoints/callbacks.py +++ b/endpoints/callbacks.py @@ -119,6 +119,7 @@ def github_oauth_attach(): @callback.route('/github/callback/trigger/', methods=['GET']) +@route_show_if(features.GITHUB_BUILD) @require_session_login @parse_repository_name def attach_github_build_trigger(namespace, repository): diff --git a/static/js/controllers.js b/static/js/controllers.js index 3a0d4bd1c..67cb99ac4 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -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; diff --git a/static/partials/new-repo.html b/static/partials/new-repo.html index d2cd8941a..92d2c3ca6 100644 --- a/static/partials/new-repo.html +++ b/static/partials/new-repo.html @@ -126,7 +126,7 @@ -
+
diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html index 302e8baca..a2988b771 100644 --- a/static/partials/repo-admin.html +++ b/static/partials/repo-admin.html @@ -315,8 +315,9 @@
+ No build trigger types enabled.