Commit 9b1a112c authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'remove-ci_enable_scheduled_build-feature-flag' into 'master'

Remove ci_enable_scheduled_build feature flag

Closes #52183

See merge request gitlab-org/gitlab-ce!22742
parents c0d30fad 84ec7137
...@@ -259,8 +259,7 @@ module Ci ...@@ -259,8 +259,7 @@ module Ci
end end
def schedulable? def schedulable?
Feature.enabled?('ci_enable_scheduled_build', default_enabled: true) && self.when == 'delayed' && options[:start_in].present?
self.when == 'delayed' && options[:start_in].present?
end end
def options_scheduled_at def options_scheduled_at
......
---
title: Remove `ci_enable_scheduled_build` feature flag
merge_request: 22742
author:
type: other
...@@ -216,14 +216,6 @@ describe Ci::Build do ...@@ -216,14 +216,6 @@ describe Ci::Build do
let(:build) { create(:ci_build, :created, :schedulable, project: project) } let(:build) { create(:ci_build, :created, :schedulable, project: project) }
it { expect(subject).to be_truthy } it { expect(subject).to be_truthy }
context 'when feature flag is diabled' do
before do
stub_feature_flags(ci_enable_scheduled_build: false)
end
it { expect(subject).to be_falsy }
end
end end
context 'when build is not schedulable' do context 'when build is not schedulable' do
...@@ -327,10 +319,6 @@ describe Ci::Build do ...@@ -327,10 +319,6 @@ describe Ci::Build do
describe '#enqueue_scheduled' do describe '#enqueue_scheduled' do
subject { build.enqueue_scheduled } subject { build.enqueue_scheduled }
before do
stub_feature_flags(ci_enable_scheduled_build: true)
end
context 'when build is scheduled and the right time has not come yet' do context 'when build is scheduled and the right time has not come yet' do
let(:build) { create(:ci_build, :scheduled, pipeline: pipeline) } let(:build) { create(:ci_build, :scheduled, pipeline: pipeline) }
......
...@@ -98,47 +98,19 @@ describe Ci::ProcessBuildService, '#execute' do ...@@ -98,47 +98,19 @@ describe Ci::ProcessBuildService, '#execute' do
let(:build) { create(:ci_build, :created, :schedulable, user: user, project: project) } let(:build) { create(:ci_build, :created, :schedulable, user: user, project: project) }
context 'when ci_enable_scheduled_build is enabled' do context 'when current status is success' do
before do let(:current_status) { 'success' }
stub_feature_flags(ci_enable_scheduled_build: true)
end
context 'when current status is success' do
let(:current_status) { 'success' }
it 'changes the build status' do
expect { subject }.to change { build.status }.to('scheduled')
end
end
context 'when current status is failed' do
let(:current_status) { 'failed' }
it 'does not change the build status' do it 'changes the build status' do
expect { subject }.to change { build.status }.to('skipped') expect { subject }.to change { build.status }.to('scheduled')
end
end end
end end
context 'when ci_enable_scheduled_build is disabled' do context 'when current status is failed' do
before do let(:current_status) { 'failed' }
stub_feature_flags(ci_enable_scheduled_build: false)
end
context 'when current status is success' do
let(:current_status) { 'success' }
it 'changes the build status' do
expect { subject }.to change { build.status }.to('manual')
end
end
context 'when current status is failed' do
let(:current_status) { 'failed' }
it 'does not change the build status' do it 'does not change the build status' do
expect { subject }.to change { build.status }.to('skipped') expect { subject }.to change { build.status }.to('skipped')
end
end end
end end
end end
......
...@@ -7,10 +7,6 @@ describe Ci::RunScheduledBuildService do ...@@ -7,10 +7,6 @@ describe Ci::RunScheduledBuildService do
subject { described_class.new(project, user).execute(build) } subject { described_class.new(project, user).execute(build) }
before do
stub_feature_flags(ci_enable_scheduled_build: true)
end
context 'when user can update build' do context 'when user can update build' do
before do before do
project.add_developer(user) project.add_developer(user)
......
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