Skip to content

Test branch

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!!!


NOTE: This should stay in Merge Requests until fully tested. Implementation contains CI pipeline change, which is triggered everytime a new commit is pushed, which is necessary for testing.

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
1. The creator of the merge request adds on top of merge request description the list of reviewers "REVIEWERS: reviewer 1, reviewer 2, ..., reviewer i, ..., reviewer N"
1. After "reviewer i" agrees with final version of the code, he/she posts it in the comments
1. The creator of the merge request updates the related part of the merge request description to "REVIEWERS: reviewer 1, reviewer 2, ..., reviewer i (changes accepted), ..., reviewer N"
1. Once the creator of the merge request gets agreement from all code reviewers, the merge request is ready to be merged

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 (is not using git), does more and runs faster.

Technical: the docker image used in CI jobs does not contain bash \u0026 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.

Current content of the CODEOWNERS file is for testing purposes ONLY. Example from CBMRoot https://git.cbm.gsi.de/computing/cbmroot/-/blob/master/CODEOWNERS

Related issues to be addressed:

* assigning code ownership
* some devs are having multiple accounts, this is a no go

Edited by Ghost User

Merge request reports

Loading