summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-05-01 10:14:27 +0000
committerSean McGivern <sean@gitlab.com>2019-05-01 10:14:27 +0000
commitd7b75b661f8ed2468a322c4ae55eadcbdb3b2615 (patch)
tree7d847363139ff758f036152b9e129e8862b6d980
parent0220e83666ad182118946eba5128a0cfea70f054 (diff)
parente51912543c24c2dcf25b2c8d775fc5f57f85e639 (diff)
downloadgitlab-ce-d7b75b661f8ed2468a322c4ae55eadcbdb3b2615.tar.gz
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
-rw-r--r--db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb17
-rw-r--r--db/schema.rb1
-rw-r--r--spec/models/merge_request_spec.rb2
3 files changed, 19 insertions, 1 deletions
diff --git a/db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb b/db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb
new file mode 100644
index 00000000000..eb0e7c41f98
--- /dev/null
+++ b/db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb
@@ -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
diff --git a/db/schema.rb b/db/schema.rb
index 5a486b369e3..2e77bbb51e5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1612,6 +1612,7 @@ ActiveRecord::Schema.define(version: 20190426180107) do
t.integer "project_id", null: false
t.boolean "group_runners_enabled", default: true, null: false
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
end
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index fb7f43b25cf..7457efef013 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -2123,7 +2123,7 @@ describe MergeRequest do
end
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
before do