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
diff options
context:
space:
mode:
authorMike Lewis <mlewis@gitlab.com>2018-09-08 00:18:36 +0300
committerMike Lewis <mlewis@gitlab.com>2018-09-08 00:18:36 +0300
commit79322c3c93177a722aba8e1bcb6e8684b074e162 (patch)
tree4f4b7582fdc0ede5ceb04c4e9954ee7f19d98d87
parent15c87796ecac4c4148148eaf927056c7adc08623 (diff)
parentb1b55371c611b66c8bfe482dc0544fce39a0bf9c (diff)
Merge branch 'docs/dangerfile' into 'master'
Add Documentation Dangerfile See merge request gitlab-org/gitlab-ce!21395
-rw-r--r--Dangerfile1
-rw-r--r--danger/documentation/Dangerfile37
-rw-r--r--doc/development/documentation/index.md9
3 files changed, 47 insertions, 0 deletions
diff --git a/Dangerfile b/Dangerfile
index 9217610da8b..f57fcd16496 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -4,4 +4,5 @@ danger.import_dangerfile(path: 'danger/changelog')
danger.import_dangerfile(path: 'danger/specs')
danger.import_dangerfile(path: 'danger/gemfile')
danger.import_dangerfile(path: 'danger/database')
+danger.import_dangerfile(path: 'danger/documentation')
danger.import_dangerfile(path: 'danger/frozen_string')
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
diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md
index f46c171d9f1..7ac211ed550 100644
--- a/doc/development/documentation/index.md
+++ b/doc/development/documentation/index.md
@@ -257,6 +257,15 @@ choices:
If your branch name matches any of the above, it will run only the docs
tests. If it doesn't, the whole test suite will run (including docs).
+## Danger bot
+
+GitLab uses [danger bot](https://github.com/danger/danger) for some elements in
+code review. For docs changes in merge requests, the following actions are taken:
+
+1. Whenever a change under `/doc` is made, the bot leaves a comment for the
+ author to mention `@gl-docsteam`, so that the docs can be properly
+ reviewed.
+
## Merge requests for GitLab documentation
Before getting started, make sure you read the introductory section