Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
容器镜像库
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
d509a235
提交
d509a235
编辑于
7 months ago
作者:
Brendan Lynch
浏览文件
操作
下载
补丁
差异文件
Move Code Owners troubleshooting to new page
上级
8e71a9bc
No related branches found
No related tags found
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
doc/user/project/codeowners/code_owners_troubleshooting.md
+81
-0
81 个添加, 0 个删除
doc/user/project/codeowners/code_owners_troubleshooting.md
doc/user/project/codeowners/index.md
+0
-71
0 个添加, 71 个删除
doc/user/project/codeowners/index.md
有
81 个添加
和
71 个删除
doc/user/project/codeowners/code_owners_troubleshooting.md
0 → 100644
+
81
−
0
浏览文件 @
d509a235
---
stage
:
Create
group
:
Source Code
info
:
To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description
:
"
Use
Code
Owners
to
define
experts
for
your
code
base,
and
set
review
requirements
based
on
file
type
or
location."
---
## Troubleshooting Code Owners
DETAILS:
**Tier:**
Premium, Ultimate
**Offering:**
GitLab.com, Self-managed, GitLab Dedicated
When working with Code Owners, you might encounter the following issues.
For more information about how the Code Owners feature handles errors, see the
[
Code Owners reference
](
reference.md
)
.
### Approvals shown as optional
A Code Owner approval rule is optional if any of these conditions are true:
-
The user or group is not a member of the project.
Code Owners
[
cannot inherit members from parent groups
](
https://gitlab.com/gitlab-org/gitlab/-/issues/288851/
)
.
-
[
Code Owner approval on a protected branch
](
../protected_branches.md#require-code-owner-approval-on-a-protected-branch
)
has not been set up.
-
The section is
[
marked as optional
](
index.md#make-a-code-owners-section-optional
)
.
-
No eligible code owners are available to approve the merge request due to conflicts
with other
[
merge request approval settings
](
../merge_requests/approvals/settings.md
)
.
### Approvals do not show
Code Owner approval rules only update when the merge request is created.
If you update the
`CODEOWNERS`
file, close the merge request and create a new one.
### User not shown as possible approver
A user might not show as an approver on the Code Owner merge request approval rules
if any of these conditions are true:
-
A rule prevents the specific user from approving the merge request.
Check the project
[
merge request approval
](
../merge_requests/approvals/settings.md#edit-merge-request-approval-settings
)
settings.
-
A Code Owner group has a visibility of
**private**
, and the current user is not a
member of the Code Owner group.
-
Current user is an external user who does not have permission to the internal Code Owner group.
### Approval rule is invalid
You might get an error that states:
```
plaintext
Approval rule is invalid.
GitLab has approved this rule automatically to unblock the merge request.
```
This issue occurs when an approval rule uses a Code Owner that is not a direct member of the project.
The workaround is to check that the group or user has been invited to the project.
### User or group not shown when viewing Code Owners for a directory
Code Owners might not show the intended user or group based on your configured rules when viewing a directory,
but correctly show the Code Owners for files beneath the directory.
For example:
```
plaintext
* @dev-team
docs/ @tech-writer-team
```
All files beneath the
`docs/`
directory show
`@tech-writer-team`
as Code Owners, but the directory itself will show
`@dev-team`
.
This behavior occurs when viewing a directory because the
[
syntax rule
](
../../project/codeowners/reference.md#directory-paths
)
applies to all files beneath the directory, which does not include the directory itself. To resolve this, update the
`CODEOWNERS`
file to include the
directory specifically along with all files beneath the directory. For example:
```
plaintext
* @dev-team
docs @tech-writer-team
docs/ @tech-writer-team
```
此差异已折叠。
点击以展开。
doc/user/project/codeowners/index.md
+
0
−
71
浏览文件 @
d509a235
...
...
@@ -415,74 +415,3 @@ All changes from users _without_ the **Allowed to push** permission must be rout
-
[
Syntax reference
](
reference.md
)
-
[
Development guidelines
](
../../../development/code_owners/index.md
)
## Troubleshooting
When working with Code Owners, you might encounter the following issues.
For more information about how the Code Owners feature handles errors, see the
[
Code Owners reference
](
reference.md
)
.
### Approvals shown as optional
A Code Owner approval rule is optional if any of these conditions are true:
-
The user or group is not a member of the project.
Code Owners
[
cannot inherit members from parent groups
](
https://gitlab.com/gitlab-org/gitlab/-/issues/288851/
)
.
-
[
Code Owner approval on a protected branch
](
../protected_branches.md#require-code-owner-approval-on-a-protected-branch
)
has not been set up.
-
The section is
[
marked as optional
](
#make-a-code-owners-section-optional
)
.
-
No eligible code owners are available to approve the merge request due to conflicts
with other
[
merge request approval settings
](
../merge_requests/approvals/settings.md
)
.
### Approvals do not show
Code Owner approval rules only update when the merge request is created.
If you update the
`CODEOWNERS`
file, close the merge request and create a new one.
### User not shown as possible approver
A user might not show as an approver on the Code Owner merge request approval rules
if any of these conditions are true:
-
A rule prevents the specific user from approving the merge request.
Check the project
[
merge request approval
](
../merge_requests/approvals/settings.md#edit-merge-request-approval-settings
)
settings.
-
A Code Owner group has a visibility of
**private**
, and the current user is not a
member of the Code Owner group.
-
Current user is an external user who does not have permission to the internal Code Owner group.
### Approval rule is invalid
You might get an error that states:
```
plaintext
Approval rule is invalid.
GitLab has approved this rule automatically to unblock the merge request.
```
This issue occurs when an approval rule uses a Code Owner that is not a direct member of the project.
The workaround is to check that the group or user has been invited to the project.
### User or group not shown when viewing Code Owners for a directory
Code Owners might not show the intended user or group based on your configured rules when viewing a directory,
but correctly show the Code Owners for files beneath the directory.
For example:
```
plaintext
* @dev-team
docs/ @tech-writer-team
```
All files beneath the
`docs/`
directory show
`@tech-writer-team`
as Code Owners, but the directory itself will show
`@dev-team`
.
This behavior occurs when viewing a directory because the
[
syntax rule
](
../../project/codeowners/reference.md#directory-paths
)
applies to all files beneath the directory, which does not include the directory itself. To resolve this, update the
`CODEOWNERS`
file to include the
directory specifically along with all files beneath the directory. For example:
```
plaintext
* @dev-team
docs @tech-writer-team
docs/ @tech-writer-team
```
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录