2018-08-27 11:26:28 -04:00
# frozen_string_literal: true
2020-10-21 08:08:47 -04:00
def feature_mr?
2021-03-12 07:09:33 -05:00
( helper . mr_labels & %w[ feature::addition feature::enhancement ] ) . any?
2020-10-21 08:08:47 -04:00
end
DOCUMENTATION_UPDATE_MISSING = << ~ MSG
2022-03-08 04:17:44 -05:00
~ " feature::addition " and ~ " feature::enhancement " merge requests normally have a documentation change . Consider adding a documentation update or confirming the documentation plan with the [ Technical Writer counterpart ] ( https : / / about . gitlab . com / handbook / engineering / ux / technical - writing / #assignments).
2020-10-21 08:08:47 -04:00
For more information , see :
2021-08-26 05:11:15 -04:00
- The Handbook page on [ merge request types ] ( https : / / about . gitlab . com / handbook / engineering / metrics / #work-type-classification).
2020-10-21 08:08:47 -04:00
- The [ definition of done ] ( https : / / docs . gitlab . com / ee / development / contributing / merge_request_workflow . html #definition-of-done) documentation.
MSG
2021-12-03 10:10:36 -05:00
docs_paths_to_review = helper . changes_by_category [ :docs ]
2018-08-27 11:26:28 -04:00
2020-10-21 08:08:47 -04:00
# Documentation should be updated for feature::addition and feature::enhancement
if docs_paths_to_review . empty?
warn ( DOCUMENTATION_UPDATE_MISSING ) if feature_mr?
return
end
2020-07-07 05:08:57 -04:00
2020-10-13 14:08:58 -04:00
message 'This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is **recommended**. Reviews can happen after you merge.'
2020-07-07 05:08:57 -04:00
2021-03-12 07:09:33 -05:00
return unless helper . ci?
2018-08-27 11:26:28 -04:00
2020-07-07 05:08:57 -04:00
markdown ( << ~ MARKDOWN )
## Documentation review
2018-08-27 11:26:28 -04:00
2020-07-07 05:08:57 -04:00
The following files require a review from a technical writer :
2018-08-27 11:26:28 -04:00
2020-07-07 05:08:57 -04:00
* #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")}
2018-08-27 11:26:28 -04:00
2020-07-07 05:08:57 -04:00
The review does not need to block merging this merge request . See the :
2019-02-11 16:19:06 -05:00
2021-03-09 07:08:52 -05:00
- [ Metadata for the ` *.md ` files ] ( https : / / docs . gitlab . com / ee / development / documentation / #metadata) that you've changed. The first few lines of each `*.md` file identify the stage and group most closely associated with your docs change.
2022-03-08 04:17:44 -05:00
- The [ Technical Writer assigned ] ( https : / / about . gitlab . com / handbook / engineering / technical - writing / #assignments) for that stage and group.
2020-07-07 05:08:57 -04:00
- [ Documentation workflows ] ( https : / / docs . gitlab . com / ee / development / documentation / workflow . html ) for information on when to assign a merge request for review .
MARKDOWN