Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
de2c2d9c
Commit
de2c2d9c
authored
Apr 20, 2017
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace builds_enabled with jobs_enabled in projects API v4 (!10786)
parent
db9dd066
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
changelogs/unreleased/fix-jobs-enabled-parameter.yml
changelogs/unreleased/fix-jobs-enabled-parameter.yml
+4
-0
lib/api/projects.rb
lib/api/projects.rb
+5
-2
No files found.
changelogs/unreleased/fix-jobs-enabled-parameter.yml
0 → 100644
View file @
de2c2d9c
---
title
:
Replace builds_enabled with jobs_enabled in projects API v4
merge_request
:
10786
author
:
winniehell
lib/api/projects.rb
View file @
de2c2d9c
...
@@ -11,7 +11,7 @@ module API
...
@@ -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 build
s are enabled'
optional
:
jobs_enabled
,
type:
Boolean
,
desc:
'Flag indication if job
s 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
...
@@ -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
...
@@ -205,7 +206,7 @@ module API
# CE
# CE
at_least_one_of_ce
=
at_least_one_of_ce
=
[
[
:
build
s_enabled
,
:
job
s_enabled
,
:container_registry_enabled
,
:container_registry_enabled
,
:default_branch
,
:default_branch
,
:description
,
:description
,
...
@@ -236,6 +237,8 @@ module API
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment