Commit 7328c3f5 authored by Mark Chao's avatar Mark Chao

Merge branch 'log-rejected-pipeline-when-user-not-verified' into 'master'

Log when pipeline is rejected due to user not verified

See merge request gitlab-org/gitlab!61386
parents 26691998 ab29c004
......@@ -19,6 +19,13 @@ module EE
end
if current_user && !current_user.has_required_credit_card_to_run_pipelines?(project)
::Gitlab::AppLogger.info(
message: 'Credit card required to be on file in order to create a pipeline',
project_path: project.full_path,
user_id: current_user.id,
plan: project.root_namespace.actual_plan_name
)
return error('Credit card required to be on file in order to create a pipeline', drop_reason: :user_not_verified)
end
......
......@@ -56,6 +56,18 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Validate::Abilities do
expect(pipeline.errors.to_a)
.to include('Credit card required to be on file in order to create a pipeline')
end
it 'logs the event' do
allow(Gitlab).to receive(:com?).and_return(true).at_least(:once)
expect(Gitlab::AppLogger).to receive(:info).with(
message: 'Credit card required to be on file in order to create a pipeline',
project_path: project.full_path,
user_id: user.id,
plan: 'free')
step.perform!
end
end
context 'when user has credit card for pipelines in project' 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