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
a86e5a6e
Commit
a86e5a6e
authored
Apr 06, 2020
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove API for updating namespaces.plan_id
This is an unused column and updating this has no effect
parent
506418b2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
ee/lib/ee/api/namespaces.rb
ee/lib/ee/api/namespaces.rb
+0
-1
ee/spec/requests/api/namespaces_spec.rb
ee/spec/requests/api/namespaces_spec.rb
+7
-12
No files found.
ee/lib/ee/api/namespaces.rb
View file @
a86e5a6e
...
@@ -51,7 +51,6 @@ module EE
...
@@ -51,7 +51,6 @@ module EE
success
Entities
::
Namespace
success
Entities
::
Namespace
end
end
params
do
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"
optional
:shared_runners_minutes_limit
,
type:
Integer
,
desc:
"Pipeline minutes quota for this namespace"
optional
:extra_shared_runners_minutes_limit
,
type:
Integer
,
desc:
"Extra pipeline minutes for this namespace"
optional
:extra_shared_runners_minutes_limit
,
type:
Integer
,
desc:
"Extra pipeline minutes for this namespace"
optional
:trial_ends_on
,
type:
Date
,
desc:
"Trial expiration date"
optional
:trial_ends_on
,
type:
Date
,
desc:
"Trial expiration date"
...
...
ee/spec/requests/api/namespaces_spec.rb
View file @
a86e5a6e
...
@@ -111,13 +111,9 @@ describe API::Namespaces do
...
@@ -111,13 +111,9 @@ describe API::Namespaces do
end
end
describe
'PUT /namespaces/:id'
do
describe
'PUT /namespaces/:id'
do
before
do
create
(
:silver_plan
)
end
context
'when authenticated as admin'
do
context
'when authenticated as admin'
do
it
'updates namespace using full_path when full_path contains dots'
do
it
'updates namespace using full_path when full_path contains dots'
do
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
params:
{
plan:
'silver'
,
shared_runners_minutes_limit:
9001
}
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
params:
{
shared_runners_minutes_limit:
9001
}
aggregate_failures
do
aggregate_failures
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
...
@@ -126,7 +122,7 @@ describe API::Namespaces do
...
@@ -126,7 +122,7 @@ describe API::Namespaces do
end
end
it
'updates namespace using id'
do
it
'updates namespace using id'
do
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
admin
),
params:
{
plan:
'silver'
,
shared_runners_minutes_limit:
9001
}
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
admin
),
params:
{
shared_runners_minutes_limit:
9001
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'shared_runners_minutes_limit'
]).
to
eq
(
9001
)
expect
(
json_response
[
'shared_runners_minutes_limit'
]).
to
eq
(
9001
)
...
@@ -135,7 +131,7 @@ describe API::Namespaces do
...
@@ -135,7 +131,7 @@ describe API::Namespaces do
context
'when not authenticated as admin'
do
context
'when not authenticated as admin'
do
it
'retuns 403'
do
it
'retuns 403'
do
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
user
),
params:
{
plan:
'silver'
}
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
user
),
params:
{
shared_runners_minutes_limit:
9001
}
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
end
end
...
@@ -143,7 +139,7 @@ describe API::Namespaces do
...
@@ -143,7 +139,7 @@ describe API::Namespaces do
context
'when namespace not found'
do
context
'when namespace not found'
do
it
'returns 404'
do
it
'returns 404'
do
put
api
(
"/namespaces/
#{
non_existing_record_id
}
"
,
admin
),
params:
{
plan:
'silver'
}
put
api
(
"/namespaces/
#{
non_existing_record_id
}
"
,
admin
),
params:
{
shared_runners_minutes_limit:
9001
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
json_response
).
to
eq
(
'message'
=>
'404 Namespace Not Found'
)
expect
(
json_response
).
to
eq
(
'message'
=>
'404 Namespace Not Found'
)
...
@@ -152,10 +148,9 @@ describe API::Namespaces do
...
@@ -152,10 +148,9 @@ describe API::Namespaces do
context
'when invalid params'
do
context
'when invalid params'
do
it
'returns validation error'
do
it
'returns validation error'
do
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
admin
),
params:
{
plan
:
'unknown'
}
put
api
(
"/namespaces/
#{
group1
.
id
}
"
,
admin
),
params:
{
shared_runners_minutes_limit
:
'unknown'
}
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
json_response
[
'message'
]).
to
eq
(
'plan'
=>
[
'is not included in the list'
])
end
end
end
end
...
@@ -167,7 +162,7 @@ describe API::Namespaces do
...
@@ -167,7 +162,7 @@ describe API::Namespaces do
it
'resets that value when assigning extra CI minutes'
do
it
'resets that value when assigning extra CI minutes'
do
expect
do
expect
do
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
params:
{
plan:
'silver'
,
extra_shared_runners_minutes_limit:
1000
}
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
params:
{
extra_shared_runners_minutes_limit:
1000
}
end
.
to
change
{
group1
.
reload
.
send
(
attr
)
}.
to
(
nil
)
end
.
to
change
{
group1
.
reload
.
send
(
attr
)
}.
to
(
nil
)
end
end
end
end
...
@@ -177,7 +172,7 @@ describe API::Namespaces do
...
@@ -177,7 +172,7 @@ describe API::Namespaces do
it
"ticks instance runners"
do
it
"ticks instance runners"
do
runners
=
Ci
::
Runner
.
instance_type
runners
=
Ci
::
Runner
.
instance_type
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
params:
{
plan:
'silver'
,
extra_shared_runners_minutes_limit:
1000
}
put
api
(
"/namespaces/
#{
group1
.
full_path
}
"
,
admin
),
params:
{
extra_shared_runners_minutes_limit:
1000
}
expect
(
runners
).
to
all
(
receive
(
:tick_runner_queue
))
expect
(
runners
).
to
all
(
receive
(
:tick_runner_queue
))
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