Mention relevant technical writer in community documentation merge request
Part 2 of #55 (closed)
Add comment mentioning relevant docs reviewer.
The relevant reviewer for docs changes is taken from merge request approval rules based on CODEOWNER file.
When there are individual tech writers in the approval rules, this processor will comment mentioning the tech writers. Otherwise, it would mention the docs team.
Scenarios:
Given CODEOWNERS containing:
[Documentation]
/doc/ `@gl-docsteam`
/doc/development/ `@marcia` `@mjang1`
/doc/development/documentation/ `@cnorris`
[Docs Create]
/doc/user/project/merge_requests/allow_collaboration.md `@marcia`
When MR changes a file listed in CODEOWNERS:
- /doc/user/project/merge_requests/allow_collaboration.md
Then the comment mentions reviewer for the file:
@marcia
When MR changes a file within directory listed in CODEOWNERS:
- /doc/development/documentation/test.md
Then the comment mentions all reviewers:
@cnorris
When MR changes multiple files within directory listed in CODEOWNERS:
- /doc/development/documentation/test.md
- /doc/development/test_2.md
Then the comment mentions all reviewers for the directories:
@marcia
@mjang1
@cnorris
When MR changes a file listed in CODEOWNERS that are not assigned to an individual technical writer:
- /doc/other_file_not_mentioned_in_codeowner.md
Then the comment mentions the docs team:
@gl-docsteam