Prevent creating pipeline on free and trial plans without CC info [RUN ALL RSPEC] [RUN AS-IF-FOSS]
What does this MR do?
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/330113
This MR adds a check when creating a pipeline to verify whether the user requires a credit card to be on file when triggering pipelines on a project. The current rules are:
graph TD
present[CC registered?] -- yes --> allow[Create pipeline]
present -- no --> free[Free Plan?]
free -- yes --> ff_free[FF Free Plan enabled?]
ff_free -- yes --> block[Fail pipeline]
ff_free -- no --> allow
free -- no --> trial[Trial Plan?]
trial -- yes --> ff_trial[FF Trial Plan enabled?]
trial -- no --> allow
ff_trial -- yes --> block
ff_trial -- no --> allow
Feature flags:
We use these 2 feature flags to control when/whether to enable the requirement for the given namespace category.
- <code data-sourcepos="25:5-25:39">ci_require_credit_card_on_free_plan</code> to enable the requirement for projects on Free plan
- <code data-sourcepos="26:5-26:40">ci_require_credit_card_on_trial_plan</code> to enable the requirement for projects on any trial plans
Screenshots (strongly suggested)
Pipeline page
Pipelines index
New pipeline form
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because it's being introduced with a feature flag.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Grzegorz Bizon