Add reviewers automatically based on MAINTAINERS data
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Released
|
High
|
Alexander Charykov |
Bug Description
We need a script which will, on every patch uploaded to Gerrit, add reviewers automatically based on data in MAINTAINERS file(s).
Please see following two patches with introduction of MAINTAINERS files, and follow links provided in commit messages for further details.
https:/
https:/
Example:
commit is made to fuel-web/
Script has to search for MAINTAINERS file in all folders, starting from the folder where files were changed.
The logic should be the following:
- if there is a MAINTAINERS file in fuel-web/
- if there is no MAINTAINERS file fuel-web/
- continue going up if needed. Do nothing, if file not found or there is no 'maintainers' section in the file.
Two notes:
- there are can be MAINTAINERS files on a few levels of hierarchy. We need to take maintainers only from one file, which is found first (do not collect all). We want only specific subject matters to be added if those defined, not core reviewers / maintainers of the whole module
- if several files are touched by commit, ensure to check MAINTAINERS file for each separately (don't stop on first file). We want to find all subject matter experts.
tags: | added: tools |
Changed in fuel: | |
status: | New → Triaged |
Changed in fuel: | |
assignee: | Fuel DevOps (fuel-devops) → Alexander Charykov (acharykov) |
status: | Triaged → In Progress |
Changed in fuel: | |
status: | In Progress → Confirmed |
assignee: | Alexander Charykov (acharykov) → Fuel DevOps (fuel-devops) |
tags: | added: area-devops |
Changed in fuel: | |
assignee: | Fuel DevOps (fuel-devops) → Alexander Charykov (acharykov) |
tags: |
added: area-apps removed: area-devops tools |
tags: |
added: area-infra-apps removed: area-apps |
MAINTAINERS in different reviews has different format.
I think that MAINTAINERS on top level will have list with dict of repo:
On top level:
{ 'maintainers':
[{'fuelmenu/':
[{'IRC': 'mattymo',
'email': '<email address hidden>',
'name': 'Matthew Mosesohn'},
{'IRC': 'mattymo',
'email': '<email address hidden>',
'name': 'Matthew Mosesohn'}],
},
{'docs/':
[{'IRC': 'mattymo',
'email': '<email address hidden>',
'name': 'Matthew Mosesohn'},
{ 'email': '<email address hidden>',
'name': 'User2'}],
}]}
In subfolders:
{'maintainers': [{
'IRC': 'mattymo',
'email': '<email address hidden>',
'name': 'Matthew Mosesohn'
},
{
'email': '<email address hidden>',
'name': 'User2'
}]}