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
b59c7e2e
Commit
b59c7e2e
authored
Jun 22, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow updating shared_runners_minutes_limit on admin Namespace API
parent
e76764ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
changelogs/unreleased-ee/add-shared-runners-minutes-limit-to-namespace-admin-api.yml
...d-shared-runners-minutes-limit-to-namespace-admin-api.yml
+4
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/namespaces.rb
lib/api/namespaces.rb
+1
-0
spec/requests/api/namespaces_spec.rb
spec/requests/api/namespaces_spec.rb
+6
-4
No files found.
changelogs/unreleased-ee/add-shared-runners-minutes-limit-to-namespace-admin-api.yml
0 → 100644
View file @
b59c7e2e
---
title
:
Allow updating shared_runners_minutes_limit on admin Namespace API
merge_request
:
author
:
lib/api/entities.rb
View file @
b59c7e2e
...
...
@@ -495,7 +495,7 @@ module API
class
Namespace
<
Grape
::
Entity
expose
:plan
,
if:
lambda
{
|
_
,
options
|
options
[
:current_user
]
&&
options
[
:current_user
].
admin?
}
expose
:id
,
:name
,
:path
,
:kind
,
:full_path
expose
:id
,
:name
,
:path
,
:kind
,
:full_path
,
:shared_runners_minutes_limit
end
class
MemberAccess
<
Grape
::
Entity
...
...
lib/api/namespaces.rb
View file @
b59c7e2e
...
...
@@ -25,6 +25,7 @@ module API
end
params
do
optional
:plan
,
type:
String
,
desc:
"Namespace or Group plan"
optional
:shared_runners_minutes_limit
,
type:
Integer
,
desc:
"Pipeline minutes quota for this namespace"
end
put
':id'
do
authenticated_as_admin!
...
...
spec/requests/api/namespaces_spec.rb
View file @
b59c7e2e
...
...
@@ -59,18 +59,20 @@ describe API::Namespaces do
describe
'PUT /namespaces/:id'
do
context
'when authenticated as admin'
do
it
'updates
plan
using full_path'
do
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
plan:
'silver'
it
'updates
namespace
using full_path'
do
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
plan:
'silver'
,
shared_runners_minutes_limit:
9001
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
[
'plan'
]).
to
eq
(
'silver'
)
expect
(
json_response
[
'shared_runners_minutes_limit'
]).
to
eq
(
9001
)
end
it
'updates
plan
using id'
do
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
admin
),
plan:
'silver'
it
'updates
namespace
using id'
do
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
admin
),
plan:
'silver'
,
shared_runners_minutes_limit:
9001
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
[
'plan'
]).
to
eq
(
'silver'
)
expect
(
json_response
[
'shared_runners_minutes_limit'
]).
to
eq
(
9001
)
end
end
...
...
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