Merge branch 'add-project-level-config-for-merge-train-ce' into 'master'

CE Backport: Add project level config for merge train

See merge request gitlab-org/gitlab-ce!27819
This commit is contained in:
Sean McGivern 2019-05-01 10:14:27 +00:00
commit d7b75b661f
3 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddMergeTrainEnabledToCiCdSettings < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default :project_ci_cd_settings, :merge_trains_enabled, :boolean, default: false, allow_null: false
end
def down
remove_column :project_ci_cd_settings, :merge_trains_enabled
end
end

View file

@ -1612,6 +1612,7 @@ ActiveRecord::Schema.define(version: 20190426180107) do
t.integer "project_id", null: false t.integer "project_id", null: false
t.boolean "group_runners_enabled", default: true, null: false t.boolean "group_runners_enabled", default: true, null: false
t.boolean "merge_pipelines_enabled" t.boolean "merge_pipelines_enabled"
t.boolean "merge_trains_enabled", default: false, null: false
t.index ["project_id"], name: "index_project_ci_cd_settings_on_project_id", unique: true, using: :btree t.index ["project_id"], name: "index_project_ci_cd_settings_on_project_id", unique: true, using: :btree
end end

View file

@ -2123,7 +2123,7 @@ describe MergeRequest do
end end
context 'when merges are not restricted to green builds' do context 'when merges are not restricted to green builds' do
subject { build(:merge_request, target_project: build(:project, only_allow_merge_if_pipeline_succeeds: false)) } subject { build(:merge_request, target_project: create(:project, only_allow_merge_if_pipeline_succeeds: false)) }
context 'and a failed pipeline is associated' do context 'and a failed pipeline is associated' do
before do before do