Sample content of the CODEOWNERS

The following represents a basic set of rules concerning the CODEOWNERS based on the authors of this book. Feel free to adjust it to your own team. The important point to note here is that the last pattern to match will be the one used to identify the owners who need to perform the review. As such, we must be careful as to the order of the rules:

# In this example, documentation and Header.txt are part # of the default match. Default owners if nothing else 
# matches.
* @ldesrosi
# Code related should be validated by Rama.
# JavaScripts files could have been separated
# into tests versus logic by using folder's structure
*.qry @rama
*.acl @rama
*.cto @rama
*.js @rama
# Package.json should be reviewed by everyone
package.json @ldesrosi @rama @ODOWDAIBM

Instead of listing each individual member of the team in the rules, we could have used the concept of GitHub teams to assign the code ownership.

With the CODEOWNERS defined, we can now focus on submitting it to the master branch. Using a command-line prompt, go through the following steps:

  1. Navigate to the location of the clone of your repository
  2. Create a new directory called .Github
  3. Change directory to the newly created directory
  4. Create the CODEOWNERS file according to the content defined in the previous section
  5. Commit the new file and directory:
        Git add -A
Git commit -m "Setting initial code ownership."
  1. Push the commits to the master branch:
        Git push
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.28.107