Commit 6362129a authored by Pedro Pombeiro's avatar Pedro Pombeiro

Apply MR review suggestions

parent 25f9eb27
......@@ -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
......
......@@ -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
......
......@@ -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 }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment