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
ab29c004
Commit
ab29c004
authored
May 10, 2021
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log when pipeline is rejected due to user not verified
parent
db328436
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
ee/lib/ee/gitlab/ci/pipeline/chain/validate/abilities.rb
ee/lib/ee/gitlab/ci/pipeline/chain/validate/abilities.rb
+7
-0
ee/spec/lib/ee/gitlab/ci/pipeline/chain/validate/abilities_spec.rb
...ib/ee/gitlab/ci/pipeline/chain/validate/abilities_spec.rb
+12
-0
No files found.
ee/lib/ee/gitlab/ci/pipeline/chain/validate/abilities.rb
View file @
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
...
...
ee/spec/lib/ee/gitlab/ci/pipeline/chain/validate/abilities_spec.rb
View file @
ab29c004
...
...
@@ -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
...
...
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