Codeowners: Assign TW with more than 50% page ownership to directory
In !99228 (merged) the codeowners for Technical Writing were updated again. The problem with the rake task expanding all sections with not 100% ownership was very visible in it again.
Therefore, here is the proposal to update the rake task to assign the TW which owns more than 50% of the pages in a directory to the directory instead of the individual files.
This will reduce the required work to collapse these sections again and therefore results in a smaller codeowners section.
Original comment here: !99228 (comment 1119095279)
The CODEOWNERS
file uses a "last match found" system, so you can set a whole directory first, then list exceptions after it. If a file is in the directory, and not listed later, GitLab uses the directory's DRI. If the file is listed later, GitLab uses the file-specific DRI instead. For example:
-
Before:
/doc/administration/monitoring/prometheus/gitlab_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/gitlab_metrics.md @msedlakjakubowski /doc/administration/monitoring/prometheus/index.md @axil /doc/administration/monitoring/prometheus/node_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/pgbouncer_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/postgres_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/redis_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/registry_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/web_exporter.md @sselhorn
-
After,
@msedlakjakubowski
is the DRI for all files in the directory, except the files listed after it./doc/administration/monitoring/prometheus/ @msedlakjakubowski /doc/administration/monitoring/prometheus/index.md @axil /doc/administration/monitoring/prometheus/web_exporter.md @sselhorn
Rake task
https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/tasks/gitlab/tw/codeowners.rake
Related issues
These issues and MRs describe the evolution of the CODEOWNERS project for the Technical Writing team, from the initial idea through multiple (!) iterations to a finished product. These links may have been added significantly after this issue or merge request was closed, so they may describe parts of the process before or after this work.
- Related to Create rake task for docs CODEOWNERS (!77715 - merged) where Amy had an idea
- Related to Update CODEOWNERS to include TW assignments for... (!77606 - merged) where we asked for the raw output of the Rake task to be added into the CODEOWNERS file. This rake task would give the TW team a way to periodically generate a full list of owned pages.
- Related to Expand CODEOWNERS with more documentation DRIs (#349587 - closed) where Marcel noted many pages needed a DRI declared
- Related to Update CODEOWNERS to include TW assignments for... (!77606 - merged) where we started manually shortening the results
- Related to Refine how to run batch updates for the CODEOWN... (technical-writing#668 - closed) where we started figuring out how to run batch updates
- Related to Codeowners: Assign TW with more than 50% page o... (#375783 - closed) where we started automating the process of shortening and condensing the results
- Related to Document tw::codeowners rake task (technical-writing#598 - closed) where we documented the task
- Related to Release Post 15.7 MVP Nominations (gitlab-com/www-gitlab-com#14283 - closed) where Niklas was nominated as MVP for the months of iteration needed to bring this script to a full, workable state