Commit 84ec7137 authored by Shinya Maeda's avatar Shinya Maeda Committed by Kamil Trzciński

Remove ci_enable_scheduled_build feature flag

parent c0d30fad
......@@ -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
......
---
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' }
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' }
context 'when current status is success' do
let(:current_status) { 'success' }
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 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' }
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)
......
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