Skip to content
Snippets Groups Projects
Commit 01e06eae authored by Torsten Linz's avatar Torsten Linz Committed by Amy Qualls
Browse files

Revise Torsten's changes and fix problems

Swap out image for an anonymized one that is MUCH smaller in file
size and display size. Rearrange various paragraphs on the page
to make the image flow with the text. Create a new subheading
on the page to explain how to see Code Owners for a file. Bump
the video down so it's not so early in the page. Fix spelling
errors.
parent 7364ae43
No related branches found
No related tags found
1 merge request!112203Improvements to intro to Codeowners documentation
......@@ -8,12 +8,32 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> Moved to GitLab Premium in 13.9.
Code Owners define who develops and maintains a feature, and own the resulting
files or directories in a repository.
Use the Code Owners feature to define who has expertise for specific parts of your project's codebase.
Define the owners of files and directories in a repository to:
- The users you define as Code Owners are displayed in the UI when you browse directories.
- You can set your merge requests so they must be approved by Code Owners before merge.
- You can protect a branch and allow only Code Owners to approve changes to the branch.
- **Require owners to approve changes.** Combine protected branches with Code Owners to require
experts to approve merge requests before they merge into a protected branch.
- **Identify owners.** Code Owner names are displayed on the files and directories they own:
![Code Owners displayed in UI](img/codeowners_in_UI_v15_10.png)
Use Code Owners in combination with merge request
[approval rules](merge_requests/approvals/rules.md) (either optional or required)
to build a flexible approval workflow:
- Use **Code Owners** to ensure quality. Define the users who have domain expertise
for specific paths in your repository.
- Use **Approval rules** to define areas of expertise that don't correspond to specific
file paths in your repository. Approval rules help guide merge request creators to
the correct set of reviewers, such as frontend developers or a security team.
For example:
| Type | Name | Scope | Comment |
|------|------|--------|------------|
| Approval rule | UX | All files | A user experience (UX) team member reviews the user experience of all changes made in your project.
| Approval rule | Security | All files | A security team member reviews all changes for vulnerabilities.
| Code Owner approval rule | Frontend: Code Style | `*.css` files | A frontend engineer reviews CSS file changes for adherence to project style standards.
| Code Owner approval rule | Backend: Code Review | `*.rb` files | A backend engineer reviews the logic and code style of Ruby files.
<div class="video-fallback">
Video introduction: <a href="https://www.youtube.com/watch?v=RoyBySTUSB0">Code Owners</a>.
......@@ -24,38 +44,16 @@ files or directories in a repository.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
Use Code Owners and approvers together with
[approval rules](merge_requests/approvals/rules.md) to build a flexible approval
workflow:
- Use **Code Owners** to define the users who have domain expertise for specific paths in your repository.
- Use **Approvers** and **Approval rules** to define domains of expertise (such as a security team)
that are not scoped to specific file paths in your repository.
- **Approvers** define the users.
- **Approval rules** define when these users can approve work, and whether or not their approval is required.
For example:
## View a file's Code Owner
| Type | Name | Scope | Comment |
|------|------|--------|------------|
| Approval rule | UX | All files | A user experience (UX) team member reviews the user experience of all changes made in your project. |
| Approval rule | Security | All files | A security team member reviews all changes for vulnerabilities. |
| Code Owner approval rule | Frontend: Code Style | `*.css` files | A frontend engineer reviews CSS file changes for adherence to project style standards. |
| Code Owner approval rule | Backend: Code Review | `*.rb` files | A backend engineer reviews the logic and code style of Ruby files. |
To view the Code Owners for a file:
## Code Owners file
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Repository > Files**.
1. Go to the file or directory you want to see the Code Owners for.
1. Optional. Select your desired branch.
A `CODEOWNERS` file (with no extension) specifies the users or
[shared groups](members/share_project_with_groups.md) responsible for
specific files and directories in a repository.
Each repository uses a single `CODEOWNERS` file. GitLab checks these locations
in your repository in this order. The first `CODEOWNERS` file found is used, and
all others are ignored:
1. In the root directory: `./CODEOWNERS`.
1. In the `docs` directory: `./docs/CODEOWNERS`.
1. In the `.gitlab` directory: `./.gitlab/CODEOWNERS`.
GitLab shows the Code Owners at the top of the page.
## Set up Code Owners
......@@ -76,9 +74,21 @@ all others are ignored:
directoryname/ @groupname
```
The Code Owners are now displayed in the UI. They apply to the current branch only.
### Code Owners file
A `CODEOWNERS` file (with no extension) specifies the users or
[shared groups](members/share_project_with_groups.md) responsible for
specific files and directories in a repository.
Each repository uses a single `CODEOWNERS` file. GitLab checks these locations
in your repository in this order. The first `CODEOWNERS` file found is used, and
all others are ignored:
1. In the root directory: `./CODEOWNERS`.
1. In the `docs` directory: `./docs/CODEOWNERS`.
1. In the `.gitlab` directory: `./.gitlab/CODEOWNERS`.
Next steps:
### Make Code Owners eligible approvers or require their approval of MRs
- [Add Code Owners as merge request approvers](merge_requests/approvals/rules.md#code-owners-as-eligible-approvers).
- Set up [Code Owner approval on a protected branch](protected_branches.md#require-code-owner-approval-on-a-protected-branch).
......
doc/user/project/img/codeowners_in_UI_v15_10.png

10.3 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment