Commit 3792292c authored by Fabio Pitino's avatar Fabio Pitino

Merge branch 'sh-allow-treat-paid-ci-cd-minutes-as-paid' into 'master'

Waive credit card validation if project has paid CI/CD minutes

See merge request gitlab-org/gitlab!77829
parents c3fb4845 7c2e0e1b
---
name: ci_skip_require_credit_card_for_addon_ci_minutes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77829
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/349841
milestone: '14.7'
type: development
group: group::fulfillment
default_enabled: false
......@@ -267,7 +267,9 @@ module EE
end
def ci_minutes_quota
@ci_minutes_quota ||= ::Ci::Minutes::Quota.new(self)
strong_memoize(:ci_minutes_quota) do
::Ci::Minutes::Quota.new(self)
end
end
def new_monthly_ci_minutes_enabled?
......
......@@ -473,6 +473,10 @@ module EE
return false unless created_after_credit_card_release_day?(project)
root_namespace = project.root_namespace
ci_quota = root_namespace.ci_minutes_quota
return false if ci_quota.enabled? && ci_quota.limit.any_purchased? && ::Feature.enabled?(:ci_skip_require_credit_card_for_addon_ci_minutes, project, default_enabled: :yaml)
if root_namespace.free_plan?
::Feature.enabled?(:ci_require_credit_card_on_free_plan, project, default_enabled: :yaml)
elsif root_namespace.trial?
......
This diff is collapsed.
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