Prevent creating pipeline on free and trial plans without CC info [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Fabio Pitino requested to merge require-cc-to-create-pipelines into master

What does this MR do?

Related to

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.

Screenshots (strongly suggested)

Pipeline page


Pipelines index


New pipeline form


Does this MR meet the acceptance criteria?


Availability and Testing


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