Replace builds_enabled with jobs_enabled in projects API v4 (!10786)
This commit is contained in:
parent
db9dd06627
commit
de2c2d9cc6
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Replace builds_enabled with jobs_enabled in projects API v4
|
||||||
|
merge_request: 10786
|
||||||
|
author: winniehell
|
|
@ -11,7 +11,7 @@ module API
|
||||||
optional :issues_enabled, type: Boolean, desc: 'Flag indication if the issue tracker is enabled'
|
optional :issues_enabled, type: Boolean, desc: 'Flag indication if the issue tracker is enabled'
|
||||||
optional :merge_requests_enabled, type: Boolean, desc: 'Flag indication if merge requests are enabled'
|
optional :merge_requests_enabled, type: Boolean, desc: 'Flag indication if merge requests are enabled'
|
||||||
optional :wiki_enabled, type: Boolean, desc: 'Flag indication if the wiki is enabled'
|
optional :wiki_enabled, type: Boolean, desc: 'Flag indication if the wiki is enabled'
|
||||||
optional :builds_enabled, type: Boolean, desc: 'Flag indication if builds are enabled'
|
optional :jobs_enabled, type: Boolean, desc: 'Flag indication if jobs are enabled'
|
||||||
optional :snippets_enabled, type: Boolean, desc: 'Flag indication if snippets are enabled'
|
optional :snippets_enabled, type: Boolean, desc: 'Flag indication if snippets are enabled'
|
||||||
optional :shared_runners_enabled, type: Boolean, desc: 'Flag indication if shared runners are enabled for that project'
|
optional :shared_runners_enabled, type: Boolean, desc: 'Flag indication if shared runners are enabled for that project'
|
||||||
optional :container_registry_enabled, type: Boolean, desc: 'Flag indication if the container registry is enabled for that project'
|
optional :container_registry_enabled, type: Boolean, desc: 'Flag indication if the container registry is enabled for that project'
|
||||||
|
@ -103,6 +103,7 @@ module API
|
||||||
end
|
end
|
||||||
post do
|
post do
|
||||||
attrs = declared_params(include_missing: false)
|
attrs = declared_params(include_missing: false)
|
||||||
|
attrs[:builds_enabled] = attrs.delete(:jobs_enabled) if attrs.has_key?(:jobs_enabled)
|
||||||
project = ::Projects::CreateService.new(current_user, attrs).execute
|
project = ::Projects::CreateService.new(current_user, attrs).execute
|
||||||
|
|
||||||
if project.saved?
|
if project.saved?
|
||||||
|
@ -205,7 +206,7 @@ module API
|
||||||
# CE
|
# CE
|
||||||
at_least_one_of_ce =
|
at_least_one_of_ce =
|
||||||
[
|
[
|
||||||
:builds_enabled,
|
:jobs_enabled,
|
||||||
:container_registry_enabled,
|
:container_registry_enabled,
|
||||||
:default_branch,
|
:default_branch,
|
||||||
:description,
|
:description,
|
||||||
|
@ -236,6 +237,8 @@ module API
|
||||||
authorize! :rename_project, user_project if attrs[:name].present?
|
authorize! :rename_project, user_project if attrs[:name].present?
|
||||||
authorize! :change_visibility_level, user_project if attrs[:visibility].present?
|
authorize! :change_visibility_level, user_project if attrs[:visibility].present?
|
||||||
|
|
||||||
|
attrs[:builds_enabled] = attrs.delete(:jobs_enabled) if attrs.has_key?(:jobs_enabled)
|
||||||
|
|
||||||
result = ::Projects::UpdateService.new(user_project, current_user, attrs).execute
|
result = ::Projects::UpdateService.new(user_project, current_user, attrs).execute
|
||||||
|
|
||||||
if result[:status] == :success
|
if result[:status] == :success
|
||||||
|
|
Loading…
Reference in New Issue