Commit 70a8a8a6 authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Check different FF in shared limit check

parent ae638fcc
...@@ -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_enforce_quota_for_public_projects) if ::Feature.enabled?(:ci_minutes_track_for_public_projects, project.shared_runners_limit_namespace)
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?
......
...@@ -281,7 +281,7 @@ module EE ...@@ -281,7 +281,7 @@ module EE
end end
def shared_runners_minutes_limit_enabled? def shared_runners_minutes_limit_enabled?
if ::Feature.enabled?(:ci_minutes_enforce_quota_for_public_projects) if ::Feature.enabled?(:ci_minutes_track_for_public_projects, shared_runners_limit_namespace)
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
......
...@@ -81,9 +81,9 @@ describe Ci::Build do ...@@ -81,9 +81,9 @@ describe Ci::Build do
it_behaves_like 'depends on runner presence and type' it_behaves_like 'depends on runner presence and type'
context 'and :ci_minutes_enforce_quota_for_public_projects FF is disabled' do context 'and :ci_minutes_track_for_public_projects FF is disabled' do
before do before do
stub_feature_flags(ci_minutes_enforce_quota_for_public_projects: false) stub_feature_flags(ci_minutes_track_for_public_projects: { enabled: false, thing: project.shared_runners_limit_namespace })
end end
it_behaves_like 'depends on runner presence and type' it_behaves_like 'depends on runner presence and type'
......
...@@ -980,9 +980,9 @@ describe Project do ...@@ -980,9 +980,9 @@ describe Project do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
context 'and :ci_minutes_enforce_quota_for_public_projects FF is disabled' do context 'and :ci_minutes_track_for_public_projects FF is disabled' do
before do before do
stub_feature_flags(ci_minutes_enforce_quota_for_public_projects: false) stub_feature_flags(ci_minutes_track_for_public_projects: { enabled: false, thing: project.shared_runners_limit_namespace })
end end
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
......
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