diff options
-rw-r--r-- | lib/api/api.rb | 2 | ||||
-rw-r--r-- | lib/api/helpers/runner.rb (renamed from lib/api/helpers/ci.rb) | 2 | ||||
-rw-r--r-- | lib/api/runner.rb (renamed from lib/api/ci.rb) | 8 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb (renamed from spec/requests/api/ci_spec.rb) | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 6d7eb3eb84f..016b9572649 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -52,7 +52,6 @@ module API mount ::API::Branches mount ::API::BroadcastMessages mount ::API::Builds - mount ::API::Ci mount ::API::Commits mount ::API::CommitStatuses mount ::API::DeployKeys @@ -77,6 +76,7 @@ module API mount ::API::Projects mount ::API::ProjectSnippets mount ::API::Repositories + mount ::API::Runner mount ::API::Runners mount ::API::Services mount ::API::Session diff --git a/lib/api/helpers/ci.rb b/lib/api/helpers/runner.rb index e928d7c874a..119ca81b883 100644 --- a/lib/api/helpers/ci.rb +++ b/lib/api/helpers/runner.rb @@ -1,6 +1,6 @@ module API module Helpers - module Ci + module Runner def runner_registration_token_valid? ActiveSupport::SecurityUtils.variable_size_secure_compare(params[:token], current_application_settings.runners_registration_token) diff --git a/lib/api/ci.rb b/lib/api/runner.rb index 635116cc88d..804b27d40a7 100644 --- a/lib/api/ci.rb +++ b/lib/api/runner.rb @@ -1,6 +1,6 @@ module API - class Ci < Grape::API - helpers ::API::Helpers::Ci + class Runner < Grape::API + helpers ::API::Helpers::Runner resource :runners do desc 'Registers a new Runner' do @@ -21,7 +21,7 @@ module API runner = if runner_registration_token_valid? # Create shared runner. Requires admin access - ::Ci::Runner.create(attributes.merge(is_shared: true)) + Ci::Runner.create(attributes.merge(is_shared: true)) elsif project = Project.find_by(runners_token: params[:token]) # Create a specific runner for project. project.runners.create(attributes) @@ -45,7 +45,7 @@ module API end delete '/' do authenticate_runner! - ::Ci::Runner.find_by_token(params[:token]).destroy + Ci::Runner.find_by_token(params[:token]).destroy end end end diff --git a/spec/requests/api/ci_spec.rb b/spec/requests/api/runner_spec.rb index 4eef78dd1c2..73e82647ca0 100644 --- a/spec/requests/api/ci_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::Ci do +describe API::Runner do include ApiHelpers include StubGitlabCalls |