Remove ci_enable_scheduled_build feature flag
This commit is contained in:
parent
c0d30fad97
commit
84ec7137c5
5 changed files with 14 additions and 54 deletions
|
@ -259,8 +259,7 @@ module Ci
|
|||
end
|
||||
|
||||
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
|
||||
|
||||
def options_scheduled_at
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Remove `ci_enable_scheduled_build` feature flag
|
||||
merge_request: 22742
|
||||
author:
|
||||
type: other
|
|
@ -216,14 +216,6 @@ describe Ci::Build do
|
|||
let(:build) { create(:ci_build, :created, :schedulable, project: project) }
|
||||
|
||||
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
|
||||
|
||||
context 'when build is not schedulable' do
|
||||
|
@ -327,10 +319,6 @@ describe Ci::Build do
|
|||
describe '#enqueue_scheduled' do
|
||||
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
|
||||
let(:build) { create(:ci_build, :scheduled, pipeline: pipeline) }
|
||||
|
||||
|
|
|
@ -98,47 +98,19 @@ describe Ci::ProcessBuildService, '#execute' do
|
|||
|
||||
let(:build) { create(:ci_build, :created, :schedulable, user: user, project: project) }
|
||||
|
||||
context 'when ci_enable_scheduled_build is enabled' do
|
||||
before do
|
||||
stub_feature_flags(ci_enable_scheduled_build: true)
|
||||
end
|
||||
context 'when current status is success' do
|
||||
let(:current_status) { 'success' }
|
||||
|
||||
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
|
||||
expect { subject }.to change { build.status }.to('skipped')
|
||||
end
|
||||
it 'changes the build status' do
|
||||
expect { subject }.to change { build.status }.to('scheduled')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when ci_enable_scheduled_build is disabled' do
|
||||
before do
|
||||
stub_feature_flags(ci_enable_scheduled_build: false)
|
||||
end
|
||||
context 'when current status is failed' do
|
||||
let(:current_status) { 'failed' }
|
||||
|
||||
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
|
||||
expect { subject }.to change { build.status }.to('skipped')
|
||||
end
|
||||
it 'does not change the build status' do
|
||||
expect { subject }.to change { build.status }.to('skipped')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,10 +7,6 @@ describe Ci::RunScheduledBuildService do
|
|||
|
||||
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
|
||||
before do
|
||||
project.add_developer(user)
|
||||
|
|
Loading…
Reference in a new issue