Commit ae39d785 authored by Aleksei Lipniagov's avatar Aleksei Lipniagov Committed by Kamil Trzciński

Enable CI Minutes-related FFs by default

parent aee71022
...@@ -36,7 +36,7 @@ module EE ...@@ -36,7 +36,7 @@ module EE
end end
def shared_runners_minutes_limit_enabled? def shared_runners_minutes_limit_enabled?
if ::Feature.enabled?(:ci_minutes_track_for_public_projects, project.shared_runners_limit_namespace) if ::Feature.enabled?(:ci_minutes_track_for_public_projects, project.shared_runners_limit_namespace, default_enabled: true)
project.shared_runners_minutes_limit_enabled? && runner&.minutes_cost_factor(project.visibility_level)&.positive? project.shared_runners_minutes_limit_enabled? && runner&.minutes_cost_factor(project.visibility_level)&.positive?
else else
legacy_shared_runners_minutes_limit_enabled? legacy_shared_runners_minutes_limit_enabled?
......
...@@ -91,7 +91,7 @@ module EE ...@@ -91,7 +91,7 @@ module EE
has_many :sourced_pipelines, class_name: 'Ci::Sources::Project', foreign_key: :source_project_id has_many :sourced_pipelines, class_name: 'Ci::Sources::Project', foreign_key: :source_project_id
scope :with_shared_runners_limit_enabled, -> do scope :with_shared_runners_limit_enabled, -> do
if ::Feature.enabled?(:ci_minutes_enforce_quota_for_public_projects) && if ::Feature.enabled?(:ci_minutes_enforce_quota_for_public_projects, default_enabled: true) &&
::Ci::Runner.has_shared_runners_with_non_zero_public_cost? ::Ci::Runner.has_shared_runners_with_non_zero_public_cost?
with_shared_runners with_shared_runners
else else
...@@ -276,7 +276,7 @@ module EE ...@@ -276,7 +276,7 @@ module EE
end end
def shared_runners_minutes_limit_enabled? def shared_runners_minutes_limit_enabled?
if ::Feature.enabled?(:ci_minutes_track_for_public_projects, shared_runners_limit_namespace) if ::Feature.enabled?(:ci_minutes_track_for_public_projects, shared_runners_limit_namespace, default_enabled: true)
shared_runners_enabled? && shared_runners_enabled? &&
shared_runners_limit_namespace.shared_runners_minutes_limit_enabled? shared_runners_limit_namespace.shared_runners_minutes_limit_enabled?
else else
......
...@@ -28,7 +28,7 @@ module EE ...@@ -28,7 +28,7 @@ module EE
def builds_for_shared_runner def builds_for_shared_runner
return super unless shared_runner_build_limits_feature_enabled? return super unless shared_runner_build_limits_feature_enabled?
if ::Feature.enabled?(:ci_minutes_enforce_quota_for_public_projects) if ::Feature.enabled?(:ci_minutes_enforce_quota_for_public_projects, default_enabled: true)
enforce_minutes_based_on_cost_factors(super) enforce_minutes_based_on_cost_factors(super)
else else
legacy_enforce_minutes_for_non_public_projects(super) legacy_enforce_minutes_for_non_public_projects(super)
......
...@@ -6,7 +6,7 @@ class UpdateBuildMinutesService < BaseService ...@@ -6,7 +6,7 @@ class UpdateBuildMinutesService < BaseService
return unless build.complete? return unless build.complete?
return unless build.duration&.positive? return unless build.duration&.positive?
if ::Feature.enabled?(:ci_minutes_track_for_public_projects, namespace) if ::Feature.enabled?(:ci_minutes_track_for_public_projects, namespace, default_enabled: true)
count_projects_based_on_cost_factors(build) count_projects_based_on_cost_factors(build)
else else
legacy_count_non_public_projects(build) legacy_count_non_public_projects(build)
......
---
title: Enable CI Minutes-related Feature Flags by default
merge_request: 32581
author:
type: changed
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