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
6362129a
Commit
6362129a
authored
Mar 10, 2022
by
Pedro Pombeiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply MR review suggestions
parent
25f9eb27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
10 deletions
+5
-10
app/services/ci/runners/unassign_runner_service.rb
app/services/ci/runners/unassign_runner_service.rb
+3
-2
ee/app/services/ee/ci/runners/unassign_runner_service.rb
ee/app/services/ee/ci/runners/unassign_runner_service.rb
+2
-4
spec/services/ci/runners/unassign_runner_service_spec.rb
spec/services/ci/runners/unassign_runner_service_spec.rb
+0
-4
No files found.
app/services/ci/runners/unassign_runner_service.rb
View file @
6362129a
...
...
@@ -6,8 +6,9 @@ module Ci
# @param [Ci::RunnerProject] runner_project the runner/project association to destroy
# @param [User] user the user performing the operation
def
initialize
(
runner_project
,
user
)
@runner
=
runner_project
.
runner
@runner_project
=
runner_project
@runner
=
runner_project
.
runner
@project
=
runner_project
.
project
@user
=
user
end
...
...
@@ -19,7 +20,7 @@ module Ci
private
attr_reader
:runner
_
project
,
:user
attr_reader
:runner
,
:
project
,
:user
end
end
end
...
...
ee/app/services/ee/ci/runners/unassign_runner_service.rb
View file @
6362129a
...
...
@@ -9,11 +9,9 @@ module EE
override
:execute
def
execute
runner
=
runner_project
.
runner
project
=
runner_project
.
project
result
=
super
audit_log_event
(
runner
,
project
)
if
result
audit_log_event
if
result
result
end
...
...
@@ -22,7 +20,7 @@ module EE
AUDIT_MESSAGE
=
'Unassigned CI runner from project'
def
audit_log_event
(
runner
,
project
)
def
audit_log_event
::
AuditEvents
::
RunnerCustomAuditEventService
.
new
(
runner
,
user
,
project
,
AUDIT_MESSAGE
).
track_event
end
end
...
...
spec/services/ci/runners/unassign_runner_service_spec.rb
View file @
6362129a
...
...
@@ -10,10 +10,6 @@ RSpec.describe ::Ci::Runners::UnassignRunnerService, '#execute' do
let
(
:runner_project
)
{
runner
.
runner_projects
.
last
}
before
do
allow
(
runner_project
).
to
receive
(
:project
).
and_return
(
project
)
end
context
'without user'
do
let
(
:user
)
{
nil
}
...
...
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