Skip to content

CodeOwners implementation for MPDroot

Slavomir Hnatic requested to merge codeOwners into dev

This change was approved by its assigned codeOwners (roleg, hnatics) and is ready to be merged into dev.

DO NOT REMOVE THIS BOXED MESSAGE

Code in this merge request is subject to review by Code Owners.
The list of reviewers is posted in the comments section.
After all of the code is approved, please put a brief notice about it at the beginning of this message.

NOTE: Merging this code without getting it approved by Code Owners will result in suspending your developer rights!!!

Initial version of CODEOWNERS functionality for MPDRoot

Adapted, modified and improved from GSI (credits to CbmRoot devs for basic ideas)

  • works only in merge requests CI pipeline jobs
  • the script takes all merge request changes from Gitlab API and generates their owners using info from CODEOWNERS file
  • automatization is run by the "CodeOwners Admin" bot: it adds the CodeOwners label to merge request, puts explanatory message at the top of merge request description and posts note into comment section for owners to review the code (detailed list of files is in the CI job log, but the owners should know which files are theirs)
  • if during the merge request approval process the owners change due to some new commits, then the new comment to review the code is posted with changed owners

Suggested Workflow of the code approval:

  1. The comment about the code ownership is posted into "comments section" after successful CI job along with the boxed comment at the top of the description
  2. The reviewers add their approvals by clicking on the "Approve" button
  3. Once the creator of the merge request gets agreement from all code reviewers, he/she post the short message about it at the top of description. The merge request is ready to be merged now.

Notes: The codeowners functionality should be run in last stage of CI pipeline (owners should not be bothered by requests that fail the pipeline). I had to quite change the original GSI version to make it work for us, so please test. This implementation is simpler in a sense that it takes all information from Gitlab and not git, and has some additional functionality implemented.

Technical: the docker image used in CI jobs does not contain bash & curl, needed for this feature to work. Currently, these packages must be downloaded and installed each time a pipeline job is run. This is undesired as there might be some unexpected compatibility breaks or bugs associated with new versions in the future. I suggest to add stable working versions into default docker image.

The CODEOWNERS file is not complete yet, but already usable. Example from CBMRoot https://git.cbm.gsi.de/computing/cbmroot/-/blob/master/CODEOWNERS Related issues to be addressed:

  • assigning remaining code ownership
  • some devs are having multiple accounts, this is a no go
Edited by Slavomir Hnatic

Merge request reports