diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 12:52:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 12:52:10 +0000 |
commit | dba864470fbcbb6bdd5b94eb510acdce62c962d8 (patch) | |
tree | e8ead0b84e7b814f5891d2c8cd3db2d6b635fb64 /danger | |
parent | b7d29500f28ff59c8898cdf889a40d3da908f162 (diff) | |
download | gitlab-ce-dba864470fbcbb6bdd5b94eb510acdce62c962d8.tar.gz |
Add latest changes from gitlab-org/gitlab@12-8-stable-ee
Diffstat (limited to 'danger')
-rw-r--r-- | danger/commit_messages/Dangerfile | 4 | ||||
-rw-r--r-- | danger/roulette/Dangerfile | 8 | ||||
-rw-r--r-- | danger/single_codebase/Dangerfile | 63 |
3 files changed, 7 insertions, 68 deletions
diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile index d6eb050930c..2db49f60710 100644 --- a/danger/commit_messages/Dangerfile +++ b/danger/commit_messages/Dangerfile @@ -89,9 +89,9 @@ def lint_commits(commits) end if squash_mr? - multi_line_commit_linter = commit_linters.detect { |commit_linter| commit_linter.multi_line? } + multi_line_commit_linter = commit_linters.detect { |commit_linter| !commit_linter.merge? && commit_linter.multi_line? } - if multi_line_commit_linter && multi_line_commit_linter.lint.failed? + if multi_line_commit_linter && multi_line_commit_linter.failed? warn_or_fail_commits(multi_line_commit_linter) fail_message('The commit message that will be used in the squash commit does not meet our Git commit message standards.') else diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile index 173cf4e0ea2..d07d652e601 100644 --- a/danger/roulette/Dangerfile +++ b/danger/roulette/Dangerfile @@ -16,6 +16,10 @@ To spread load more evenly across eligible reviewers, Danger has randomly picked a candidate for each review slot. Feel free to override this selection if you think someone else would be better-suited, or the chosen person is unavailable. +To read more on how to use the reviewer roulette, please take a look at the +[Engineering workflow](https://about.gitlab.com/handbook/engineering/workflow/#basics) +and [code review guidelines](https://docs.gitlab.com/ee/development/code_review.html). + Once you've decided who will review this merge request, mention them as you normally would! Danger does not (yet?) automatically notify them for you. @@ -64,11 +68,9 @@ categories = changes.keys - [:unknown] # Ensure to spin for database reviewer/maintainer when ~database is applied (e.g. to review SQL queries) categories << :database if gitlab.mr_labels.include?('database') && !categories.include?(:database) -# Single codebase MRs are reviewed using a slightly different process, so we -# disable the review roulette for such MRs. # CSS Clean up MRs are reviewed using a slightly different process, so we # disable the review roulette for such MRs. -if changes.any? && !gitlab.mr_labels.include?('single codebase') && !gitlab.mr_labels.include?('CSS cleanup') +if changes.any? && !gitlab.mr_labels.include?('CSS cleanup') # Strip leading and trailing CE/EE markers canonical_branch_name = roulette.canonical_branch_name(gitlab.mr_json['source_branch']) diff --git a/danger/single_codebase/Dangerfile b/danger/single_codebase/Dangerfile deleted file mode 100644 index f371a42e9b1..00000000000 --- a/danger/single_codebase/Dangerfile +++ /dev/null @@ -1,63 +0,0 @@ -FRONTEND_MAINTAINERS = %w[filipa iamphill].freeze -BACKEND_MAINTAINERS = %w[rspeicher rymai yorickpeterse godfat].freeze -NO_REVIEWER = 'No reviewer available'.freeze - -def mention_single_codebase_approvers - canonical_branch_name = - roulette.canonical_branch_name(gitlab.mr_json['source_branch']) - - random = roulette.new_random(canonical_branch_name) - - frontend_maintainers = helper.new_teammates(FRONTEND_MAINTAINERS) - backend_maintainers = helper.new_teammates(BACKEND_MAINTAINERS) - - rows = [] - - if gitlab.mr_labels.include?('frontend') - frontend_maintainer = - roulette.spin_for_person(frontend_maintainers, random: random) - - rows << "| ~frontend | #{frontend_maintainer&.markdown_name || NO_REVIEWER}" - end - - if gitlab.mr_labels.include?('backend') - backend_maintainer = - roulette.spin_for_person(backend_maintainers, random: random) - - rows << "| ~backend | #{backend_maintainer&.markdown_name || NO_REVIEWER}" - end - - if rows.empty? - backup_maintainer = backend_maintainers.sample - - rows << "| ~frontend / ~backend | #{backup_maintainer.markdown_name}" - end - - markdown(<<~MARKDOWN.strip) - ## Single codebase changes - - This merge request contains changes related to the work of moving towards a - [single codebase](https://gitlab.com/groups/gitlab-org/-/epics/802) for - Community Edition and Enterprise Edition. These changes will need to be - reviewed and approved by the following engineers: - - | Category | Reviewer - |----------|--------- - #{rows.join("\n")} - - To make sure this happens, please follow these steps: - - 1. Add all of the mentioned users to the list of merge request approvals. - 2. Assign the merge request to the first person in the above list. - - If you are a reviewer, please follow these steps: - - 1. Review the merge request. If it is good to go, approve it. - 2. Once approved, assign to the next person in the above list. If you are - the last person in the list, merge the merge request. - MARKDOWN -end - -if gitlab.mr_labels.include?('single codebase') - mention_single_codebase_approvers -end |