diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-08-27 17:26:28 +0200 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-09-06 10:50:35 +0200 |
commit | b1b55371c611b66c8bfe482dc0544fce39a0bf9c (patch) | |
tree | 02b9bcb67e79dcf4d825d2bbd4fc7a7f38a4e53f /danger/documentation | |
parent | b64ba567ff4409a9e10f764297ea110023d4aec8 (diff) | |
download | gitlab-ce-b1b55371c611b66c8bfe482dc0544fce39a0bf9c.tar.gz |
Add Documentation Dangerfile
Every time a doc change is made, a comment to
ping the @gl-docsteam is added.
Diffstat (limited to 'danger/documentation')
-rw-r--r-- | danger/documentation/Dangerfile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/danger/documentation/Dangerfile b/danger/documentation/Dangerfile new file mode 100644 index 00000000000..d65bec123a9 --- /dev/null +++ b/danger/documentation/Dangerfile @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# All the files/directories that should be reviewed by the Docs team. +DOCS_FILES = [ + 'doc/' +].freeze + +def docs_paths_requiring_review(files) + files.select do |file| + DOCS_FILES.any? { |pattern| file.start_with?(pattern) } + end +end + +all_files = git.added_files + git.modified_files + +docs_paths_to_review = docs_paths_requiring_review(all_files) + +unless docs_paths_to_review.empty? + message 'This merge request adds or changes files that require a ' \ + 'review from the docs team.' + + markdown(<<~MARKDOWN) +## Docs Review + +The following files require a review from the Documentation team: + +* #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")} + +To make sure these changes are reviewed, mention `@gl-docsteam` in a separate +comment, and explain what needs to be reviewed by the team. Please don't mention +the team until your changes are ready for review. + MARKDOWN + + unless gitlab.mr_labels.include?('Documentation') + warn 'This merge request is missing the ~Documentation label.' + end +end |