Commit 0bbdbd55 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'sh-fix-delete-pipeline-api' into 'master'

Disable audit event logging for pipeline destruction

See merge request gitlab-org/gitlab-ce!24293
parents 7450cdb7 05f30ac6
......@@ -5,8 +5,6 @@ module Ci
def execute(pipeline)
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_pipeline, pipeline)
AuditEventService.new(current_user, pipeline).security_event
pipeline.destroy!
end
end
......
......@@ -456,8 +456,8 @@ describe API::Pipelines do
expect(json_response['message']).to eq '404 Not found'
end
it 'logs an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.to change { SecurityEvent.count }.by(1)
it 'does not log an audit event' do
expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.not_to change { SecurityEvent.count }
end
context 'when the pipeline has jobs' do
......
......@@ -17,8 +17,8 @@ describe ::Ci::DestroyPipelineService do
expect { pipeline.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
it 'logs an audit event' do
expect { subject }.to change { SecurityEvent.count }.by(1)
it 'does not log an audit event' do
expect { subject }.not_to change { SecurityEvent.count }
end
context 'when the pipeline has jobs' do
......
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