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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
cc4bc22a
Commit
cc4bc22a
authored
Dec 20, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner can't be assigned to more than 1 group
therefore we don't need the api check.
parent
1a009f1b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
9 deletions
+1
-9
lib/api/runners.rb
lib/api/runners.rb
+0
-1
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+1
-8
No files found.
lib/api/runners.rb
View file @
cc4bc22a
...
...
@@ -199,7 +199,6 @@ module API
forbidden!
(
"Runner is shared"
)
if
runner
.
is_shared?
forbidden!
(
"Runner associated with more than one project"
)
if
runner
.
projects
.
count
>
1
forbidden!
(
"Runner associated with more that one group"
)
if
runner
.
groups
.
count
>
1
forbidden!
(
"No access granted"
)
unless
user_can_access_runner?
(
runner
)
end
...
...
spec/requests/api/runners_spec.rb
View file @
cc4bc22a
...
...
@@ -29,8 +29,6 @@ describe API::Runners do
let!
(
:group_runner
)
{
create
(
:ci_runner
,
description:
'Group runner'
,
groups:
[
group
])
}
let!
(
:two_groups_runner
)
{
create
(
:ci_runner
,
description:
'Two groups runner'
,
groups:
[
group
,
group2
])
}
before
do
# Set project access for users
create
(
:project_member
,
:master
,
user:
user
,
project:
project
)
...
...
@@ -49,7 +47,7 @@ describe API::Runners do
expect
(
response
).
to
include_pagination_headers
expect
(
json_response
).
to
be_an
Array
expect
(
descriptions
).
to
contain_exactly
(
'Project runner'
,
'Group runner'
,
'Two projects runner'
,
'Two groups runner'
'Project runner'
,
'Group runner'
,
'Two projects runner'
)
expect
(
shared
).
to
be_falsey
end
...
...
@@ -422,11 +420,6 @@ describe API::Runners do
end
.
to
change
{
Ci
::
Runner
.
specific
.
count
}.
by
(
-
1
)
end
it
'does not delete group runner with more than one associated group'
do
delete
api
(
"/runners/
#{
two_groups_runner
.
id
}
"
,
user
)
expect
(
response
).
to
have_http_status
(
403
)
end
it
'deletes group runner for one owned group'
do
expect
do
delete
api
(
"/runners/
#{
group_runner
.
id
}
"
,
user
)
...
...
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