From 48aff82709769b098321c738f3444b9bdaa694c6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Oct 2020 07:08:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-5-stable-ee --- danger/ci_templates/Dangerfile | 30 +++++++++++++++ danger/documentation/Dangerfile | 3 +- danger/metadata/Dangerfile | 7 ---- danger/pajamas/Dangerfile | 65 +++++++++++++++++++++++++++------ danger/product_analytics/Dangerfile | 48 ++++++++++++++++++++++++ danger/specialization_labels/Dangerfile | 3 +- danger/telemetry/Dangerfile | 38 ------------------- 7 files changed, 135 insertions(+), 59 deletions(-) create mode 100644 danger/ci_templates/Dangerfile create mode 100644 danger/product_analytics/Dangerfile delete mode 100644 danger/telemetry/Dangerfile (limited to 'danger') diff --git a/danger/ci_templates/Dangerfile b/danger/ci_templates/Dangerfile new file mode 100644 index 00000000000..34b4bbff7a5 --- /dev/null +++ b/danger/ci_templates/Dangerfile @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +gitlab_danger = GitlabDanger.new(helper.gitlab_helper) + +TEMPLATE_MESSAGE = <<~MSG +This merge request requires a CI/CD Template review. To make sure these +changes are reviewed, take the following steps: + +1. Ensure the merge request has the ~"ci::templates" label. + If the merge request modifies CI/CD Template files, Danger will do this for you. +1. Prepare your MR for a CI/CD Template review according to the + [template development guide](https://docs.gitlab.com/ee/development/cicd/templates.html). +1. Assign and `@` mention the CI/CD Template reviewer suggested by Reviewer Roulette. +MSG + +TEMPLATE_FILES_MESSAGE = <<~MSG +The following files require a review from the CI/CD Templates maintainers: +MSG + +return unless gitlab_danger.ci? + +template_paths_to_review = helper.changes_by_category[:ci_template] + +if gitlab.mr_labels.include?('ci::templates') || template_paths_to_review.any? + message 'This merge request adds or changes files that require a ' \ + 'review from the CI/CD Templates maintainers.' + + markdown(TEMPLATE_MESSAGE) + markdown(TEMPLATE_FILES_MESSAGE + helper.markdown_list(template_paths_to_review)) if template_paths_to_review.any? +end diff --git a/danger/documentation/Dangerfile b/danger/documentation/Dangerfile index 16d22969fbd..dc43e9d1843 100644 --- a/danger/documentation/Dangerfile +++ b/danger/documentation/Dangerfile @@ -8,8 +8,7 @@ docs_paths_to_review = helper.changes_by_category[:docs] return if docs_paths_to_review.empty? -message 'This merge request adds or changes files that require a review ' \ - 'from the Technical Writing team.' +message 'This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is **recommended**. Reviews can happen after you merge.' return unless gitlab_danger.ci? diff --git a/danger/metadata/Dangerfile b/danger/metadata/Dangerfile index 1d7f863c201..b98d10d0654 100644 --- a/danger/metadata/Dangerfile +++ b/danger/metadata/Dangerfile @@ -40,10 +40,3 @@ has_pick_into_stable_label = gitlab.mr_labels.find { |label| label.start_with?(' if gitlab.branch_for_base != "master" && !has_pick_into_stable_label && !helper.security_mr? warn "Most of the time, merge requests should target `master`. Otherwise, please set the relevant `Pick into X.Y` label." end - -if gitlab.mr_json['title'].length > 72 - warn 'The title of this merge request is longer than 72 characters and ' \ - 'would violate our commit message rules when using the Squash on Merge ' \ - 'feature. Please consider adjusting the title, or rebase the ' \ - "commits manually and don't use Squash on Merge." -end diff --git a/danger/pajamas/Dangerfile b/danger/pajamas/Dangerfile index 34dcbc21941..36bf7672cbf 100644 --- a/danger/pajamas/Dangerfile +++ b/danger/pajamas/Dangerfile @@ -1,15 +1,43 @@ # frozen_string_literal: true +# rubocop:disable Style/SignalException PATTERNS = %w[ + %a.btn.btn- + %button.btn.btn- + .alert + .alert-danger + .alert-dismissible + .alert-info + .alert-link + .alert-primary + .alert-success + .alert-warning + .nav-tabs + .toolbar-button-icon + .tooltip + .tooltip-inner +