From c8b931609ed4e3f6656f5dcb6eb30737c5c6f4c5 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie <jimmy.zelinskie@coreos.com> Date: Mon, 6 Apr 2015 14:53:54 -0400 Subject: [PATCH] unsupported alert for robot selection --- endpoints/api/trigger.py | 4 ++++ endpoints/trigger.py | 4 ++-- static/directives/setup-trigger-dialog.html | 11 ++++++++--- static/js/directives/ui/setup-trigger-dialog.js | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/endpoints/api/trigger.py b/endpoints/api/trigger.py index 9b0b1de64..564bbd618 100644 --- a/endpoints/api/trigger.py +++ b/endpoints/api/trigger.py @@ -373,6 +373,10 @@ class BuildTriggerAnalyze(RepositoryParamResource): 'status': 'error', 'message': rre.message } + except NotImplementedError: + return { + 'status': 'notimplemented', + } raise NotFound() diff --git a/endpoints/trigger.py b/endpoints/trigger.py index 01c5145aa..2a4fda5e3 100644 --- a/endpoints/trigger.py +++ b/endpoints/trigger.py @@ -66,14 +66,14 @@ class BuildTrigger(object): """ Returns the URL at which the Dockerfile for the trigger is found or None if none/not applicable. """ - return None + raise NotImplementedError def load_dockerfile_contents(self, auth_token, config): """ Loads the Dockerfile found for the trigger's config and returns them or None if none could be found/loaded. """ - return None + raise NotImplementedError def list_build_sources(self, auth_token): """ diff --git a/static/directives/setup-trigger-dialog.html b/static/directives/setup-trigger-dialog.html index d3fe653bb..87c921ece 100644 --- a/static/directives/setup-trigger-dialog.html +++ b/static/directives/setup-trigger-dialog.html @@ -35,11 +35,17 @@ <div class="trigger-option-section" ng-show="currentView == 'analyzed'"> <!-- Messaging --> - <div class="alert alert-danger" ng-if="pullInfo.analysis.status == 'error' && !(trigger.service == 'custom')"> + <div class="alert alert-danger" ng-if="pullInfo.analysis.status == 'error'"> {{ pullInfo.analysis.message }} </div> <div class="alert alert-warning" ng-if="pullInfo.analysis.status == 'warning'"> - {{ pullRequirements.message }} + {{ pullInfo.analysis.message }} + </div> + <div class="alert alert-info" ng-if="pullInfo.analysis.status == 'notimplemented'"> + <p> + For {{ TriggerService.getTitle(trigger.service) }} triggers, we are unable to determine dependencies automatically. + If the git repository being built depends on a private base image, you must manually select a robot account with the proper permissions. + </p> </div> <div class="dockerfile-found" ng-if="pullInfo.analysis.is_public === false"> <div class="dockerfile-found-content"> @@ -60,7 +66,6 @@ </div> <div style="margin-bottom: 12px"> - <p>Because Dockerfiles may depend on other private images, you may need to use a robot account to build this repository.</p> Please select the credentials to use when pulling the base image: </div> <div ng-if="!isNamespaceAdmin(repository.namespace)" style="color: #aaa;"> diff --git a/static/js/directives/ui/setup-trigger-dialog.js b/static/js/directives/ui/setup-trigger-dialog.js index df0e3fd60..7f43807cf 100644 --- a/static/js/directives/ui/setup-trigger-dialog.js +++ b/static/js/directives/ui/setup-trigger-dialog.js @@ -14,12 +14,13 @@ angular.module('quay').directive('setupTriggerDialog', function () { 'canceled': '&canceled', 'activated': '&activated' }, - controller: function($scope, $element, ApiService, UserService) { + controller: function($scope, $element, ApiService, UserService, TriggerService) { var modalSetup = false; $scope.state = {}; $scope.nextStepCounter = -1; $scope.currentView = 'config'; + $scope.TriggerService = TriggerService $scope.show = function() { if (!$scope.trigger || !$scope.repository) { return; }