2018-08-27 11:26:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-02-18 05:03:46 -05:00
|
|
|
docs_paths_to_review = helper.changes_by_category[:docs]
|
2018-08-27 11:26:28 -04:00
|
|
|
|
|
|
|
unless docs_paths_to_review.empty?
|
2019-02-11 16:19:06 -05:00
|
|
|
message 'This merge request adds or changes files that require a review ' \
|
2019-03-13 05:49:24 -04:00
|
|
|
'from the Technical Writing team.'
|
2018-08-27 11:26:28 -04:00
|
|
|
|
2019-09-06 07:21:53 -04:00
|
|
|
if GitlabDanger.new(helper.gitlab_helper).ci?
|
|
|
|
markdown(<<~MARKDOWN)
|
|
|
|
## Documentation review
|
2018-08-27 11:26:28 -04:00
|
|
|
|
2019-09-06 07:21:53 -04:00
|
|
|
The following files require a review from a technical writer:
|
2018-08-27 11:26:28 -04:00
|
|
|
|
2019-09-06 07:21:53 -04:00
|
|
|
* #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")}
|
2018-08-27 11:26:28 -04:00
|
|
|
|
2019-09-06 07:21:53 -04:00
|
|
|
The review does not need to block merging this merge request. See the:
|
2019-02-11 16:19:06 -05:00
|
|
|
|
2019-09-06 07:21:53 -04:00
|
|
|
- [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
|
2018-08-27 11:26:28 -04:00
|
|
|
|
2019-09-23 02:06:19 -04:00
|
|
|
unless gitlab.mr_labels.include?('documentation')
|
|
|
|
warn 'This merge request is missing the ~documentation label.'
|
2019-09-06 07:21:53 -04:00
|
|
|
end
|
2018-08-27 11:26:28 -04:00
|
|
|
end
|
|
|
|
end
|