- Enforce code ownership on different parts of the project
- Specially helpful for MonoRepo microservice based system
- Get all opened PRs
git pull
the destination branch- Parse the CODEOWNERS file (from DESTINATION branch)
git pull
the source branch- Find changes between source and destination branches
- Find code owners for the changes and add them to the PR as revieweres
- If added, send them a notification
- Very much like GitHub's CODEOWNER file
- Should be placed in the root of your repo, file name: CODEOWNERS (can be changed in the settings 'codeowners_filename')
- You can use "#" for comments
- Order of the items is important, last one wins
- Use "*" followed by usernames for "default owners"
# Default codeowner for the project
* @project_owner
# Specific owner for changes on "service_1/" directory (and everything inside)
service_1/ @service_1_owner
-
Pull Request source:
- Azure DevOps
-
Notifications:
- RocketChat
- Can use environment variables to override file 'appsettings.json'
- Can use any of these:
- {username}: RocketChat username
- {pr_url}: PullRequest URL
- {pr_name}: PullRequest Name
- {pr_description}: PullRequest Description
- {pr_id}: PullRequest unique id
- {pr_reviewers}: List of reviewers, separated by comma
- {pr_destination_branch}: PullRequest Destionation branch
- {pr_source_branch}: PullRequest Source branch
- {pr_repository}: PullRequest repository
- Create a PAT (Personal Access Token) with the following permissions:
- Code: Read & Write
- Graph: Read
- Identity: Read
- Create a user (or use an existing one)
- Should have at least "user" permission (no need for bot/app)
- Fork it (https://github.com/javitolin/CodeOwners/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
- AsadoDevCulture
- @jdorfsman
- Distributed under the MIT license.