Commit c6284616 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch 'remove-ff-ci_minutes_monthly_tracking' into 'master'

Remove FF ci_minutes_monthly_tracking

See merge request gitlab-org/gitlab!70183
parents 8ec8cf2c c798d81a
......@@ -28,8 +28,6 @@ module Ci
private
def preload_minutes_usage_data!
return unless monthly_tracking_enabled?
project_usage
namespace_usage
end
......@@ -48,8 +46,6 @@ module Ci
end
def track_usage_of_monthly_minutes(consumption)
return unless monthly_tracking_enabled?
::Ci::Minutes::NamespaceMonthlyUsage.increase_usage(namespace_usage, consumption) if namespace_usage
::Ci::Minutes::ProjectMonthlyUsage.increase_usage(project_usage, consumption) if project_usage
end
......@@ -92,11 +88,6 @@ module Ci
rescue ActiveRecord::NotNullViolation, ActiveRecord::RecordInvalid
end
end
def monthly_tracking_enabled?
# TODO(issue 335885): Remove @project
Feature.enabled?(:ci_minutes_monthly_tracking, @project, default_enabled: :yaml)
end
end
end
end
---
name: ci_minutes_monthly_tracking
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52915
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300803
milestone: '13.9'
type: development
group: group::pipeline execution
default_enabled: false
......@@ -112,17 +112,6 @@ RSpec.describe Ci::Minutes::UpdateBuildMinutesService do
end
end
context 'when feature flag ci_minutes_monthly_tracking is disabled' do
before do
stub_feature_flags(ci_minutes_monthly_tracking: false)
end
it 'does not track usage on a monthly basis' do
expect(namespace_amount_used).to eq(0)
expect(project_amount_used).to eq(0)
end
end
context 'when consumption is 0' do
let(:build) do
create(:ci_build, :success,
......@@ -162,19 +151,6 @@ RSpec.describe Ci::Minutes::UpdateBuildMinutesService do
end
it_behaves_like 'new tracking matches legacy tracking'
context 'when feature flag ci_minutes_monthly_tracking is disabled' do
before do
stub_feature_flags(ci_minutes_monthly_tracking: false)
end
it 'does not track usage on a monthly basis' do
subject
expect(namespace_amount_used).to eq(usage_in_minutes)
expect(project_amount_used).to eq(usage_in_minutes)
end
end
end
context 'when group is subgroup' do
......
......@@ -73,19 +73,6 @@ RSpec.describe Ci::Minutes::UpdateProjectAndNamespaceUsageService do
expect(project_amount_used).to eq(consumption_minutes)
end
context 'when feature flag ci_minutes_monthly_tracking is disabled' do
before do
stub_feature_flags(ci_minutes_monthly_tracking: false)
end
it 'does not update the usage on a monthly basis' do
subject.execute(consumption_minutes)
expect(namespace_amount_used).to eq(0)
expect(project_amount_used).to eq(0)
end
end
context 'when on .com' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
......@@ -158,19 +145,6 @@ RSpec.describe Ci::Minutes::UpdateProjectAndNamespaceUsageService do
expect(namespace_amount_used).to eq(existing_usage_in_minutes + consumption_minutes)
expect(project_amount_used).to eq(existing_usage_in_minutes + consumption_minutes)
end
context 'when feature flag ci_minutes_monthly_tracking is disabled' do
before do
stub_feature_flags(ci_minutes_monthly_tracking: false)
end
it 'does not update usage' do
subject.execute(consumption_minutes)
expect(namespace_amount_used).to eq(existing_usage_in_minutes)
expect(project_amount_used).to eq(existing_usage_in_minutes)
end
end
end
end
end
......
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