diff --git a/danger/gitaly/Dangerfile b/danger/gitaly/Dangerfile new file mode 100644 index 0000000000000000000000000000000000000000..59e55845c83d2068d7279df369143d5377415996 --- /dev/null +++ b/danger/gitaly/Dangerfile @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +TEMPLATE_MESSAGE = <<~MSG +This merge request requires coordination with gitaly deployments. +Before merging this merge request we should verify that gitaly +running in production already implements the new gRPC interface +included here. + +Failing to do so will introduce a [non backward compatible +change](https://docs.gitlab.com/ee/development/multi_version_compatibility.html) +during canary depoyment that can cause an incident. + +1. Identify the gitaly MR introducing the new interface +1. Verify that the environment widget contains a `gprd` deployment +MSG + +changed_lines = helper.changed_lines('Gemfile.lock') +if changed_lines.any? { |line| line =~ /^\+\s+gitaly \(/ } + warn 'Changing gitaly gem can cause a multi-version incompatibility incident' + + markdown(TEMPLATE_MESSAGE) +end diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb index d2d706fad3f1cf06f5466db37913a4a9245107bd..9c4e9407f907a18f78db24acf917a4413174c283 100644 --- a/spec/tooling/danger/project_helper_spec.rb +++ b/spec/tooling/danger/project_helper_spec.rb @@ -221,7 +221,7 @@ describe '.local_warning_message' do it 'returns an informational message with rules that can run' do - expect(described_class.local_warning_message).to eq('==> Only the following Danger rules can be run locally: changelog, database, datateam, documentation, duplicate_yarn_dependencies, eslint, karma, pajamas, pipeline, prettier, product_intelligence, utility_css') + expect(described_class.local_warning_message).to eq('==> Only the following Danger rules can be run locally: changelog, database, datateam, documentation, duplicate_yarn_dependencies, eslint, gitaly, karma, pajamas, pipeline, prettier, product_intelligence, utility_css') end end diff --git a/tooling/danger/project_helper.rb b/tooling/danger/project_helper.rb index 5e2970169f6cbd8a68a47868972327bbacdac0de..45a53ac2922990b7f3719aea21d97bd808769696 100644 --- a/tooling/danger/project_helper.rb +++ b/tooling/danger/project_helper.rb @@ -10,6 +10,7 @@ module ProjectHelper documentation duplicate_yarn_dependencies eslint + gitaly karma pajamas pipeline