summaryrefslogtreecommitdiff
path: root/doc/user/project/merge_requests
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/project/merge_requests')
-rw-r--r--doc/user/project/merge_requests/accessibility_testing.md3
-rw-r--r--doc/user/project/merge_requests/allow_collaboration.md2
-rw-r--r--doc/user/project/merge_requests/approvals/index.md6
-rw-r--r--doc/user/project/merge_requests/approvals/rules.md35
-rw-r--r--doc/user/project/merge_requests/authorization_for_merge_requests.md6
-rw-r--r--doc/user/project/merge_requests/browser_performance_testing.md5
-rw-r--r--doc/user/project/merge_requests/changes.md192
-rw-r--r--doc/user/project/merge_requests/code_quality.md29
-rw-r--r--doc/user/project/merge_requests/commits.md37
-rw-r--r--doc/user/project/merge_requests/confidential.md2
-rw-r--r--doc/user/project/merge_requests/drafts.md13
-rw-r--r--doc/user/project/merge_requests/fail_fast_testing.md7
-rw-r--r--doc/user/project/merge_requests/getting_started.md6
-rw-r--r--doc/user/project/merge_requests/img/changes-inline_v14_8.pngbin0 -> 8494 bytes
-rw-r--r--doc/user/project/merge_requests/img/changes-sidebyside_v14_8.pngbin0 -> 9366 bytes
-rw-r--r--doc/user/project/merge_requests/img/collapse-comment_v14_8.pngbin0 -> 9843 bytes
-rw-r--r--doc/user/project/merge_requests/img/expand-comment_v14_8.pngbin0 -> 13735 bytes
-rw-r--r--doc/user/project/merge_requests/img/file_by_file_v13_2.pngbin81874 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/img/incrementally_expand_merge_request_diffs_v12_2.pngbin28918 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/img/merge_request_diff_file_navigation.pngbin68704 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/img/mr-diff-example_v14_8.pngbin0 -> 17683 bytes
-rw-r--r--doc/user/project/merge_requests/index.md3
-rw-r--r--doc/user/project/merge_requests/load_performance_testing.md5
-rw-r--r--doc/user/project/merge_requests/merge_request_dependencies.md6
-rw-r--r--doc/user/project/merge_requests/reviews/index.md12
-rw-r--r--doc/user/project/merge_requests/reviews/suggestions.md4
-rw-r--r--doc/user/project/merge_requests/status_checks.md26
-rw-r--r--doc/user/project/merge_requests/test_coverage_visualization.md106
-rw-r--r--doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md33
29 files changed, 334 insertions, 204 deletions
diff --git a/doc/user/project/merge_requests/accessibility_testing.md b/doc/user/project/merge_requests/accessibility_testing.md
index e67af8dc936..612f499bb65 100644
--- a/doc/user/project/merge_requests/accessibility_testing.md
+++ b/doc/user/project/merge_requests/accessibility_testing.md
@@ -1,8 +1,7 @@
---
stage: Verify
-group: Testing
+group: Pipeline Insights
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference, howto
---
# Accessibility testing **(FREE)**
diff --git a/doc/user/project/merge_requests/allow_collaboration.md b/doc/user/project/merge_requests/allow_collaboration.md
index b10d6597c1e..5826ebcab49 100644
--- a/doc/user/project/merge_requests/allow_collaboration.md
+++ b/doc/user/project/merge_requests/allow_collaboration.md
@@ -50,7 +50,7 @@ You can push directly to the branch of the forked repository if:
- The author of the merge request has enabled contributions from upstream
members.
-- You have at least the [Developer role](../../permissions.md) in the
+- You have at least the Developer role in the
upstream project.
In the following example:
diff --git a/doc/user/project/merge_requests/approvals/index.md b/doc/user/project/merge_requests/approvals/index.md
index dddd3925dbb..e940426dc67 100644
--- a/doc/user/project/merge_requests/approvals/index.md
+++ b/doc/user/project/merge_requests/approvals/index.md
@@ -8,7 +8,7 @@ disqus_identifier: 'https://docs.gitlab.com/ee/user/project/merge_requests/appro
# Merge request approvals **(FREE)**
-> Redesign [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1979) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.8 and [feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/10685) in 12.0.
+> Redesign [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1979) in GitLab 11.8 and [feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/10685) in 12.0.
You can configure your merge requests so that they must be approved before
they can be merged. While [GitLab Free](https://about.gitlab.com/pricing/) allows
@@ -89,7 +89,7 @@ a merge request from merging without approval.
## Required approvals **(PREMIUM)**
-> Moved to [GitLab Premium](https://about.gitlab.com/pricing/) in 13.9.
+> Moved to GitLab Premium in 13.9.
Required approvals enforce code reviews by the number and type of users you specify.
Without the approvals, the work cannot merge. Required approvals enable multiple use cases:
@@ -103,7 +103,7 @@ Without the approvals, the work cannot merge. Required approvals enable multiple
to determine who should review the work.
- Require an [approval before merging code that causes test coverage to decline](../../../../ci/pipelines/settings.md#coverage-check-approval-rule)
- [Require approval from a security team](../../../application_security/index.md#security-approvals-in-merge-requests)
- before merging code that could introduce a vulnerability. **(ULTIMATE)**
+ before merging code that could introduce a vulnerability.
## Related topics
diff --git a/doc/user/project/merge_requests/approvals/rules.md b/doc/user/project/merge_requests/approvals/rules.md
index 129010010e7..fa447ea35af 100644
--- a/doc/user/project/merge_requests/approvals/rules.md
+++ b/doc/user/project/merge_requests/approvals/rules.md
@@ -76,9 +76,9 @@ To edit a merge request approval rule:
select **{remove}** **Remove**.
1. Select **Update approval rule**.
-## Add multiple approval rules **(PREMIUM)**
+## Add multiple approval rules
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1979) in GitLab Premium 11.10.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1979) in GitLab 11.10.
In GitLab Premium and higher tiers, you can enforce multiple approval rules on a
merge request, and multiple default approval rules for a project. If your tier
@@ -127,8 +127,8 @@ users were not explicitly listed in the approval rules.
### Group approvers
You can add a group of users as approvers, but those users count as approvers only if
-they have direct membership to the group. In the future, group approvers may be
-restricted to only groups [with share access to the project](https://gitlab.com/gitlab-org/gitlab/-/issues/2048).
+they have direct membership to the group. Group approvers are
+restricted to only groups [with share access to the project](../../members/share_project_with_groups.md).
A user's membership in an approvers group affects their individual ability to
approve in these ways:
@@ -143,7 +143,7 @@ approve in these ways:
[**Prevent committers approval**](settings.md#prevent-approvals-by-users-who-add-commits)
project setting.
-### Code owners as eligible approvers **(PREMIUM)**
+### Code owners as eligible approvers
> Moved to GitLab Premium in 13.9.
@@ -158,14 +158,14 @@ become eligible approvers in the project. To enable this merge request approval
You can also
[require code owner approval](../../protected_branches.md#require-code-owner-approval-on-a-protected-branch)
-for protected branches. **(PREMIUM)**
+for protected branches.
-## Merge request approval segregation of duties **(PREMIUM)**
+## Merge request approval segregation of duties
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40491) in GitLab 13.4.
> - Moved to GitLab Premium in 13.9.
-You may have to grant users with the Reporter [role](../../../permissions.md#project-members-permissions)
+You may have to grant users with the Reporter role
permission to approve merge requests before they can merge to a protected branch.
Some users (like managers) may not need permission to push or merge code, but still need
oversight on proposed work. To enable approval permissions for these users without
@@ -202,7 +202,7 @@ on a merge request, you can either add or remove approvers:
Administrators can change the [merge request approvals settings](settings.md#prevent-editing-approval-rules-in-merge-requests)
to prevent users from overriding approval rules for merge requests.
-## Configure optional approval rules **(PREMIUM)**
+## Configure optional approval rules
Merge request approvals can be optional for projects where approvals are
appreciated, but not required. To make an approval rule optional:
@@ -211,9 +211,9 @@ appreciated, but not required. To make an approval rule optional:
- Use the [Merge requests approvals API](../../../../api/merge_request_approvals.md#update-merge-request-level-rule)
to set the `approvals_required` attribute to `0`.
-## Approvals for protected branches **(PREMIUM)**
+## Approvals for protected branches
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/460) in GitLab Premium 12.8.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/460) in GitLab 12.8.
Approval rules are often relevant only to specific branches, like your
[default branch](../../repository/branches/default.md). To configure an
@@ -229,3 +229,16 @@ approval rule for certain branches:
![Scoped to protected branch](img/scoped_to_protected_branch_v13_10.png)
1. To enable this configuration, read
[Code Owner's approvals for protected branches](../../protected_branches.md#require-code-owner-approval-on-a-protected-branch).
+
+## Troubleshooting
+
+### Approval rule name can't be blank
+
+As a workaround for this validation error, you can delete the approval rule through
+the API.
+
+1. [GET a project-level rule](../../../../api/merge_request_approvals.md#get-a-single-project-level-rule).
+1. [DELETE the rule](../../../../api/merge_request_approvals.md#delete-project-level-rule).
+
+For more information about this validation error, read
+[issue 285129](https://gitlab.com/gitlab-org/gitlab/-/issues/285129).
diff --git a/doc/user/project/merge_requests/authorization_for_merge_requests.md b/doc/user/project/merge_requests/authorization_for_merge_requests.md
index 4ae59a76a9a..37ecc1b8d06 100644
--- a/doc/user/project/merge_requests/authorization_for_merge_requests.md
+++ b/doc/user/project/merge_requests/authorization_for_merge_requests.md
@@ -16,7 +16,7 @@ There are two main ways to have a merge request flow with GitLab:
With the protected branch flow everybody works within the same GitLab project.
-The project maintainers get the [Maintainer role](../../permissions.md) and the regular developers
+The project maintainers get the Maintainer role and the regular developers
get the Developer role.
Maintainers mark the authoritative branches as 'Protected'.
@@ -25,7 +25,7 @@ Developers push feature branches to the project and create merge requests
to have their feature branches reviewed and merged into one of the protected
branches.
-By default, only users with the [Maintainer role](../../permissions.md) can merge changes into a
+By default, only users with the Maintainer role can merge changes into a
protected branch.
**Advantages**
@@ -39,7 +39,7 @@ protected branch.
## Forking workflow
-With the forking workflow, maintainers get the [Maintainer role](../../permissions.md) and regular
+With the forking workflow, maintainers get the Maintainer role and regular
developers get the Reporter role on the authoritative repository, which prohibits
them from pushing any changes to it.
diff --git a/doc/user/project/merge_requests/browser_performance_testing.md b/doc/user/project/merge_requests/browser_performance_testing.md
index 6668e1736cf..9c7d9e2bf19 100644
--- a/doc/user/project/merge_requests/browser_performance_testing.md
+++ b/doc/user/project/merge_requests/browser_performance_testing.md
@@ -1,13 +1,12 @@
---
stage: Verify
-group: Testing
+group: Pipeline Insights
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference, howto
---
# Browser Performance Testing **(PREMIUM)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3507) in [GitLab Premium](https://about.gitlab.com/pricing/) 10.3.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3507) in GitLab 10.3.
If your application offers a web interface and you're using
[GitLab CI/CD](../../../ci/index.md), you can quickly determine the rendering performance
diff --git a/doc/user/project/merge_requests/changes.md b/doc/user/project/merge_requests/changes.md
index d348c00bdc2..8796ea0635b 100644
--- a/doc/user/project/merge_requests/changes.md
+++ b/doc/user/project/merge_requests/changes.md
@@ -5,149 +5,151 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: index, reference
---
-# Changes tab in merge requests **(FREE)**
+# Changes in merge requests **(FREE)**
-The **Changes** tab on a [merge request](index.md), below the main merge request details and next to the discussion tab,
-shows the changes to files between branches or commits. This view of changes to a
-file is also known as a **diff**. By default, the diff view compares the file in the
-merge request branch and the file in the target branch.
+A [merge request](index.md) proposes a set of changes to files in a branch in your repository. These
+changes are shown as a _diff_ (difference) between the current state and the proposed
+changes.
-The diff view includes the following:
+By default, the diff view compares the versions of files in the merge request source branch
+to the files in the target branch, and shows only the parts of a file that have changed.
-- The file's name and path.
-- The number of lines added and deleted.
-- Buttons for the following options:
- - Toggle comments for this file; useful for inline reviews.
- - Edit the file in the merge request's branch.
- - Show full file, in case you want to look at the changes in context with the rest of the file.
- - View file at the current commit.
- - Preview the changes with [Review Apps](../../../ci/review_apps/index.md).
-- The changed lines, with the specific changes highlighted.
+![Example screenshot of a source code diff](img/mr-diff-example_v14_8.png)
-![Example screenshot of a source code diff](img/merge_request_diff_v12_2.png)
+## Show all changes in a merge request
-## Merge request diff file navigation
+To view the diff of changes included in a merge request:
-When reviewing changes in the **Changes** tab, the diff can be navigated using
-the file tree or file list. As you scroll through large diffs with many
-changes, you can quickly jump to any changed file using the file tree or file
-list.
+1. Go to your merge request.
+1. Below the merge request title, select **Changes**.
+1. If the merge request changes many files, you can jump directly to a specific file:
+ 1. Select **Show file browser** (**{file-tree}**) to display the file tree.
+ 1. Select the file you want to view.
+ 1. To hide the file browser, select **Show file browser** again.
-![Merge request diff file navigation](img/merge_request_diff_file_navigation.png)
+In [GitLab 13.4](https://gitlab.com/gitlab-org/gitlab/-/issues/232820) and later, files
+with many changes are collapsed to improve performance. GitLab displays the message:
+**Some changes are not shown**. To view the changes for that file, select **Expand file**.
-## Collapsed files in the Changes view
+## Show one file at a time
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/232820) in GitLab 13.4.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/222790) in GitLab 13.2.
+> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/229848) in GitLab 13.7.
-When you review changes in the **Changes** tab, files with a large number of changes are collapsed
-to improve performance. When files are collapsed, a warning appears at the top of the changes.
-Select **Expand file** on any file to view the changes for that file.
+For larger merge requests, you can review one file at a time. You can change this setting
+[temporarily in a merge request](#in-a-merge-request-show-only-one-file-at-a-time), or
+so it [applies to all merge requests](#in-all-merge-requests-show-only-one-file-at-a-time).
-## File-by-file diff navigation
+### In a merge request, show only one file at a time
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/222790) in GitLab 13.2.
-> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/229848) in GitLab 13.7.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233898) in GitLab 13.7.
+
+To temporarily change your viewing preferences for a specific merge request:
+
+1. Go to your merge request, and below the merge request title, select **Changes**.
+1. Select **Preferences** (**{settings}**).
+1. Select or clear the **Show one file at a time** checkbox.
-For larger merge requests, consider reviewing one file at a time. To enable this feature:
+This change overrides your choice in your user preferences. It persists until you
+clear your browser's cookies or change this behavior again.
+
+### In all merge requests, show only one file at a time
+
+To view one file at a time for all of your merge requests:
1. In the top-right corner, select your avatar.
1. Select **Preferences**.
-1. Scroll to the **Behavior** section and select **Show one file at a time on merge request's Changes tab**.
+1. Scroll to the **Behavior** section and select the **Show one file at a time on merge request's Changes tab** checkbox.
1. Select **Save changes**.
-After you enable this setting, GitLab displays only one file at a time in the **Changes** tab when you review merge requests. You can select **Prev** and **Next** to view other changed files.
+After you enable this setting, GitLab displays only one file at a time when you review
+merge requests. To view other changed files, either:
+
+- Scroll to the end of the file and select either **Prev** or **Next**.
+- Select **Show file browser** (**{file-tree}**) and select another file to view.
+
+## Compare changes inline
+
+You can view the changes inline:
-![File-by-file diff navigation](img/file_by_file_v13_2.png)
+1. Go to your merge request, and below the title, select **Changes**.
+1. Select **Preferences** (**{settings}**).
+1. In the **Compare changes** area, select **Inline**.
-In [GitLab 13.7](https://gitlab.com/gitlab-org/gitlab/-/issues/233898) and later, if you want to change
-this behavior, you can do so from your **User preferences** (as explained above) or directly in a
-merge request:
+The changes are displayed after the original text.
-1. Go to the merge request's **Changes** tab.
-1. Select the cog icon (**{settings}**) to reveal the merge request's settings dropdown.
-1. Select or clear the checkbox **Show one file at a time** to change the setting accordingly.
+![inline changes](img/changes-inline_v14_8.png)
-This change overrides the choice you made in your user preferences and persists until you clear your
-browser's cookies or change this behavior again.
+## Compare changes side-by-side
-## Incrementally expand merge request diffs
+Depending on the length of the changes in your merge request, you may find it
+easier to view the changes inline, or side-by-side:
-By default, the diff shows only the parts of a file which are changed.
-To view more unchanged lines above or below a change select the
-**Expand up** or **Expand down** icons. You can also select **Show unchanged lines**
-to expand the entire file.
+1. Go to your merge request, and below the title, select **Changes**.
+1. Select **Preferences** (**{settings}**).
+1. In the **Compare changes** area, select **Side-by-side**.
-![Incrementally expand merge request diffs](img/incrementally_expand_merge_request_diffs_v12_2.png)
+The changes are displayed across from one another.
-In GitLab [versions 13.1 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/205401), when viewing a
-merge request's **Changes** tab, if a certain file was only renamed, you can expand it to see the
-entire content by selecting **Show file contents**.
+![side-by-side changes](img/changes-sidebyside_v14_8.png)
-## Ignore whitespace changes in Merge Request diff view
+## Expand or collapse comments
+
+When reviewing code changes, you can hide inline comments:
+
+1. Go to your merge request, and below the title, select **Changes**.
+1. Scroll to the file that contains the comments you want to hide.
+1. Scroll to the line the comment is attached to, and select **Collapse** (**{collapse}**):
+ ![collapse a comment](img/collapse-comment_v14_8.png)
+
+To expand inline comments and show them again:
+
+1. Go to your merge request, and below the title, select **Changes**.
+1. Scroll to the file that contains the collapsed comments you want to show.
+1. Scroll to the line the comment is attached to, and select the user avatar:
+ ![expand a comment](img/expand-comment_v14_8.png)
+
+## Ignore whitespace changes
Whitespace changes can make it more difficult to see the substantive changes in
a merge request. You can choose to hide or show whitespace changes:
-1. Go to your merge request, and select the **Changes** tab.
-1. Above the list of changed files, select **(settings)** **Preferences** to
- display the preferences menu.
-1. Select or deselect **Show whitespace changes**:
+1. Go to your merge request, and below the title, select **Changes**.
+1. Before the list of changed files, select **Preferences** (**{settings}**).
+1. Select or clear the **Show whitespace changes** checkbox:
![MR diff](img/merge_request_diff_v14_2.png)
## Mark files as viewed
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51513) in GitLab 13.9 behind a feature flag, enabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51513) in GitLab 13.9 [with a flag](../../../administration/feature_flags.md) named `local_file_reviews`. Enabled by default.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/296674) in GitLab 14.3.
-When reviewing a merge request with many files multiple times, it may be useful to the reviewer
-to focus on new changes and ignore the files that they have already reviewed and don't want to
-see anymore unless they are changed again.
+When reviewing a merge request with many files multiple times, you can ignore files
+you've already reviewed. To hide files that haven't changed since your last review:
-To mark a file as viewed:
+1. Go to your merge request, and below the title, select **Changes**.
+1. In the file's header, select the **Viewed** checkbox.
-1. Go to the merge request's **Diffs** tab.
-1. On the right-top of the file, locate the **Viewed** checkbox.
-1. Select it to mark the file as viewed.
+Files marked as viewed are not shown to you again unless either:
-Once checked, the file remains marked for that reviewer unless there are newly introduced
-changes to its content or the checkbox is unchecked.
+- New changes are made to its content.
+- You clear the **Viewed** checkbox.
-## Show merge request conflicts in diff
+## Show merge request conflicts in diff **(FREE SELF)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/232484) in GitLab 13.5.
-> - [Deployed behind a feature flag](../../feature_flags.md), disabled by default.
-> - Disabled on GitLab.com.
-> - Not recommended for production use.
-> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-merge-request-conflicts-in-diff). **(FREE SELF)**
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/232484) in GitLab 13.5 [with a flag](../../../administration/feature_flags.md) named `display_merge_conflicts_in_diff`. Disabled by default.
-This in-development feature might not be available for your use. There can be
-[risks when enabling features still in development](../../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
-Refer to this feature's version history for more details.
+FLAG:
+On self-managed GitLab, by default this feature is not available. To make it available,
+ask an administrator to [enable the feature flag](../../../administration/feature_flags.md)
+named `display_merge_conflicts_in_diff`. On GitLab.com, this feature is not available.
+The feature is not ready for production use.
To avoid displaying the changes that are already on target branch in the diff,
we compare the merge request's source branch with HEAD of the target branch.
When there are conflicts between the source and target branch, we show the
-conflicts on the merge request diff as well:
+conflicts on the merge request diff:
![Example of a conflict shown in a merge request diff](img/conflict_ui_v14_0.png)
-
-### Enable or disable merge request conflicts in diff **(FREE SELF)**
-
-Merge request conflicts in diff is under development and not ready for production use. It is
-deployed behind a feature flag that is **disabled by default**.
-[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
-can enable it.
-
-To enable it:
-
-```ruby
-Feature.enable(:display_merge_conflicts_in_diff)
-```
-
-To disable it:
-
-```ruby
-Feature.disable(:display_merge_conflicts_in_diff)
-```
diff --git a/doc/user/project/merge_requests/code_quality.md b/doc/user/project/merge_requests/code_quality.md
index 30d463efa69..d735ce0ef91 100644
--- a/doc/user/project/merge_requests/code_quality.md
+++ b/doc/user/project/merge_requests/code_quality.md
@@ -53,7 +53,7 @@ See also the Code Climate list of [Supported Languages for Maintainability](http
## Code Quality in diff view **(ULTIMATE)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/267612) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.11, disabled by default behind the `codequality_mr_diff` [feature flag](../../../administration/feature_flags.md).
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/267612) in GitLab 13.11, disabled by default behind the `codequality_mr_diff` [feature flag](../../../administration/feature_flags.md).
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/284140) in GitLab 13.12.
> - [Disabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/2526) in GitLab 14.0 due to [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/334116).
> - [Inline annotation added](https://gitlab.com/gitlab-org/gitlab/-/issues/2526) and [feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/284140) in GitLab 14.1.
@@ -248,9 +248,9 @@ This can be done:
### Using with merge request pipelines
The configuration provided by the Code Quality template does not let the `code_quality` job
-run on [pipelines for merge requests](../../../ci/pipelines/merge_request_pipelines.md).
+run on [merge request pipelines](../../../ci/pipelines/merge_request_pipelines.md).
-If pipelines for merge requests is enabled, the `code_quality:rules` must be redefined.
+If merge request pipelines is enabled, the `code_quality:rules` must be redefined.
The template has these [`rules`](../../../ci/yaml/index.md#rules) for the `code quality` job:
@@ -379,7 +379,7 @@ at the beginning of the file.
## Code Quality reports **(PREMIUM)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21527) in GitLab Premium 12.9.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21527) in GitLab 12.9.
![Code Quality Report](img/code_quality_report_13_11.png)
@@ -392,7 +392,7 @@ After the Code Quality job completes:
[downloadable artifact](../../../ci/pipelines/job_artifacts.md#download-job-artifacts)
for the `code_quality` job.
- The full list of code quality violations generated by a pipeline is shown in the
- Code Quality tab of the Pipeline Details page. **(PREMIUM)**
+ Code Quality tab of the Pipeline Details page.
## Generate an HTML report
@@ -591,3 +591,22 @@ plugins:
If your merge requests do not show any code quality changes when using a custom tool,
ensure that the line property is an `integer`.
+
+### Code Quality CI job with Code Climate plugins enabled fails with error "engine <plugin_name> ran for 900 seconds and was killed"
+
+If you enabled any of the Code Climate plugins, and the Code Quality CI job fails with the error below,
+it's likely the job takes longer than the default timeout of 900 seconds.
+
+```shell
+error: (CC::CLI::Analyze::EngineFailure) engine pmd ran for 900 seconds and was killed
+Could not analyze code quality for the repository at /code
+```
+
+To work around this problem, set `TIMEOUT_SECONDS` to a higher value in your `.gitlab.-ci.yml` file.
+
+For example:
+
+```yaml
+variables:
+ TIMEOUT_SECONDS: 3600
+```
diff --git a/doc/user/project/merge_requests/commits.md b/doc/user/project/merge_requests/commits.md
index 3d3032bb193..0014c1ba994 100644
--- a/doc/user/project/merge_requests/commits.md
+++ b/doc/user/project/merge_requests/commits.md
@@ -29,21 +29,17 @@ To seamlessly navigate among commits in a merge request:
## View merge request commits in context
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29274) in GitLab 13.12.
-> - [Deployed behind a feature flag](../../feature_flags.md), enabled by default.
-> - Disabled on GitLab.com.
-> - Not recommended for production use.
-> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-viewing-merge-request-commits-in-context). **(FREE SELF)**
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29274) in GitLab 13.12 [with a flag](../../../administration/feature_flags.md) named `context_commits`. Enabled by default.
+> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/320757) in GitLab 14.8.
WARNING:
-This feature is in [beta](https://about.gitlab.com/handbook/product/gitlab-the-product/#beta)
+This feature is in [beta](../../../policy/alpha-beta-support.md#beta-features)
and is [incomplete](https://gitlab.com/groups/gitlab-org/-/epics/1192).
-Previously merged commits can be added, but they can't be removed due to
-[this bug](https://gitlab.com/gitlab-org/gitlab/-/issues/325538).
-This in-development feature might not be available for your use. There can be
-[risks when enabling features still in development](../../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
-Refer to this feature's version history for more details.
+FLAG:
+On self-managed GitLab, by default this feature is available. To hide the feature,
+ask an administrator to [disable the feature flag](../../../administration/feature_flags.md) named `context_commits`.
+On GitLab.com, this feature is available.
When reviewing a merge request, it helps to have more context about the changes
made. That includes unchanged lines in unchanged files, and previous commits
@@ -66,22 +62,3 @@ To view the changes done on those previously merged commits:
1. Scroll to **(file-tree)** **Compare** and select **previously merged commits**:
![Previously merged commits](img/previously_merged_commits_v14_1.png)
-
-### Enable or disable viewing merge request commits in context **(FREE SELF)**
-
-Viewing merge request commits in context is under development and not ready for production use. It is
-deployed behind a feature flag that is **disabled by default**.
-[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
-can enable it.
-
-To enable it:
-
-```ruby
-Feature.enable(:context_commits)
-```
-
-To disable it:
-
-```ruby
-Feature.disable(:context_commits)
-```
diff --git a/doc/user/project/merge_requests/confidential.md b/doc/user/project/merge_requests/confidential.md
index 10c63421876..6900880417f 100644
--- a/doc/user/project/merge_requests/confidential.md
+++ b/doc/user/project/merge_requests/confidential.md
@@ -4,7 +4,7 @@ group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Merge requests for confidential issues
+# Merge requests for confidential issues **(FREE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/58583) in GitLab 12.1.
diff --git a/doc/user/project/merge_requests/drafts.md b/doc/user/project/merge_requests/drafts.md
index a91679ffd63..637b682d603 100644
--- a/doc/user/project/merge_requests/drafts.md
+++ b/doc/user/project/merge_requests/drafts.md
@@ -17,7 +17,8 @@ the **Merge** button until you remove the **Draft** flag:
## Mark merge requests as drafts
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32692) in GitLab 13.2, Work-In-Progress (WIP) merge requests were renamed to **Draft**. Support for using **WIP** is scheduled for removal in GitLab 14.0.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32692) in GitLab 13.2, Work-In-Progress (WIP) merge requests were renamed to **Draft**.
+> - [Removed](https://gitlab.com/gitlab-org/gitlab/-/issues/228685) all support for using **WIP** in GitLab 14.8.
> - **Mark as draft** and **Mark as ready** buttons [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/227421) in GitLab 13.5.
There are several ways to flag a merge request as a draft:
@@ -35,16 +36,12 @@ There are several ways to flag a merge request as a draft:
is not a toggle, and adding this text again in a later commit doesn't mark the
merge request as ready.
-WARNING:
-Adding `WIP:` to the start of the merge request's title still marks a merge request
-as a draft. This feature is scheduled for removal in GitLab 14.0. Use `Draft:` instead.
-
## Mark merge requests as ready
When a merge request is ready to be merged, you can remove the `Draft` flag in several ways:
- **Viewing a merge request**: In the top right corner of the merge request, click **Mark as ready**.
- Users with [Developer or greater permissions](../../permissions.md)
+ Users with at least the Developer role
can also scroll to the bottom of the merge request description and click **Mark as ready**:
![Mark as ready](img/draft_blocked_merge_button_v13_10.png)
@@ -79,11 +76,11 @@ draft merge requests:
## Pipelines for drafts
-When the [pipelines for merged results](../../../ci/pipelines/pipelines_for_merged_results.md)
+When the [merged results pipelines](../../../ci/pipelines/merged_results_pipelines.md)
feature is enabled, draft merge requests run
[merge request pipelines](../../../ci/pipelines/merge_request_pipelines.md) only.
-To run pipelines for merged results, you must
+To run merged results pipelines, you must
[mark the merge request as ready](#mark-merge-requests-as-ready).
<!-- ## Troubleshooting
diff --git a/doc/user/project/merge_requests/fail_fast_testing.md b/doc/user/project/merge_requests/fail_fast_testing.md
index 3cb50195f5a..355661516a7 100644
--- a/doc/user/project/merge_requests/fail_fast_testing.md
+++ b/doc/user/project/merge_requests/fail_fast_testing.md
@@ -1,8 +1,7 @@
---
stage: Verify
-group: Testing
+group: Pipeline Insights
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference, howto
---
# Fail Fast Testing **(PREMIUM)**
@@ -42,8 +41,8 @@ This template requires:
- A project built in Rails that uses RSpec for testing.
- CI/CD configured to:
- Use a Docker image with Ruby available.
- - Use [Pipelines for merge requests](../../../ci/pipelines/merge_request_pipelines.md#prerequisites)
-- [Pipelines for Merged Results](../../../ci/pipelines/pipelines_for_merged_results.md#enable-pipelines-for-merged-results)
+ - Use [Merge request pipelines](../../../ci/pipelines/merge_request_pipelines.md#prerequisites)
+- [Merged results pipelines](../../../ci/pipelines/merged_results_pipelines.md#enable-merged-results-pipelines)
enabled in the project settings.
- A Docker image with Ruby available. The template uses `image: ruby:2.6` by default, but you [can override](../../../ci/yaml/includes.md#override-included-configuration-values) this.
diff --git a/doc/user/project/merge_requests/getting_started.md b/doc/user/project/merge_requests/getting_started.md
index ec509f58723..8699a42dd5d 100644
--- a/doc/user/project/merge_requests/getting_started.md
+++ b/doc/user/project/merge_requests/getting_started.md
@@ -56,7 +56,7 @@ request's page at the top-right side, or by using
- [Assign](#assignee) the merge request to a colleague for review. With [multiple assignees](#multiple-assignees), you can assign it to more than one person at a time.
- Set a [milestone](../milestones/index.md) to track time-sensitive changes.
- Add [labels](../labels.md) to help contextualize and filter your merge requests over time.
-- [Require approval](approvals/index.md#required-approvals) from your team. **(PREMIUM)**
+- [Require approval](approvals/index.md#required-approvals) from your team.
- [Close issues automatically](#merge-requests-to-close-issues) when they are merged.
- Enable the [delete source branch when merge request is accepted](#deleting-the-source-branch) option to keep your repository clean.
- Enable the [squash commits when merge request is accepted](squash_and_merge.md) option to combine all the commits into one before merging, thus keep a clean commit history in your repository.
@@ -66,7 +66,7 @@ After you have created the merge request, you can also:
- [Discuss](../../discussions/index.md) your implementation with your team in the merge request thread.
- [Perform inline code reviews](reviews/index.md).
-- Add [merge request dependencies](merge_request_dependencies.md) to restrict it to be merged only when other merge requests have been merged. **(PREMIUM)**
+- Add [merge request dependencies](merge_request_dependencies.md) to restrict it to be merged only when other merge requests have been merged.
- Preview continuous integration [pipelines on the merge request widget](widgets.md).
- Preview how your changes look directly on your deployed application with [Review Apps](widgets.md#live-preview-with-review-apps).
- [Allow collaboration on merge requests across forks](allow_collaboration.md).
@@ -162,7 +162,7 @@ enabled by default for all new merge requests, enable it in the
This option is also visible in an existing merge request next to
the merge request button and can be selected or deselected before merging.
-It is only visible to users with the [Maintainer role](../../permissions.md)
+It is only visible to users with the Maintainer role
in the source project.
If the user viewing the merge request does not have the correct
diff --git a/doc/user/project/merge_requests/img/changes-inline_v14_8.png b/doc/user/project/merge_requests/img/changes-inline_v14_8.png
new file mode 100644
index 00000000000..f3b6515283c
--- /dev/null
+++ b/doc/user/project/merge_requests/img/changes-inline_v14_8.png
Binary files differ
diff --git a/doc/user/project/merge_requests/img/changes-sidebyside_v14_8.png b/doc/user/project/merge_requests/img/changes-sidebyside_v14_8.png
new file mode 100644
index 00000000000..981274dbb86
--- /dev/null
+++ b/doc/user/project/merge_requests/img/changes-sidebyside_v14_8.png
Binary files differ
diff --git a/doc/user/project/merge_requests/img/collapse-comment_v14_8.png b/doc/user/project/merge_requests/img/collapse-comment_v14_8.png
new file mode 100644
index 00000000000..93a802454f2
--- /dev/null
+++ b/doc/user/project/merge_requests/img/collapse-comment_v14_8.png
Binary files differ
diff --git a/doc/user/project/merge_requests/img/expand-comment_v14_8.png b/doc/user/project/merge_requests/img/expand-comment_v14_8.png
new file mode 100644
index 00000000000..a800eab83e9
--- /dev/null
+++ b/doc/user/project/merge_requests/img/expand-comment_v14_8.png
Binary files differ
diff --git a/doc/user/project/merge_requests/img/file_by_file_v13_2.png b/doc/user/project/merge_requests/img/file_by_file_v13_2.png
deleted file mode 100644
index e3114ebabad..00000000000
--- a/doc/user/project/merge_requests/img/file_by_file_v13_2.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/img/incrementally_expand_merge_request_diffs_v12_2.png b/doc/user/project/merge_requests/img/incrementally_expand_merge_request_diffs_v12_2.png
deleted file mode 100644
index e3a2ff7960c..00000000000
--- a/doc/user/project/merge_requests/img/incrementally_expand_merge_request_diffs_v12_2.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/img/merge_request_diff_file_navigation.png b/doc/user/project/merge_requests/img/merge_request_diff_file_navigation.png
deleted file mode 100644
index 1cdac5ef573..00000000000
--- a/doc/user/project/merge_requests/img/merge_request_diff_file_navigation.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/img/mr-diff-example_v14_8.png b/doc/user/project/merge_requests/img/mr-diff-example_v14_8.png
new file mode 100644
index 00000000000..1984defde9a
--- /dev/null
+++ b/doc/user/project/merge_requests/img/mr-diff-example_v14_8.png
Binary files differ
diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md
index 8222d696853..9872bd2e936 100644
--- a/doc/user/project/merge_requests/index.md
+++ b/doc/user/project/merge_requests/index.md
@@ -94,7 +94,7 @@ You cannot undo the deletion of a merge request.
To delete a merge request:
-1. Sign in to GitLab as a user with the project Owner [role](../../permissions.md).
+1. Sign in to GitLab as a user with the project Owner role.
Only users with this role can delete merge requests in a project.
1. Go to the merge request you want to delete, and select **Edit**.
1. Scroll to the bottom of the page, and select **Delete merge request**.
@@ -137,3 +137,4 @@ For a web developer writing a webpage for your company's website:
- [Suggest code changes](reviews/suggestions.md)
- [Commits](commits.md)
- [CI/CD pipelines](../../../ci/index.md)
+- [Push options](../push_options.md) for merge requests
diff --git a/doc/user/project/merge_requests/load_performance_testing.md b/doc/user/project/merge_requests/load_performance_testing.md
index 40859c6b572..cc4ad186771 100644
--- a/doc/user/project/merge_requests/load_performance_testing.md
+++ b/doc/user/project/merge_requests/load_performance_testing.md
@@ -1,13 +1,12 @@
---
stage: Verify
-group: Testing
+group: Pipeline Insights
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference, howto
---
# Load Performance Testing **(PREMIUM)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10683) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10683) in GitLab 13.2.
With Load Performance Testing, you can test the impact of any pending code changes
to your application's backend in [GitLab CI/CD](../../../ci/index.md).
diff --git a/doc/user/project/merge_requests/merge_request_dependencies.md b/doc/user/project/merge_requests/merge_request_dependencies.md
index aace1f58c62..6bfef6ab134 100644
--- a/doc/user/project/merge_requests/merge_request_dependencies.md
+++ b/doc/user/project/merge_requests/merge_request_dependencies.md
@@ -7,9 +7,9 @@ type: reference, concepts
# Merge request dependencies **(PREMIUM)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9688) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.2.
-> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17291) from "Cross-project dependencies" to "Merge request dependencies" in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4.
-> - Intra-project MR dependencies were [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16799) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9688) in GitLab 12.2.
+> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17291) from "Cross-project dependencies" to "Merge request dependencies" in GitLab 12.4.
+> - Intra-project MR dependencies were [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16799) in GitLab 12.4.
Merge request dependencies allows a required order of merging
between merge requests to be expressed. If a merge request "depends on" another,
diff --git a/doc/user/project/merge_requests/reviews/index.md b/doc/user/project/merge_requests/reviews/index.md
index c34a8116625..280ae07b401 100644
--- a/doc/user/project/merge_requests/reviews/index.md
+++ b/doc/user/project/merge_requests/reviews/index.md
@@ -23,8 +23,8 @@ review merge requests in Visual Studio Code.
## Review a merge request
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213) in GitLab Premium 11.4.
-> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/28154) to GitLab Free in 13.1.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213) in GitLab 11.4.
+> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/28154) from GitLab Premium to GitLab Free in 13.1.
When you review a merge request, you can create comments that are visible only
to you. When you're ready, you can publish them together in a single action.
@@ -160,7 +160,7 @@ Multiline comments display the comment's line numbers above the body of the comm
## Bulk edit merge requests at the project level
-Users with permission level of [Developer or higher](../../../permissions.md) can manage merge requests.
+Users with at least the Developer role can manage merge requests.
When bulk-editing merge requests in a project, you can edit the following attributes:
@@ -179,11 +179,11 @@ To update multiple project merge requests at the same time:
1. Select the appropriate fields and their values from the sidebar.
1. Click **Update all**.
-## Bulk edit merge requests at the group level
+## Bulk edit merge requests at the group level **(PREMIUM)**
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/12719) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.2.
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/12719) in GitLab 12.2.
-Users with permission level of [Developer or higher](../../../permissions.md) can manage merge requests.
+Users with at least the Developer role can manage merge requests.
When bulk editing merge requests in a group, you can edit the following attributes:
diff --git a/doc/user/project/merge_requests/reviews/suggestions.md b/doc/user/project/merge_requests/reviews/suggestions.md
index 1b2a35ba139..9868f2619ba 100644
--- a/doc/user/project/merge_requests/reviews/suggestions.md
+++ b/doc/user/project/merge_requests/reviews/suggestions.md
@@ -42,7 +42,7 @@ After the author applies a suggestion:
1. The suggestion is marked as **Applied**.
1. The thread is resolved.
1. GitLab creates a new commit with the changes.
-1. If the user has the [Developer role](../../../permissions.md), GitLab pushes
+1. If the user has the Developer role, GitLab pushes
the suggested change directly into the codebase in the merge request's branch.
## Multi-line suggestions
@@ -114,7 +114,7 @@ introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381).
## Batch suggestions
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](https://about.gitlab.com/handbook/product/gitlab-the-product/#alpha) with a flag named `batch_suggestions`, disabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](../../../../policy/alpha-beta-support.md#alpha-features) with a flag named `batch_suggestions`, disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/227799) in GitLab 13.2.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/320755) in GitLab 13.11. [Feature flag `batch_suggestions`](https://gitlab.com/gitlab-org/gitlab/-/issues/320755) removed.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/326168) custom commit messages for batch suggestions in GitLab 14.4.
diff --git a/doc/user/project/merge_requests/status_checks.md b/doc/user/project/merge_requests/status_checks.md
index f5ebfb3668c..a952c0550bc 100644
--- a/doc/user/project/merge_requests/status_checks.md
+++ b/doc/user/project/merge_requests/status_checks.md
@@ -28,6 +28,32 @@ You can configure merge request status checks for each individual project. These
To learn more about use cases, feature discovery, and development timelines,
see the [external status checks epic](https://gitlab.com/groups/gitlab-org/-/epics/3869).
+## Lifecycle
+
+External status checks have an **asynchronous** workflow. Merge requests emit a merge request webhook payload to an external service whenever:
+
+- The merge request is changed. For example, title or description.
+- Code is pushed to the source branch of the merge request.
+- A comment is made in the merge request discussion.
+
+```mermaid
+sequenceDiagram
+ Merge request->>+External service: Merge request payload
+ External service-->>-Merge request: Status check response
+ Note over External service,Merge request: Response includes SHA at HEAD
+```
+
+When the payload is received, the external service can then run any required processes before posting its response back to the merge request [using the REST API](../../../api/status_checks.md#set-status-of-an-external-status-check).
+
+Merge requests return a `409 Conflict` error to any responses that do not refer to the current `HEAD` of the source branch. As a result, it's safe for the external service to process and respond to out-of-date commits.
+
+External status checks have the following states:
+
+- `pending` - The default state. No response can been received by the merge request from the external service.
+- `response received` - A response from the external service has been received and approved by it.
+
+Support for adding a `failed` state is tracked [in this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/338827).
+
## View the status checks on a project
Within each project's settings, you can see a list of status checks added to the project:
diff --git a/doc/user/project/merge_requests/test_coverage_visualization.md b/doc/user/project/merge_requests/test_coverage_visualization.md
index 1f84964c619..bd54eda42f5 100644
--- a/doc/user/project/merge_requests/test_coverage_visualization.md
+++ b/doc/user/project/merge_requests/test_coverage_visualization.md
@@ -1,8 +1,7 @@
---
stage: Verify
-group: Testing
+group: Pipeline Insights
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: reference, howto
---
# Test coverage visualization **(FREE)**
@@ -40,6 +39,7 @@ Other coverage analysis frameworks support the format out of the box, for exampl
- [Istanbul](https://istanbul.js.org/docs/advanced/alternative-reporters/#cobertura) (JavaScript)
- [Coverage.py](https://coverage.readthedocs.io/en/coverage-5.0.4/cmd.html#xml-reporting) (Python)
+- [PHPUnit](https://github.com/sebastianbergmann/phpunit-documentation-english/blob/master/src/textui.rst#command-line-options) (PHP)
Once configured, if you create a merge request that triggers a pipeline which collects
coverage reports, the coverage is shown in the diff view. This includes reports
@@ -52,6 +52,8 @@ from any job in any stage in the pipeline. The coverage displays for each line:
Hovering over the coverage bar provides further information, such as the number
of times the line was checked by tests.
+Uploading a test coverage report does not enable [test coverage results in Merge Requests](../../../ci/pipelines/settings.md#add-test-coverage-results-to-a-merge-request-deprecated) or [code coverage history](../../../ci/pipelines/settings.md#view-code-coverage-history). You must configure these separately.
+
### Limits
A limit of 100 `<source>` nodes for Cobertura format XML files applies. If your Cobertura report exceeds
@@ -133,6 +135,9 @@ The `source` is ignored if the path does not follow this pattern. The parser ass
## Example test coverage configurations
+This section provides test coverage configuration examples for different programming languages. You can also see a working example in
+the [`coverage-report`](https://gitlab.com/gitlab-org/ci-sample-projects/coverage-report/) demonstration project.
+
### JavaScript example
The following [`.gitlab-ci.yml`](../../../ci/yaml/index.md) example uses [Mocha](https://mochajs.org/)
@@ -236,7 +241,7 @@ run tests:
image: python:3
script:
- pip install pytest pytest-cov
- - coverage run -m pytest
+ - coverage run -m pytest
- coverage report
- coverage xml
artifacts:
@@ -244,6 +249,42 @@ run tests:
cobertura: coverage.xml
```
+### PHP example
+
+The following [`.gitlab-ci.yml`](../../../ci/yaml/index.md) example for PHP uses [PHPUnit](https://phpunit.readthedocs.io/)
+to collect test coverage data and generate the report.
+
+With a minimal [`phpunit.xml`](https://phpunit.readthedocs.io/en/9.5/configuration.html) file (you may reference
+[this example repository](https://gitlab.com/yookoala/code-coverage-visualization-with-php/)), you can run the test and
+generate the coverage xml:
+
+```yaml
+run tests:
+ stage: test
+ image: php:latest
+ variables:
+ XDEBUG_MODE: coverage
+ before_script:
+ - apt-get update && apt-get -yq install git unzip zip libzip-dev zlib1g-dev
+ - docker-php-ext-install zip
+ - pecl install xdebug && docker-php-ext-enable xdebug
+ - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+ - php composer-setup.php --install-dir=/usr/local/bin --filename=composer
+ - composer install
+ - composer require --dev phpunit/phpunit phpunit/php-code-coverage
+ script:
+ - php ./vendor/bin/phpunit --coverage-text --coverage-cobertura=coverage.cobertura.xml
+ artifacts:
+ reports:
+ cobertura: coverage.cobertura.xml
+```
+
+[Codeception](https://codeception.com/), through PHPUnit, also supports generating Cobertura report with
+[`run`](https://codeception.com/docs/reference/Commands#run). The path for the generated file
+depends on the `--coverage-cobertura` option and [`paths`](https://codeception.com/docs/reference/Configuration#paths)
+configuration for the [unit test suite](https://codeception.com/docs/05-UnitTests). Configure `.gitlab-ci.yml`
+to find Cobertura in the appropriate path.
+
### C/C++ example
The following [`.gitlab-ci.yml`](../../../ci/yaml/index.md) example for C/C++ with
@@ -272,3 +313,62 @@ run tests:
reports:
cobertura: build/coverage.xml
```
+
+### Go example
+
+The following [`.gitlab-ci.yml`](../../../ci/yaml/index.md) example for Go uses:
+
+- [`go test`](https://go.dev/doc/tutorial/add-a-test) to run tests.
+- [`gocover-cobertura`](https://github.com/t-yuki/gocover-cobertura) to convert Go's coverage profile into the Cobertura XML format.
+
+This example assumes that [Go modules](https://go.dev/ref/mod) are being used.
+Using Go modules causes paths within the coverage profile to be prefixed with your
+project's module identifier, which can be found in the `go.mod` file. This
+prefix must be removed for GitLab to parse the Cobertura XML file correctly. You can use the following `sed` command to remove the prefix:
+
+```shell
+sed -i 's;filename=\"<YOUR_MODULE_ID>/;filename=\";g' coverage.xml
+```
+
+Replace the `gitlab.com/my-group/my-project` placeholder in the following example with your own module identifier to make it work.
+
+```yaml
+run tests:
+ stage: test
+ image: golang:1.17
+ script:
+ - go install
+ - go test . -coverprofile=coverage.txt -covermode count
+ - go run github.com/t-yuki/gocover-cobertura < coverage.txt > coverage.xml
+ - sed -i 's;filename=\"gitlab.com/my-group/my-project/;filename=\";g' coverage.xml
+ artifacts:
+ reports:
+ cobertura: coverage.xml
+```
+
+### Ruby example
+
+The following [`.gitlab-ci.yml`](../../../ci/yaml/index.md) example for Ruby uses
+
+- [`rspec`](https://rspec.info/) to run tests.
+- [`simplecov`](https://github.com/simplecov-ruby/simplecov) and [`simplecov-cobertura`](https://github.com/dashingrocket/simplecov-cobertura)
+ to record the coverage profile and create a report in the Cobertura XML format.
+
+This example assumes:
+
+- That [`bundler`](https://bundler.io/) is being used for dependency management.
+ The `rspec`, `simplecov` and `simplecov-cobertura` gems have been added to your `Gemfile`.
+- The `CoberturaFormatter` has been added to your `SimpleCov.formatters`
+ configuration within the `spec_helper.rb` file.
+
+```yaml
+run tests:
+ stage: test
+ image: ruby:3.1
+ script:
+ - bundle install
+ - bundle exec rspec
+ artifacts:
+ reports:
+ cobertura: coverage/coverage.xml
+```
diff --git a/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md b/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
index 0a9a2a37bfe..741ac325cca 100644
--- a/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
+++ b/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
@@ -1,8 +1,7 @@
---
stage: Verify
-group: Testing
+group: Pipeline Insights
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
-type: index
description: "Test your code and display reports in merge requests"
---
@@ -11,21 +10,21 @@ description: "Test your code and display reports in merge requests"
GitLab has the ability to test the changes included in a feature branch and display reports
or link to useful information directly from merge requests:
-| Feature | Description |
-|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [Accessibility Testing](accessibility_testing.md) | Automatically report A11y violations for changed pages in merge requests. |
-| [Browser Performance Testing](browser_performance_testing.md) **(PREMIUM)** | Quickly determine the browser performance impact of pending code changes. |
-| [Load Performance Testing](load_performance_testing.md) **(PREMIUM)** | Quickly determine the server performance impact of pending code changes. |
-| [Code Quality](code_quality.md) | Analyze your source code quality using the [Code Climate](https://codeclimate.com/) analyzer and show the Code Climate report right in the merge request widget area. |
-| [Display arbitrary job artifacts](../../../ci/yaml/index.md#artifactsexpose_as) | Configure CI pipelines with the `artifacts:expose_as` parameter to directly link to selected [artifacts](../../../ci/pipelines/job_artifacts.md) in merge requests. |
-| [GitLab CI/CD](../../../ci/index.md) | Build, test, and deploy your code in a per-branch basis with built-in CI/CD. |
-| [Unit test reports](../../../ci/unit_test_reports.md) | Configure your CI jobs to use Unit test reports, and let GitLab display a report on the merge request so that it's easier and faster to identify the failure without having to check the entire job log. |
-| [License Compliance](../../compliance/license_compliance/index.md) **(ULTIMATE)** | Manage the licenses of your dependencies. |
-| [Metrics Reports](../../../ci/metrics_reports.md) **(PREMIUM)** | Display the Metrics Report on the merge request so that it's fast and easy to identify changes to important metrics. |
-| [Multi-Project pipelines](../../../ci/pipelines/multi_project_pipelines.md) **(PREMIUM)** | When you set up GitLab CI/CD across multiple projects, you can visualize the entire pipeline, including all cross-project interdependencies. |
-| [Pipelines for merge requests](../../../ci/pipelines/merge_request_pipelines.md) | Customize a specific pipeline structure for merge requests in order to speed the cycle up by running only important jobs. |
-| [Pipeline Graphs](../../../ci/pipelines/index.md#visualize-pipelines) | View the status of pipelines within the merge request, including the deployment process. |
-| [Test Coverage visualization](test_coverage_visualization.md) | See test coverage results for merge requests, within the file diff. |
+| Feature | Description |
+|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [Accessibility Testing](accessibility_testing.md) | Automatically report A11y violations for changed pages in merge requests. |
+| [Browser Performance Testing](browser_performance_testing.md) | Quickly determine the browser performance impact of pending code changes. |
+| [Load Performance Testing](load_performance_testing.md) | Quickly determine the server performance impact of pending code changes. |
+| [Code Quality](code_quality.md) | Analyze your source code quality using the [Code Climate](https://codeclimate.com/) analyzer and show the Code Climate report right in the merge request widget area. |
+| [Display arbitrary job artifacts](../../../ci/yaml/index.md#artifactsexpose_as) | Configure CI pipelines with the `artifacts:expose_as` parameter to directly link to selected [artifacts](../../../ci/pipelines/job_artifacts.md) in merge requests. |
+| [GitLab CI/CD](../../../ci/index.md) | Build, test, and deploy your code in a per-branch basis with built-in CI/CD. |
+| [Unit test reports](../../../ci/unit_test_reports.md) | Configure your CI jobs to use Unit test reports, and let GitLab display a report on the merge request so that it's easier and faster to identify the failure without having to check the entire job log. |
+| [License Compliance](../../compliance/license_compliance/index.md) | Manage the licenses of your dependencies. |
+| [Metrics Reports](../../../ci/metrics_reports.md) | Display the Metrics Report on the merge request so that it's fast and easy to identify changes to important metrics. |
+| [Multi-Project pipelines](../../../ci/pipelines/multi_project_pipelines.md) | When you set up GitLab CI/CD across multiple projects, you can visualize the entire pipeline, including all cross-project interdependencies. |
+| [Merge request pipelines](../../../ci/pipelines/merge_request_pipelines.md) | Customize a specific pipeline structure for merge requests in order to speed the cycle up by running only important jobs. |
+| [Pipeline Graphs](../../../ci/pipelines/index.md#visualize-pipelines) | View the status of pipelines within the merge request, including the deployment process. |
+| [Test Coverage visualization](test_coverage_visualization.md) | See test coverage results for merge requests, within the file diff. |
## Security Reports **(ULTIMATE)**