Use the danger bot for documentation tasks

Description

The danger bot can check the changes of an MR and leave comments based on its content and the associated rules defined in a Dangerfile. This is already implemented for some tasks by other teams, and it would be helpful to implement some docs specific tasks.

Tasks

Workflow-related:

  1. Get it to mention us whenever an MR includes docs changes. https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21395
    1. Add a note in #docs that we can triage (determine who is reviewing) via emoji https://github.com/duck8823/danger-slack
    2. List the names of the tech writer and what product categories they are assigned to. Then the author can pick the right one and ping them directly instead of the whole team. https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22945
    3. Assign the docs-review label automatically when doc changes are noticed. Then the docs team can subscribe to it.
    4. Warn if there's no milestone on a documentation MR; perhaps check this once it has approval and also once it's merged without one.
    5. Detection of /doc-only changes in non-docs branch, and vice versa https://gitlab.com/gitlab-org/gitlab-ce/issues/54490

Tests-related:

  1. Migrate some tests to the bot (?): for example the one that checks for README.md files. Maybe one that looks for bad URL formatting (e.g. a ] without a ( after it?)
  2. Check if the MR has docs-only changes and if the branch is not named after the guidelines, link to them https://docs.gitlab.com/ee/development/documentation/#branch-naming
  3. Check the size of images and compare with pngquant. If there's a difference, link to compress images docs (https://gitlab.com/gitlab-org/gitlab-ce/issues/49587)
  4. Offer a warning when you make changes to EE docs https://gitlab.com/gitlab-org/gitlab-ce/issues/46476#list-of-wrongly-submitted-mrs
Edited by Achilleas Pipinellis