diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-03-29 10:54:06 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-03-29 10:54:06 +0000 |
commit | 8b37ce6f7f6d29604c42c65f3986d60dce0abd6c (patch) | |
tree | 1bb0959f49edd0980a2336923c6c5399122bf99a /lib/api | |
parent | b2ccfc084d790d012f43b8f5ffeaaee4c913a08c (diff) | |
parent | 6ecde0076afa83e30608ea9caba924bbab66a123 (diff) | |
download | gitlab-ce-8b37ce6f7f6d29604c42c65f3986d60dce0abd6c.tar.gz |
Merge branch 'add-per-runner-job-timeout' into 'master'
Add per runner job timeout
Closes #43426
See merge request gitlab-org/gitlab-ce!17221
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 3 | ||||
-rw-r--r-- | lib/api/runner.rb | 3 | ||||
-rw-r--r-- | lib/api/runners.rb | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 16147ee90c9..38161d1f127 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -951,6 +951,7 @@ module API expose :tag_list expose :run_untagged expose :locked + expose :maximum_timeout expose :access_level expose :version, :revision, :platform, :architecture expose :contacted_at @@ -1119,7 +1120,7 @@ module API end class RunnerInfo < Grape::Entity - expose :timeout + expose :metadata_timeout, as: :timeout end class Step < Grape::Entity diff --git a/lib/api/runner.rb b/lib/api/runner.rb index 8da97a97754..57c0a729535 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -14,9 +14,10 @@ module API optional :locked, type: Boolean, desc: 'Should Runner be locked for current project' optional :run_untagged, type: Boolean, desc: 'Should Runner handle untagged jobs' optional :tag_list, type: Array[String], desc: %q(List of Runner's tags) + optional :maximum_timeout, type: Integer, desc: 'Maximum timeout set when this Runner will handle the job' end post '/' do - attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list]) + attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list, :maximum_timeout]) .merge(get_runner_details_from_request) runner = diff --git a/lib/api/runners.rb b/lib/api/runners.rb index 996457c5dfe..5f2a9567605 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -57,6 +57,7 @@ module API optional :locked, type: Boolean, desc: 'Flag indicating the runner is locked' optional :access_level, type: String, values: Ci::Runner.access_levels.keys, desc: 'The access_level of the runner' + optional :maximum_timeout, type: Integer, desc: 'Maximum timeout set when this Runner will handle the job' at_least_one_of :description, :active, :tag_list, :run_untagged, :locked, :access_level end put ':id' do |