diff options
author | Toon Claes <toon@gitlab.com> | 2019-07-19 17:33:48 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-07-19 17:33:48 +0000 |
commit | 34a5f77e770765f278ade00a33ef846e2e1ce3d3 (patch) | |
tree | 11f08d25e84c62a2c0f42247f71f76f1ab016012 /lib | |
parent | 325360444253cf630ae3bfb6cae47a1e6e612c79 (diff) | |
download | gitlab-ce-34a5f77e770765f278ade00a33ef846e2e1ce3d3.tar.gz |
Document database review process
See https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6069
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/danger/helper.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/gitlab/danger/helper.rb b/lib/gitlab/danger/helper.rb index 0fc145534bf..c0a12318990 100644 --- a/lib/gitlab/danger/helper.rb +++ b/lib/gitlab/danger/helper.rb @@ -46,6 +46,16 @@ module Gitlab ee? ? 'gitlab-ee' : 'gitlab-ce' end + def markdown_list(items) + list = items.map { |item| "* `#{item}`" }.join("\n") + + if items.size > 10 + "\n<details>\n\n#{list}\n\n</details>\n" + else + list + end + end + # @return [Hash<String,Array<String>>] def changes_by_category all_changed_files.each_with_object(Hash.new { |h, k| h[k] = [] }) do |file, hash| @@ -132,6 +142,22 @@ module Gitlab def new_teammates(usernames) usernames.map { |u| Gitlab::Danger::Teammate.new('username' => u) } end + + def missing_database_labels(current_mr_labels) + labels = if has_database_scoped_labels?(current_mr_labels) + ['database'] + else + ['database', 'database::review pending'] + end + + labels - current_mr_labels + end + + private + + def has_database_scoped_labels?(current_mr_labels) + current_mr_labels.any? { |label| label.start_with?('database::') } + end end end end |