Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/danger
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-07 12:08:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-07 12:08:57 +0300
commitc417764f00abaa5d2224a50b8d43a15e40ef8790 (patch)
treede2134eec07b27df1770fad10bcd6aa3a52d8f90 /danger
parentcceb99c072e1eac3f144b479ea5909384fa39e7f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'danger')
-rw-r--r--danger/documentation/Dangerfile38
-rw-r--r--danger/roulette/Dangerfile2
2 files changed, 24 insertions, 16 deletions
diff --git a/danger/documentation/Dangerfile b/danger/documentation/Dangerfile
index 1e27f9779e8..1dd6d484968 100644
--- a/danger/documentation/Dangerfile
+++ b/danger/documentation/Dangerfile
@@ -1,27 +1,33 @@
# frozen_string_literal: true
+def gitlab_danger
+ @gitlab_danger ||= GitlabDanger.new(helper.gitlab_helper)
+end
+
docs_paths_to_review = helper.changes_by_category[:docs]
-unless docs_paths_to_review.empty?
- message 'This merge request adds or changes files that require a review ' \
- 'from the Technical Writing team.'
+return if docs_paths_to_review.empty?
+
+message 'This merge request adds or changes files that require a review ' \
+ 'from the Technical Writing team.'
+
+return unless gitlab_danger.ci?
- if GitlabDanger.new(helper.gitlab_helper).ci?
- markdown(<<~MARKDOWN)
- ## Documentation review
+markdown(<<~MARKDOWN)
+ ## Documentation review
- The following files require a review from a technical writer:
+ The following files require a review from a technical writer:
- * #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")}
+ * #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")}
- The review does not need to block merging this merge request. See the:
+ The review does not need to block merging this merge request. See the:
- - [DevOps stages](https://about.gitlab.com/handbook/product/categories/#devops-stages) for the appropriate technical writer for this review.
- - [Documentation workflows](https://docs.gitlab.com/ee/development/documentation/workflow.html) for information on when to assign a merge request for review.
- MARKDOWN
+ - [Technical Writers assignments](https://about.gitlab.com/handbook/engineering/technical-writing/#designated-technical-writers) for the appropriate technical writer for this review.
+ - [Documentation workflows](https://docs.gitlab.com/ee/development/documentation/workflow.html) for information on when to assign a merge request for review.
+MARKDOWN
- unless gitlab.mr_labels.include?('documentation')
- warn 'This merge request is missing the ~documentation label.'
- end
- end
+unless gitlab.mr_labels.include?('documentation')
+ gitlab.api.update_merge_request(gitlab.mr_json['project_id'],
+ gitlab.mr_json['iid'],
+ labels: (gitlab.mr_labels + ['documentation']).join(','))
end
diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile
index a70bc8f561c..64faae1d35b 100644
--- a/danger/roulette/Dangerfile
+++ b/danger/roulette/Dangerfile
@@ -62,6 +62,8 @@ changes = helper.changes_by_category
# Ignore any files that are known but uncategorized. Prompt for any unknown files
changes.delete(:none)
+# To reinstate roulette for documentation, remove this line.
+changes.delete(:docs)
categories = changes.keys - [:unknown]
# Ensure to spin for database reviewer/maintainer when ~database is applied (e.g. to review SQL queries)