diff --git a/changelogs/unreleased/enable-auto-cancelling-by-default.yml b/changelogs/unreleased/enable-auto-cancelling-by-default.yml new file mode 100644 index 0000000000000000000000000000000000000000..8b1659bf38bbc3d73101d7018218d3deefd24520 --- /dev/null +++ b/changelogs/unreleased/enable-auto-cancelling-by-default.yml @@ -0,0 +1,4 @@ +--- +title: Enable cancelling non-HEAD pending pipelines by default for all projects +merge_request: 11023 +author: diff --git a/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb b/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb new file mode 100644 index 0000000000000000000000000000000000000000..03bf626a08a4b3c07e22470e9fcec76b4ceb33d5 --- /dev/null +++ b/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb @@ -0,0 +1,13 @@ +class MakeAutoCancelPendingPipelinesOnByDefault < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + change_column_default(:projects, :auto_cancel_pending_pipelines, 1) + end + + def down + change_column_default(:projects, :auto_cancel_pending_pipelines, 0) + end +end diff --git a/db/migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb b/db/migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb new file mode 100644 index 0000000000000000000000000000000000000000..bc43cd34c4d3c8c51984bd6b81d2f12a66f8bd4f --- /dev/null +++ b/db/migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb @@ -0,0 +1,14 @@ +class EnableAutoCancelPendingPipelinesForAll < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + connection.execute( + 'UPDATE projects SET auto_cancel_pending_pipelines = 1') + end + + def down + # Nothing we can do! + end +end diff --git a/db/schema.rb b/db/schema.rb index 65eaccf766a887d16a6e2a0cbe747ea31f62bed8..e164347a054ff13f2363c6d24234bf52e0613ebc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -986,7 +986,7 @@ ActiveRecord::Schema.define(version: 20170508190732) do t.text "description_html" t.boolean "only_allow_merge_if_all_discussions_are_resolved" t.boolean "printing_merge_request_link_enabled", default: true, null: false - t.integer "auto_cancel_pending_pipelines", default: 0, null: false + t.integer "auto_cancel_pending_pipelines", default: 1, null: false t.string "import_jid" t.integer "cached_markdown_version" t.datetime "last_repository_updated_at"