summaryrefslogtreecommitdiff
path: root/danger/documentation/Dangerfile
blob: 188331cc87c10a46a78a7cf15f9db66a59185aa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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

docs_paths_to_review = docs_paths_requiring_review(helper.all_changed_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* ")}

When your content is ready for review, assign the MR to a technical writer
according to the [DevOps stages](https://about.gitlab.com/handbook/product/categories/#devops-stages)
in the table below. If necessary, mention them in a comment explaining what needs
to be reviewed.

| Tech writer  | Stage(s)                                                     |
| ------------ | ------------------------------------------------------------ |
| `@marcia`    | ~Create ~Release + ~"development guidelines"                 |
| `@axil`      | ~Distribution ~Gitaly ~Gitter ~Monitor ~Package ~Secure |
| `@eread`     | ~Manage ~Configure ~Geo ~Verify                              |
| `@mikelewis` | ~Plan                                                        |

You are welcome to mention them sooner if you have questions about writing or
updating the documentation. GitLabbers are also welcome to use the
[#docs](https://gitlab.slack.com/archives/C16HYA2P5) channel on Slack.

If you are not sure which category the change falls within, or the change is not
part of one of these categories, mention one of the usernames above.
  MARKDOWN

  unless gitlab.mr_labels.include?('Documentation')
    warn 'This merge request is missing the ~Documentation label.'
  end
end