Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /doc/user/project/merge_requests
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'doc/user/project/merge_requests')
-rw-r--r--doc/user/project/merge_requests/allow_collaboration.md4
-rw-r--r--doc/user/project/merge_requests/approvals/index.md24
-rw-r--r--doc/user/project/merge_requests/approvals/rules.md48
-rw-r--r--doc/user/project/merge_requests/approvals/settings.md17
-rw-r--r--doc/user/project/merge_requests/cherry_pick_changes.md12
-rw-r--r--doc/user/project/merge_requests/commits.md62
-rw-r--r--doc/user/project/merge_requests/confidential.md2
-rw-r--r--doc/user/project/merge_requests/conflicts.md5
-rw-r--r--doc/user/project/merge_requests/creating_merge_requests.md28
-rw-r--r--doc/user/project/merge_requests/csv_export.md2
-rw-r--r--doc/user/project/merge_requests/dependencies.md2
-rw-r--r--doc/user/project/merge_requests/drafts.md3
-rw-r--r--doc/user/project/merge_requests/getting_started.md11
-rw-r--r--doc/user/project/merge_requests/img/commit_nav_v16_0.pngbin0 -> 10423 bytes
-rw-r--r--doc/user/project/merge_requests/img/previously_merged_commits_v16_0.pngbin0 -> 15992 bytes
-rw-r--r--doc/user/project/merge_requests/img/remove_source_branch_status.pngbin32586 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/index.md77
-rw-r--r--doc/user/project/merge_requests/merge_when_pipeline_succeeds.md15
-rw-r--r--doc/user/project/merge_requests/methods/index.md1
-rw-r--r--doc/user/project/merge_requests/revert_changes.md3
-rw-r--r--doc/user/project/merge_requests/reviews/data_usage.md2
-rw-r--r--doc/user/project/merge_requests/reviews/img/add_another_suggestion_to_batch_v13_1.jpgbin23078 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/add_first_suggestion_to_batch_v13_1.jpgbin24694 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/apply_batch_of_suggestions_v13_1.jpgbin26551 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/apply_suggestion_v13_9.pngbin37127 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/custom_commit_v13_9.pngbin41069 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/make_suggestion_v13_9.pngbin30463 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/multi-line-suggestion-syntax.pngbin8831 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/remove_suggestion_from_batch_v13_1.jpgbin24101 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/suggestion_button_v13_9.pngbin27319 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.pngbin14774 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/index.md22
-rw-r--r--doc/user/project/merge_requests/reviews/suggestions.md204
-rw-r--r--doc/user/project/merge_requests/squash_and_merge.md13
-rw-r--r--doc/user/project/merge_requests/status_checks.md16
35 files changed, 366 insertions, 207 deletions
diff --git a/doc/user/project/merge_requests/allow_collaboration.md b/doc/user/project/merge_requests/allow_collaboration.md
index 0729e024df4..d5851050fd4 100644
--- a/doc/user/project/merge_requests/allow_collaboration.md
+++ b/doc/user/project/merge_requests/allow_collaboration.md
@@ -61,14 +61,14 @@ In the following example:
To change or add a commit to the contributor's merge request:
1. Go to the merge request.
-1. In the upper right corner, select **Code**, then select **Check out branch**.
+1. In the upper-right corner, select **Code**, then select **Check out branch**.
1. In the modal window, select **Copy** (**{copy-to-clipboard}**).
1. In your terminal, go to your cloned version of the repository, and
paste the commands. For example:
```shell
git fetch "git@gitlab.com:contributor/forked-project.git" 'fork-branch'
- git checkout -b contributor/fork-branch' FETCH_HEAD
+ git checkout -b 'contributor/fork-branch' FETCH_HEAD
```
Those commands fetch the branch from the forked project, and create a local branch
diff --git a/doc/user/project/merge_requests/approvals/index.md b/doc/user/project/merge_requests/approvals/index.md
index 21e2055cb61..717358df9f3 100644
--- a/doc/user/project/merge_requests/approvals/index.md
+++ b/doc/user/project/merge_requests/approvals/index.md
@@ -3,7 +3,6 @@ stage: Create
group: Source Code
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference, concepts
-disqus_identifier: 'https://docs.gitlab.com/ee/user/project/merge_requests/approvals/index.html'
---
# Merge request approvals **(FREE)**
@@ -17,7 +16,7 @@ approve merge requests, these approvals are [optional](#optional-approvals).
flexibility:
- Create required [rules](rules.md) about the number and type of approvers before work can merge.
-- Specify a list of users who act as [code owners](../../code_owners.md) for specific files,
+- Specify a list of users who act as [code owners](../../codeowners/index.md) for specific files,
and require their approval before work can merge.
You can configure merge request approvals on a per-project basis, and some approvals can be configured
@@ -36,7 +35,7 @@ required approvals before work can merge into your project. You can also extend
rules to define what types of users can approve work. Some examples of rules you can create include:
- Users with specific permissions can always approve work.
-- [Code owners](../../code_owners.md) can approve work for files they own.
+- [Code owners](../../codeowners/index.md) can approve work for files they own.
- Users with specific permissions can approve work,
[even if they don't have merge rights](rules.md#merge-request-approval-segregation-of-duties)
to the repository.
@@ -102,20 +101,31 @@ Without the approvals, the work cannot merge. Required approvals enable multiple
database, for all proposed code changes.
- Use the [code owners of changed files](rules.md#code-owners-as-eligible-approvers),
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 an [approval before merging code that causes test coverage to decline](../../../../ci/testing/code_coverage.md#coverage-check-approval-rule).
- Users on GitLab Ultimate can also [require approval from a security team](../../../application_security/index.md#security-approvals-in-merge-requests)
before merging code that could introduce a vulnerability.
## Invalid rules
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/334698) in GitLab 15.1.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/334698) in GitLab 15.1.
+> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/389905) in GitLab 15.11 [with a flag](../../../../administration/feature_flags.md) named `invalid_scan_result_policy_prevents_merge`. Disabled by default.
-Whenever an approval rule cannot be satisfied, the rule will be displayed as `Invalid`. This applies to the following conditions:
+FLAG:
+On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance,
+ask an administrator to [enable the feature flag](../../../../administration/feature_flags.md) named `invalid_scan_result_policy_prevents_merge`.
+On GitLab.com, this feature is available but can be configured by GitLab.com administrators only.
+
+Whenever an approval rule cannot be satisfied, the rule is displayed as **(!) Auto approved**. This applies to the following conditions:
- The only eligible approver is the author of the merge request.
- No eligible approvers (either groups or users) have been assigned to the approval rule.
+- The number of required approvals is more than the number of eligible approvers.
+
+These rules are automatically approved to unblock their respective merge requests,
+unless they were created through a security policy.
-These rules will be automatically approved to unblock their respective merge requests.
+Invalid approval rules created through a security policy are presented with **(!) Action Required**
+and are not automatically approved, blocking their respective merge requests.
## Related topics
diff --git a/doc/user/project/merge_requests/approvals/rules.md b/doc/user/project/merge_requests/approvals/rules.md
index 0a5e7c29860..d55ca5dff04 100644
--- a/doc/user/project/merge_requests/approvals/rules.md
+++ b/doc/user/project/merge_requests/approvals/rules.md
@@ -53,7 +53,7 @@ To add a merge request approval rule:
1. Select **Add approval rule**.
-Users of GitLab Premium and higher tiers can create [additional approval rules](#add-multiple-approval-rules).
+Users of GitLab Premium and Ultimate tiers can create [additional approval rules](#add-multiple-approval-rules).
Your configuration for approval rule overrides determines if the new rule is applied
to existing merge requests:
@@ -91,7 +91,7 @@ To edit a merge request approval rule:
> [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
+In GitLab Premium and Ultimate tiers, you can enforce multiple approval rules on a
merge request, and multiple default approval rules for a project. If your tier
supports multiple default rules:
@@ -106,6 +106,9 @@ reduces the number of approvals left (the **Approvals** column) for all rules th
![Approvals premium merge request widget](img/approvals_premium_mr_widget_v13_3.png)
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see [Multiple Approvers](https://www.youtube.com/watch?v=8JQJ5821FrA).
+
## Eligible approvers
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10294) in GitLab 13.3, when an eligible approver comments on a merge request, it appears in the **Commented by** column of the Approvals widget.
@@ -131,7 +134,7 @@ who commented on the merge request. It helps authors and reviewers identify who
contact with questions about the merge request's content.
If the number of required approvals is greater than the number of assigned approvers,
-approvals from other users with Developer [permissions](../../../permissions.md) or higher
+approvals from other users with at least the Developer [role](../../../permissions.md)
in the project counts toward meeting the required number of approvals, even if the
users were not explicitly listed in the approval rules.
@@ -158,7 +161,7 @@ approve in these ways:
> Moved to GitLab Premium in 13.9.
-If you add [code owners](../../code_owners.md) to your repository, the owners of files
+If you add [code owners](../../codeowners/index.md) to your repository, the owners of files
become eligible approvers in the project. To enable this merge request approval rule:
1. Go to your project and select **Settings > Merge requests**.
@@ -241,6 +244,28 @@ approval rule for certain branches:
1. To enable this configuration, read
[Code Owner's approvals for protected branches](../../protected_branches.md#require-code-owner-approval-on-a-protected-branch).
+## Code coverage check approval
+
+You can require specific approvals in the case that a merge request would reduce code test
+coverage.
+
+For more information, see [Coverage check approval rule](../../../../ci/testing/code_coverage.md#coverage-check-approval-rule).
+
+## Security Approvals **(ULTIMATE)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/357021) in GitLab 15.0.
+
+You can use [scan result policies](../../../application_security/policies/scan-result-policies.md#scan-result-policy-editor) to define security approvals based on the status of vulnerabilities in the merge request and the default branch.
+Details for each security policy is shown in the Security Approvals section of your Merge Request configuration.
+
+The security approval rules are applied to all merge requests until the pipeline is complete. The application of the
+security approval rules prevents users from merging in code before the security scans run. After the pipeline is
+complete, the security approval rules are checked to determine if the security approvals are still required.
+
+![Security Approvals](img/security_approvals_v15_0.png)
+
+These policies are both created and edited in the [security policy editor](../../../application_security/policies/index.md#policy-editor).
+
## Troubleshooting
### Approval rule name can't be blank
@@ -262,18 +287,3 @@ isn't recognized as a valid Code Owner for the project, nor does it display in t
project's **Approvals** list. To fix this problem, add the approval group as a shared group
high enough in the shared hierarchy so the project requiring review inherits this
group of users.
-
-## Security Approvals **(ULTIMATE)**
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/357021) in GitLab 15.0.
-
-You can use [scan result policies](../../../application_security/policies/scan-result-policies.md#scan-result-policy-editor) to define security approvals based on the status of vulnerabilities in the merge request and the default branch.
-Details for each security policy is shown in the Security Approvals section of your Merge Request configuration.
-
-The security approval rules are applied to all merge requests until the pipeline is complete. The application of the
-security approval rules prevents users from merging in code before the security scans run. Once the pipeline is
-complete, the security approval rules are checked to determine if the security approvals are still required.
-
-![Security Approvals](img/security_approvals_v15_0.png)
-
-These policies are both created and edited in the [security policy editor](../../../application_security/policies/index.md#policy-editor).
diff --git a/doc/user/project/merge_requests/approvals/settings.md b/doc/user/project/merge_requests/approvals/settings.md
index 1ab564c108b..6c079dc9319 100644
--- a/doc/user/project/merge_requests/approvals/settings.md
+++ b/doc/user/project/merge_requests/approvals/settings.md
@@ -78,13 +78,13 @@ their own. To do this:
it can't be changed at the project level.
1. Select **Save changes**.
-Depending on your version of GitLab, [code owners](../../code_owners.md) who commit
+Depending on your version of GitLab, [code owners](../../codeowners/index.md) who commit
to a merge request may or may not be able to approve the work:
-- In GitLab 13.10 and earlier, [code owners](../../code_owners.md) who commit
+- In GitLab 13.10 and earlier, code owners who commit
to a merge request can approve it, even if the merge request affects files they own.
- In [GitLab 13.11 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/331548),
- [code owners](../../code_owners.md) who commit
+ code owners who commit
to a merge request cannot approve it, when the merge request affects files they own.
For more information, see the [official Git documentation](https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History).
@@ -121,7 +121,7 @@ permission enables an electronic signature for approvals, such as the one define
## Remove all approvals when commits are added to the source branch
By default, an approval on a merge request is removed when you add more changes
-after the approval. In GitLab Premium and higher tiers, to keep existing approvals
+after the approval. In GitLab Premium and Ultimate tiers, to keep existing approvals
after more changes are added to the merge request:
1. On the left sidebar, select **Settings > Merge requests**.
@@ -140,7 +140,7 @@ However, approvals are reset if the target branch is changed.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90578) in GitLab 15.3.
-If you only want to remove approvals by Code Owners whose files have been changed:
+If you only want to remove approvals by Code Owners whose files have been changed when a commit is added:
Prerequisite:
@@ -153,13 +153,6 @@ To do this:
select **Remove approvals by Code Owners if their files changed**.
1. Select **Save changes**.
-## Code coverage check approvals
-
-You can require specific approvals if a merge request would result in a decline in code test
-coverage.
-
-For more information, see [Coverage check approval rule](../../../../ci/pipelines/settings.md#coverage-check-approval-rule).
-
## Settings cascading
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/285410) in GitLab 14.4. [Deployed behind the `group_merge_request_approval_settings_feature_flag` flag](../../../../administration/feature_flags.md), disabled by default.
diff --git a/doc/user/project/merge_requests/cherry_pick_changes.md b/doc/user/project/merge_requests/cherry_pick_changes.md
index 9fac872ac4b..004d24778b7 100644
--- a/doc/user/project/merge_requests/cherry_pick_changes.md
+++ b/doc/user/project/merge_requests/cherry_pick_changes.md
@@ -55,7 +55,7 @@ by the merge request:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Merge requests**, and find your merge request.
1. Scroll to the merge request reports section, and find the **Merged by** report.
-1. In the upper right, select **Cherry-pick**:
+1. In the upper-right corner, select **Cherry-pick**:
![Cherry-pick merge request](img/cherry_pick_v15_4.png)
1. In the modal window, select the project and branch to cherry-pick into.
@@ -72,7 +72,8 @@ To cherry-pick a commit from the list of all commits for a project:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Repository > Commits**.
-1. Select the title of the commit you want to cherry-pick.
+1. Select the [title](https://git-scm.com/docs/git-commit#_discussion) of the commit you want to cherry-pick.
+1. In the upper-right corner, select **Options > Cherry-pick** to show the cherry-pick modal.
1. In the modal window, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
1. Select **Cherry-pick**.
@@ -86,7 +87,7 @@ list of commits included in a merge request:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Merge requests**, and find your merge request.
1. In the merge request's secondary menu, select **Commits** to display the commit details page.
-1. Select the title of the commit you want to cherry-pick.
+1. Select the [title](https://git-scm.com/docs/git-commit#_discussion) of the commit you want to cherry-pick.
1. In the upper-right corner, select **Options > Cherry-pick** to show the cherry-pick modal.
1. In the modal window, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
@@ -100,7 +101,8 @@ when you view that file in your project's Git repository:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Repository > Files** and go to the file
changed by the commit.
-1. Select **History**, then select the title of the commit you want to cherry-pick.
+1. Select **History**, then select the [title](https://git-scm.com/docs/git-commit#_discussion)
+ of the commit you want to cherry-pick.
1. In the upper-right corner, select **Options > Cherry-pick** to show the cherry-pick modal.
1. In the modal window, select the project and branch to cherry-pick into.
1. Optional. Select **Start a new merge request with these changes**.
@@ -123,7 +125,7 @@ project, from the GitLab user interface:
## View system notes for cherry-picked commits
-When you cherry-pick a merge commit in the GitLab UI or API, GitLab adds a system note
+When you cherry-pick a merge commit in the GitLab UI or API, GitLab adds a [system note](../system_notes.md)
to the related merge request thread in the format **{cherry-pick-commit}**
`[USER]` **picked the changes into the branch** `[BRANCHNAME]` with commit** `[SHA]` `[DATE]`:
diff --git a/doc/user/project/merge_requests/commits.md b/doc/user/project/merge_requests/commits.md
index a9f67c39ae8..cc6ecd8398f 100644
--- a/doc/user/project/merge_requests/commits.md
+++ b/doc/user/project/merge_requests/commits.md
@@ -1,11 +1,59 @@
---
-redirect_to: '../merge_requests/index.md'
-remove_date: '2023-03-12'
+stage: Create
+group: Code Review
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
+type: index, reference
---
-This document was removed.
+# Merge request commits **(FREE)**
-<!-- This redirect file can be deleted after <2023-03-12>. -->
-<!-- Redirects that point to other docs in the same project expire in three months. -->
-<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
-<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
+Each merge request has a history of the commits made to the source branch
+after the merge request was created.
+
+These commits are displayed on the merge request's **Commits** tab.
+From this tab, you can review commit messages and copy a commit's SHA when you need to
+[cherry-pick changes](cherry_pick_changes.md).
+
+## Navigate merge request commits
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/18140) in GitLab 13.0.
+
+To navigate commits in a merge request:
+
+1. Select the **Commits** tab.
+1. Select the commit link. The most recent commit is displayed.
+1. Navigate through the commits by either:
+
+ - Selecting **Prev** and **Next** buttons below the tab buttons.
+ - Using the <kbd>X</kbd> and <kbd>C</kbd> keyboard shortcuts.
+
+![Merge requests commit navigation](img/commit_nav_v16_0.png)
+
+## View merge request commits in context
+
+> - [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.
+> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/320757) in GitLab 14.9. [Feature flag `context_commits`](https://gitlab.com/gitlab-org/gitlab/-/issues/320757) removed.
+
+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
+that have already merged that the change is built on.
+
+To add previously merged commits to a merge request for more context:
+
+1. Go to your merge request.
+1. Select the **Commits** tab.
+1. Scroll to the end of the list of commits, and select **Add previously merged commits**:
+1. Select the commits that you want to add.
+1. Select **Save changes**.
+
+## View diffs between commits
+
+To view the changes between previously merged commits:
+
+1. On your merge request, select the **Changes** tab.
+1. By **Compare**, select the commit you want to view:
+
+ ![Previously merged commits](img/previously_merged_commits_v16_0.png)
+
+If you selected to add previously merged commits, they are displayed in the list.
diff --git a/doc/user/project/merge_requests/confidential.md b/doc/user/project/merge_requests/confidential.md
index 307998f697d..edcc5711b98 100644
--- a/doc/user/project/merge_requests/confidential.md
+++ b/doc/user/project/merge_requests/confidential.md
@@ -65,7 +65,7 @@ Your branch, merge requests, and commits remain in your private fork. This preve
prematurely revealing confidential information.
Open a merge request
-[from your fork to the upstream repository](../repository/forking_workflow.md#merging-upstream) when:
+[from your fork to the upstream repository](../repository/forking_workflow.md#merge-changes-back-upstream) when:
- You are satisfied the problem is resolved in your private fork.
- You are ready to make the confidential commits public.
diff --git a/doc/user/project/merge_requests/conflicts.md b/doc/user/project/merge_requests/conflicts.md
index 932eec5e631..cc8f8cb2fe6 100644
--- a/doc/user/project/merge_requests/conflicts.md
+++ b/doc/user/project/merge_requests/conflicts.md
@@ -162,9 +162,8 @@ merge commit. Verify it contains no unintended changes and doesn't break your bu
## Related topics
-- [Introduction to Git rebase and force-push](../../../topics/git/git_rebase.md).
-- [Git GUI apps](https://git-scm.com/downloads/guis) to help you visualize the
- differences between branches and resolve them.
+- [Introduction to Git rebase and force-push](../../../topics/git/git_rebase.md)
+- [Git applications for visualizing the Git workflow](https://git-scm.com/downloads/guis)
<!-- ## Troubleshooting
diff --git a/doc/user/project/merge_requests/creating_merge_requests.md b/doc/user/project/merge_requests/creating_merge_requests.md
index 875312bbb7c..a91d324016a 100644
--- a/doc/user/project/merge_requests/creating_merge_requests.md
+++ b/doc/user/project/merge_requests/creating_merge_requests.md
@@ -3,15 +3,17 @@ stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: "How to create merge requests in GitLab."
-disqus_identifier: 'https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html'
---
# Creating merge requests **(FREE)**
-There are many different ways to create a merge request.
+GitLab provides many different ways to create a merge request.
NOTE:
-Use [branch naming patterns](../repository/branches/index.md#naming) to streamline merge request creation.
+GitLab enforces [branch naming rules](../repository/branches/index.md#name-your-branch)
+to prevent problems, and provides
+[branch naming patterns](../repository/branches/index.md#prefix-branch-names-with-issue-numbers)
+to streamline merge request creation.
## From the merge request list
@@ -19,7 +21,7 @@ You can create a merge request from the list of merge requests.
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left menu, select **Merge requests**.
-1. In the upper right, select **New merge request**.
+1. In the upper-right corner, select **New merge request**.
1. Select a source and target branch and then **Compare branches and continue**.
1. Fill out the fields and select **Create merge request**.
@@ -34,7 +36,8 @@ be associated with a given target branch at a time.
If your development workflow requires an issue for every merge
request, you can create a branch directly from the issue to speed the process up.
The new branch, and later its merge request, are marked as related to this issue.
-After merging the merge request, the issue is closed automatically, unless [automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing).
+After merging the merge request, the issue is closed automatically, unless
+[automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing).
You can see a **Create merge request** dropdown list below the issue description.
NOTE:
@@ -50,7 +53,7 @@ instead of immediately creating the merge request.
- Your project is private and the issue is confidential.
To make this button appear, one possible workaround is to
-[remove your project's fork relationship](../settings/index.md#remove-a-fork-relationship).
+[remove your project's fork relationship](../repository/forking_workflow.md#unlink-a-fork).
After removal, the fork relationship cannot be restored. This project can no longer
be able to receive or send merge requests to the source project, or other forks.
@@ -58,8 +61,8 @@ The dropdown list contains the options **Create merge request and branch** and *
After selecting one of these options, a new branch or branch and merge request
is created based on your project's [default branch](../repository/branches/default.md).
-The branch name is based on your project's branch name template. The default template
-is `%{id}-%{title}`. Supported variables for branch name templates are `%{id}` and `%{title}`.
+The branch name is based on your project's [branch name template](../repository/branches/index.md),
+but this value can be changed.
When you select **Create branch** in an empty
repository project, GitLab performs these actions:
@@ -83,7 +86,7 @@ You can create a merge request when you add, edit, or upload a file to a reposit
1. [Add, edit, or upload](../repository/web_editor.md) a file to the repository.
1. In the **Commit message**, enter a reason for the commit.
-1. Select the **Target branch** or create a new branch by typing the name (without spaces, capital letters, or special chars).
+1. Select the **Target branch** or create a new branch by typing the name (without spaces).
1. Select the **Start a new merge request with these changes** checkbox or toggle. This checkbox or toggle is visible only
if the target is not the same as the source branch, or if the source branch is protected.
1. Select **Commit changes**.
@@ -151,9 +154,8 @@ You can create a merge request from your fork to contribute back to the main pro
1. Select **Create merge request**.
After your work is merged, if you don't intend to
-make any other contributions to the upstream project, you can unlink your
-fork from its upstream project. Go to **Settings > Advanced Settings** and
-[remove the forking relationship](../settings/index.md#remove-a-fork-relationship).
+make any other contributions to the upstream project, you can
+[unlink your fork](../repository/forking_workflow.md#unlink-a-fork) from its upstream project.
For more information, [see the forking workflow documentation](../repository/forking_workflow.md).
@@ -171,7 +173,7 @@ To create a merge request by sending an email:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left menu, select **Merge requests**.
-1. In the upper right, select **Email a new merge request to this project**.
+1. In the upper-right corner, select **Email a new merge request to this project**.
An email address is displayed. Copy this address.
Ensure you keep this address private.
1. Open an email and compose a message with the following information:
diff --git a/doc/user/project/merge_requests/csv_export.md b/doc/user/project/merge_requests/csv_export.md
index 9028a9411ea..f40b82a6280 100644
--- a/doc/user/project/merge_requests/csv_export.md
+++ b/doc/user/project/merge_requests/csv_export.md
@@ -16,7 +16,7 @@ To export merge requests to a CSV file:
1. On the left sidebar, select **Merge requests** .
1. Add any searches or filters. This can help you keep the size of the CSV file under the 15 MB limit. The limit ensures
the file can be emailed to a variety of email providers.
-1. Select **Export as CSV** (**{export}**).
+1. Select **Actions** (**{ellipsis_v}**) **> Export as CSV**.
1. Confirm the correct number of merge requests are to be exported.
1. Select **Export merge requests**.
diff --git a/doc/user/project/merge_requests/dependencies.md b/doc/user/project/merge_requests/dependencies.md
index 231c1dda5b7..3d92fc9a91e 100644
--- a/doc/user/project/merge_requests/dependencies.md
+++ b/doc/user/project/merge_requests/dependencies.md
@@ -85,7 +85,7 @@ other specific work merges, even if the merge request is in a different project.
Prerequisites:
- You must have at least the Developer role or be allowed to create merge requests in the project.
-- The dependent merge request must be in a project in a **PREMIUM** or higher tier.
+- The dependent merge request must be in a project in the Premium or Ultimate tier.
To create a new merge request and mark it as dependent on another:
diff --git a/doc/user/project/merge_requests/drafts.md b/doc/user/project/merge_requests/drafts.md
index 62820988701..88e5e4a6283 100644
--- a/doc/user/project/merge_requests/drafts.md
+++ b/doc/user/project/merge_requests/drafts.md
@@ -3,7 +3,6 @@ stage: Create
group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference, concepts
-disqus_identifier: 'https://docs.gitlab.com/ee/user/project/merge_requests/work_in_progress_merge_requests.html'
---
# Draft merge requests **(FREE)**
@@ -31,7 +30,7 @@ There are several ways to flag a merge request as a draft:
below the **Title** field.
- **Commenting in an existing merge request**: Add the `/draft`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
- in a comment. GitLab 15.4 [deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92654) the toggle behavior of `/draft`. To mark a merge request as ready, use `/ready`.
+ in a comment. To mark a merge request as ready, use `/ready`.
- **Creating a commit**: Add `draft:`, `Draft:`, `fixup!`, or `Fixup!` to the
beginning of a commit message targeting the merge request's source branch. This
is not a toggle, and adding this text again in a later commit doesn't mark the
diff --git a/doc/user/project/merge_requests/getting_started.md b/doc/user/project/merge_requests/getting_started.md
deleted file mode 100644
index 4125d8e8fdb..00000000000
--- a/doc/user/project/merge_requests/getting_started.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-redirect_to: 'index.md'
-remove_date: '2023-03-31'
----
-
-This document was moved to [another location](index.md).
-
-<!-- This redirect file can be deleted after <2023-03-31>. -->
-<!-- Redirects that point to other docs in the same project expire in three months. -->
-<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
-<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
diff --git a/doc/user/project/merge_requests/img/commit_nav_v16_0.png b/doc/user/project/merge_requests/img/commit_nav_v16_0.png
new file mode 100644
index 00000000000..6005e516fff
--- /dev/null
+++ b/doc/user/project/merge_requests/img/commit_nav_v16_0.png
Binary files differ
diff --git a/doc/user/project/merge_requests/img/previously_merged_commits_v16_0.png b/doc/user/project/merge_requests/img/previously_merged_commits_v16_0.png
new file mode 100644
index 00000000000..31204b6e801
--- /dev/null
+++ b/doc/user/project/merge_requests/img/previously_merged_commits_v16_0.png
Binary files differ
diff --git a/doc/user/project/merge_requests/img/remove_source_branch_status.png b/doc/user/project/merge_requests/img/remove_source_branch_status.png
deleted file mode 100644
index afd93207e02..00000000000
--- a/doc/user/project/merge_requests/img/remove_source_branch_status.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md
index a633366cc62..a65c5518658 100644
--- a/doc/user/project/merge_requests/index.md
+++ b/doc/user/project/merge_requests/index.md
@@ -26,11 +26,27 @@ view [this GitLab Flow video](https://www.youtube.com/watch?v=InKNIvky2KE).
Learn the various ways to [create a merge request](creating_merge_requests.md).
+### Use merge request templates
+
+When you create a merge request, GitLab checks for the existence of a
+[description template](../description_templates.md) to add data to your merge request.
+GitLab checks these locations in order from 1 to 5, and applies the first template
+found to your merge request:
+
+| Name | Project UI<br>setting | Group<br>`default.md` | Instance<br>`default.md` | Project<br>`default.md` | No template |
+| :-- | :--: | :--: | :--: | :--: | :--: |
+| Standard commit message | 1 | 2 | 3 | 4 | 5 |
+| Commit message with an [issue closing pattern](../issues/managing_issues.md#closing-issues-automatically) like `Closes #1234` | 1 | 2 | 3 | 4 | 5 \* |
+| Branch name [prefixed with an issue ID](../repository/branches/index.md#prefix-branch-names-with-issue-numbers), like `1234-example` | 1 \* | 2 \* | 3 \* | 4 \* | 5 \* |
+
+NOTE:
+Items marked with an asterisk (\*) also append an [issue closing pattern](../issues/managing_issues.md#closing-issues-automatically).
+
## View merge requests
You can view merge requests for your project, group, or yourself.
-### View merge requests for a project
+### For a project
To view all merge requests for a project:
@@ -39,7 +55,7 @@ To view all merge requests for a project:
Or, to use a [keyboard shortcut](../../shortcuts.md), press <kbd>g</kbd> + <kbd>m</kbd>.
-### View merge requests for all projects in a group
+### For all projects in a group
To view merge requests for all projects in a group:
@@ -48,7 +64,7 @@ To view merge requests for all projects in a group:
If your group contains subgroups, this view also displays merge requests from the subgroup projects.
-### View all merge requests assigned to you
+### Assigned to you
To view all merge requests assigned to you:
@@ -65,7 +81,7 @@ or:
or:
-1. On the top bar, in the upper right, select **{merge-request-open}** **Merge requests**.
+1. On the top bar, in the upper-right corner, select **Merge requests** (**{merge-request-open}**).
1. From the dropdown list, select **Assigned to you**.
## Filter the list of merge requests
@@ -79,12 +95,12 @@ To filter the list of merge requests:
1. Above the list of merge requests, select **Search or filter results...**.
1. From the dropdown list, select the attribute you wish to filter by. Some examples:
- - [**By environment or deployment date**](#filter-merge-requests-by-environment-or-deployment-date).
+ - [**By environment or deployment date**](#by-environment-or-deployment-date).
- **ID**: Enter filter `#30` to return only merge request 30.
- User filters: Type (or select from the dropdown list) any of these filters to display a list of users:
- **Approved-By**, for merge requests already approved by a user. **(PREMIUM)**.
- **Approver**, for merge requests that this user is eligible to approve.
- (For more information, read about [Code owners](../code_owners.md)). **(PREMIUM)**
+ (For more information, read about [Code owners](../codeowners/index.md)). **(PREMIUM)**
- **Reviewer**, for merge requests reviewed by this user.
1. Select or type the operator to use for filtering the attribute. The following operators are
available:
@@ -100,7 +116,7 @@ To filter the list of merge requests:
GitLab displays the results on-screen, but you can also
[retrieve them as an RSS feed](../../search/index.md#retrieve-search-results-as-feed).
-### Filter merge requests by environment or deployment date
+### By environment or deployment date
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44041) in GitLab 13.6.
@@ -251,14 +267,15 @@ after merging does not retarget open merge requests. This improvement is
<!-- When the `moved_mr_sidebar` feature flag is removed, delete this topic and update the steps for these actions
like in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87727/diffs?diff_id=522279685#5d9afba799c4af9920dab533571d7abb8b9e9163 -->
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85584) in GitLab 14.10 [with a flag](../../../administration/feature_flags.md) named `moved_mr_sidebar`. Disabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85584) in GitLab 14.10 [with a flag](../../../administration/feature_flags.md) named `moved_mr_sidebar`. Disabled by default.
+> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/373757) to also move actions on issues, incidents, and epics in GitLab 16.0.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `moved_mr_sidebar`.
On GitLab.com, this feature is enabled in the following projects: `gitlab-org/gitlab`, `gitlab-com/www-gitlab-com`, and `gitlab-org/customers-gitlab-com`.
-When this feature flag is enabled, you can find the following actions in
-**Merge request actions** (**{ellipsis_v}**) in the upper right:
+When this feature flag is enabled, in the upper-right corner,
+**Merge request actions** (**{ellipsis_v}**) contains the following actions:
- The [notifications](../../profile/notifications.md#edit-notification-settings-for-issues-merge-requests-and-epics) toggle
- Mark merge request as ready or [draft](../merge_requests/drafts.md)
@@ -266,6 +283,8 @@ When this feature flag is enabled, you can find the following actions in
- [Lock discussion](../../discussions/index.md#prevent-comments-by-locking-the-discussion)
- Copy reference
+In GitLab 16.0 and later, similar action menus are available on issues, incidents, and epics.
+
When this feature flag is disabled, these actions are in the right sidebar.
## Merge request workflows
@@ -295,6 +314,43 @@ For a web developer writing a webpage for your company's website:
1. Once approved, your merge request is [squashed and merged](squash_and_merge.md), and [deployed to staging with GitLab Pages](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/).
1. Your production team [cherry-picks](cherry_pick_changes.md) the merge commit into production.
+## Filter activity in a merge request
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115383) in GitLab 15.11 [with a flag](../../../administration/feature_flags.md) named `mr_activity_filters`. Disabled by default.
+
+FLAG:
+On self-managed GitLab, by default this feature is not available.
+To make it available per user, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `mr_activity_filters` for individual or groups of users.
+On GitLab.com, this feature unavailable.
+
+To understand the history of a merge request, filter its activity feed to show you
+only the items that are relevant to you.
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Merge requests**.
+1. Select a merge request.
+1. Scroll to **Activity**.
+1. On the right side of the page, select **Activity filter** to show the filter options.
+ If you've selected filter options previously, this field shows a summary of your
+ choices, like **Activity + 5 more**.
+1. Select the types of activity you want to see. Options include:
+
+ - Assignees & Reviewers
+ - Approvals
+ - Comments
+ - Commits & branches
+ - Edits
+ - Labels
+ - Lock status
+ - Mentions
+ - Merge request status
+ - Tracking
+
+1. Optional. Select **Sort** (**{sort-lowest}**) to reverse the sort order.
+
+Your selection persists across all merge requests. You can also change the
+sort order by clicking the sort button on the right.
+
## Related topics
- [Create a merge request](creating_merge_requests.md)
@@ -304,7 +360,6 @@ For a web developer writing a webpage for your company's website:
- [GitLab keyboard shortcuts](../../shortcuts.md)
- [Comments and threads](../../discussions/index.md)
- [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/merge_when_pipeline_succeeds.md b/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md
index f0359446b06..7588af70bd4 100644
--- a/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md
+++ b/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md
@@ -5,7 +5,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: reference, concepts
---
-# Merge when pipeline succeeds **(FREE)**
+# Auto-merge **(FREE)**
+
+> **Merge when pipeline succeeds** and **Add to merge train when pipeline succeeds** [renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/409530) to **Auto-merge** in GitLab 16.0 [with a flag](../../../administration/feature_flags.md) named `auto_merge_labels_mr_widget`. Enabled by default.
+
+NOTE:
+[In GitLab 16.0 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/359057), **Merge when pipeline succeeds** and **Add to merge train when pipeline succeeds** become **Set to auto-merge**.
If you review a merge request and it's ready to merge, but the pipeline hasn't
completed yet, you can set it to merge when the pipeline succeeds (MWPS). You don't
@@ -147,3 +152,11 @@ merge-request-pipeline-job:
Instead, use branch (`push`) pipelines or merge request pipelines, when possible.
For details on avoiding two pipelines for a single merge request, read the
[`rules` documentation](../../../ci/jobs/job_control.md#avoid-duplicate-pipelines).
+
+### Merged results pipeline allows merge, despite a failed branch pipeline
+
+When [the **Pipelines must succeed** setting](#require-a-successful-pipeline-for-merge)
+is combined with
+[the **Merged results pipelines** feature](../../../ci/pipelines/merged_results_pipelines.md),
+failed branch pipeline may be ignored.
+[Issue 385841](https://gitlab.com/gitlab-org/gitlab/-/issues/385841) is open to track this.
diff --git a/doc/user/project/merge_requests/methods/index.md b/doc/user/project/merge_requests/methods/index.md
index 1f7e15ee982..02bd4ed0502 100644
--- a/doc/user/project/merge_requests/methods/index.md
+++ b/doc/user/project/merge_requests/methods/index.md
@@ -228,5 +228,4 @@ workflow that requires frequent rebases.
## Related topics
-- [Commits history](../commits.md)
- [Squash and merge](../squash_and_merge.md)
diff --git a/doc/user/project/merge_requests/revert_changes.md b/doc/user/project/merge_requests/revert_changes.md
index 5878873f209..77fd78ee0d0 100644
--- a/doc/user/project/merge_requests/revert_changes.md
+++ b/doc/user/project/merge_requests/revert_changes.md
@@ -58,7 +58,8 @@ To do this:
1. On the top bar, select **Main menu > Projects** and find your project.
1. If you know the merge request that contains the commit:
1. On the left sidebar, select **Merge requests** and identify your merge request.
- 1. Select **Commits**, then select the title of the commit you want to revert. GitLab displays the contents of the commit.
+ 1. Select **Commits**, then select the title of the commit you want to revert. This displays the commit in the **Changes** tab of your merge request.
+ 1. Select the commit hash you want to revert. GitLab displays the contents of the commit.
1. If you don't know the merge request the commit originated from:
1. On the left sidebar, select **Repository > Commits**.
1. Select the title of the commit to display full information about the commit.
diff --git a/doc/user/project/merge_requests/reviews/data_usage.md b/doc/user/project/merge_requests/reviews/data_usage.md
index dd07f0b4a6e..f0eb3c015b6 100644
--- a/doc/user/project/merge_requests/reviews/data_usage.md
+++ b/doc/user/project/merge_requests/reviews/data_usage.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: index, reference
---
-# Suggested Reviewers Data Usage
+# Suggested Reviewers Data Usage **(ULTIMATE SAAS)**
## How it works
diff --git a/doc/user/project/merge_requests/reviews/img/add_another_suggestion_to_batch_v13_1.jpg b/doc/user/project/merge_requests/reviews/img/add_another_suggestion_to_batch_v13_1.jpg
deleted file mode 100644
index e8aa4b7c730..00000000000
--- a/doc/user/project/merge_requests/reviews/img/add_another_suggestion_to_batch_v13_1.jpg
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/add_first_suggestion_to_batch_v13_1.jpg b/doc/user/project/merge_requests/reviews/img/add_first_suggestion_to_batch_v13_1.jpg
deleted file mode 100644
index d15f5d53e55..00000000000
--- a/doc/user/project/merge_requests/reviews/img/add_first_suggestion_to_batch_v13_1.jpg
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/apply_batch_of_suggestions_v13_1.jpg b/doc/user/project/merge_requests/reviews/img/apply_batch_of_suggestions_v13_1.jpg
deleted file mode 100644
index 3e1e9c20af9..00000000000
--- a/doc/user/project/merge_requests/reviews/img/apply_batch_of_suggestions_v13_1.jpg
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/apply_suggestion_v13_9.png b/doc/user/project/merge_requests/reviews/img/apply_suggestion_v13_9.png
deleted file mode 100644
index e27fa629672..00000000000
--- a/doc/user/project/merge_requests/reviews/img/apply_suggestion_v13_9.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/custom_commit_v13_9.png b/doc/user/project/merge_requests/reviews/img/custom_commit_v13_9.png
deleted file mode 100644
index 170c04542dd..00000000000
--- a/doc/user/project/merge_requests/reviews/img/custom_commit_v13_9.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/make_suggestion_v13_9.png b/doc/user/project/merge_requests/reviews/img/make_suggestion_v13_9.png
deleted file mode 100644
index 92d5ba5ddda..00000000000
--- a/doc/user/project/merge_requests/reviews/img/make_suggestion_v13_9.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/multi-line-suggestion-syntax.png b/doc/user/project/merge_requests/reviews/img/multi-line-suggestion-syntax.png
deleted file mode 100644
index 80424d1f056..00000000000
--- a/doc/user/project/merge_requests/reviews/img/multi-line-suggestion-syntax.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/remove_suggestion_from_batch_v13_1.jpg b/doc/user/project/merge_requests/reviews/img/remove_suggestion_from_batch_v13_1.jpg
deleted file mode 100644
index fa8331effdb..00000000000
--- a/doc/user/project/merge_requests/reviews/img/remove_suggestion_from_batch_v13_1.jpg
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/suggestion_button_v13_9.png b/doc/user/project/merge_requests/reviews/img/suggestion_button_v13_9.png
deleted file mode 100644
index 58e0508d8cf..00000000000
--- a/doc/user/project/merge_requests/reviews/img/suggestion_button_v13_9.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.png b/doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.png
deleted file mode 100644
index 2805ef19f2d..00000000000
--- a/doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/index.md b/doc/user/project/merge_requests/reviews/index.md
index 5291a845437..0de38874304 100644
--- a/doc/user/project/merge_requests/reviews/index.md
+++ b/doc/user/project/merge_requests/reviews/index.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: index, reference
---
-# Review a merge request **(FREE)**
+# Merge request reviews **(FREE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216054) in GitLab 13.5.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/245190) in GitLab 13.9.
@@ -21,16 +21,19 @@ You can review merge requests from the GitLab interface. If you install the
[GitLab Workflow VS Code extension](../../repository/vscode.md), you can also
review merge requests in Visual Studio Code.
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see [Merge request review](https://www.youtube.com/watch?v=2MayfXKpU08&list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED&index=183).
+
## Suggested reviewers **(ULTIMATE SAAS)**
-> [Introduced](https://gitlab.com/groups/gitlab-org/modelops/applied-ml/review-recommender/-/epics/3) in GitLab 15.4.
+> - [Introduced](https://gitlab.com/groups/gitlab-org/modelops/applied-ml/review-recommender/-/epics/3) in GitLab 15.4 as a [Beta](../../../../policy/alpha-beta-support.md#beta) feature [with a flag](../../../../administration/feature_flags.md) named `suggested_reviewers_control`. Disabled by default.
+> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/368356) in GitLab 15.6.
+> - Beta designation [removed from the UI](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113058) in GitLab 15.10.
GitLab can suggest reviewers. Using the changes in a merge request and a project's contribution graph, machine learning suggestions appear in the reviewer section of the right sidebar.
![Suggested Reviewers](img/suggested_reviewers_v15_9.png)
-This feature is currently in [Open Beta](https://about.gitlab.com/handbook/product/gitlab-the-product/#open-beta) behind a [feature flag](https://gitlab.com/gitlab-org/gitlab/-/issues/368356).
-
For more information, see [Data usage in Suggested Reviewers](data_usage.md).
### Enable suggested reviewers
@@ -84,7 +87,7 @@ To download the changes included in a merge request as a diff:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Merge requests**.
1. Select your merge request.
-1. In the upper right, select **Code > Plain diff**.
+1. In the upper-right corner, select **Code > Plain diff**.
If you know the URL of the merge request, you can also download the diff from
the command line by appending `.diff` to the URL. This example downloads the diff
@@ -107,7 +110,7 @@ To download the changes included in a merge request as a patch file:
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Merge requests**.
1. Select your merge request.
-1. In the upper right, select **Code > Email patches**.
+1. In the upper-right corner, select **Code > Patches**.
If you know the URL of the merge request, you can also download the patch from
the command line by appending `.patch` to the URL. This example downloads the patch
@@ -172,7 +175,7 @@ If you have a review in progress, you can also add a comment from the **Overview
When editing the **Reviewers** field in a new or existing merge request, GitLab
displays the name of the matching [approval rule](../approvals/rules.md)
-below the name of each suggested reviewer. [Code Owners](../../code_owners.md) are displayed as `Codeowner` without group detail.
+below the name of each suggested reviewer. [Code Owners](../../codeowners/index.md) are displayed as `Codeowner` without group detail.
This example shows reviewers and approval rules when creating a new merge request:
@@ -234,7 +237,7 @@ When bulk-editing merge requests in a project, you can edit the following attrib
To update multiple project merge requests at the same time:
1. In a project, go to **Merge requests**.
-1. Select **Edit merge requests**. A sidebar on the right-hand side of your screen appears with
+1. Select **Bulk edit**. A sidebar on the right-hand side of your screen appears with
editable fields.
1. Select the checkboxes next to each merge request you want to edit.
1. Select the appropriate fields and their values from the sidebar.
@@ -254,7 +257,7 @@ When bulk editing merge requests in a group, you can edit the following attribut
To update multiple group merge requests at the same time:
1. In a group, go to **Merge requests**.
-1. Select **Edit merge requests**. A sidebar on the right-hand side of your screen appears with
+1. Select **Bulk edit**. A sidebar on the right-hand side of your screen appears with
editable fields.
1. Select the checkboxes next to each merge request you want to edit.
1. Select the appropriate fields and their values from the sidebar.
@@ -424,3 +427,4 @@ than 1000. The cached value is rounded to thousands (or millions) and updated ev
## Related topics
- [Merge methods](../methods/index.md)
+- [Draft Notes API](../../../../api/draft_notes.md)
diff --git a/doc/user/project/merge_requests/reviews/suggestions.md b/doc/user/project/merge_requests/reviews/suggestions.md
index 668dece9fda..9187c5fad44 100644
--- a/doc/user/project/merge_requests/reviews/suggestions.md
+++ b/doc/user/project/merge_requests/reviews/suggestions.md
@@ -8,156 +8,176 @@ type: index, reference
# Suggest changes **(FREE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25381) custom commit messages for suggestions in GitLab 13.9 [with a flag](../../../../administration/feature_flags.md) named `suggestions_custom_commit`. Disabled by default.
-> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/297404) in GitLab 13.10.
-
-As a reviewer, you're able to suggest code changes with a Markdown syntax in merge request
-diff threads. Then, the merge request author (or other users with appropriate
-[permission](../../../permissions.md)) can apply these suggestions.
-This action generates a commit in the merge request, authored by the user that suggested the changes.
+> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/297404) in GitLab 13.10. Feature flag `suggestions_custom_commit` removed.
+
+Reviewers can suggest code changes with a Markdown syntax in merge request diff threads.
+The merge request author (or other users with the appropriate role) can apply any or
+all of the suggestions from the GitLab UI. Applying suggestions adds a commit to the
+merge request, authored by the user who suggested the changes.
+
+## Create suggestions
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Merge requests** and find your merge request.
+1. On the secondary menu, select **Changes**.
+1. Find the lines of code you want to change.
+ - To select a single line:
+ - Hover over the line number, and
+ select **Add a comment to this line** (**{comment}**).
+ - To select multiple lines:
+ 1. Hover over the line number, and select **Add a comment to this line** (**{comment}**).
+ 1. Select and drag your selection until all desired lines are included. To
+ learn more, see [Multi-line suggestions](#multi-line-suggestions).
+1. In the comment toolbar, select **Insert suggestion** (**{doc-code}**). GitLab
+ inserts a pre-populated code block into your comment, like this:
+
+ ````markdown
+ ```suggestion:-0+0
+ The content of the line you selected is shown here.
+ ```
+ ````
+
+1. Edit the pre-populated code block to add your suggestion.
+1. Select either **Start a review** or **Add to review** to add your comment to a
+ [review](index.md), or **Add comment now** to add the comment to the thread immediately.
-1. Choose a line of code to be changed, add a new comment, then select
- the **Insert suggestion** icon in the toolbar:
+### Multi-line suggestions
- ![Add a new comment](img/suggestion_button_v13_9.png)
+> [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/232339) in GitLab 13.11: suggestions in multi-line comments also become multi-line.
-1. In the comment, add your suggestion to the pre-populated code block:
+When you review a merge request diff, you can propose changes to multiple lines (up to 200)
+in a single suggestion, by either:
- ![Add a suggestion into a code block tagged properly](img/make_suggestion_v13_9.png)
+- Selecting and dragging, as described in [Create suggestions](#create-suggestions).
+ GitLab creates a suggestion block for you.
+- Selecting a single line, then manually adjusting the range offsets.
-1. Select either **Start a review** or **Add to review** to add your comment to a
- [review](index.md), or **Add comment now** to add the comment to the thread immediately.
+The range offsets in the first line of the suggestion describe line numbers relative
+to the line you selected. The offsets specify the lines your suggestion intends to replace.
+For example, this suggestion covers 3 lines above and 4 lines below the
+commented line:
- The suggestion in the comment can be applied by the merge request author
- directly from the merge request:
+````markdown
+```suggestion:-3+4
+ "--talk-name=ca.desrt.dconf",
+ "--socket=wayland",
+```
+````
- ![Apply suggestions](img/apply_suggestion_v13_9.png)
+When applied, the suggestion replaces from 3 lines above to 4 lines below the commented line:
-1. Optionally specify a custom commit message for individual suggestions (GitLab 13.9 and later) to
- describe your change. If you don't specify it, the default commit message is used.
+![Multi-line suggestion preview](img/multi-line-suggestion-preview.png)
- ![Custom commit](img/custom_commit_v13_9.png)
+Suggestions for multiple lines are limited to 100 lines _above_ and 100
+lines _below_ the commented diff line. This allows for up to 200 changed lines per
+suggestion.
-After the author applies a suggestion:
+## Apply suggestions
-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, GitLab pushes
- the suggested change directly into the codebase in the merge request's branch.
+Prerequisites:
-## Multi-line suggestions
+- You must be the author of the merge request, or have at least the Developer role in the project.
-> [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/232339) in GitLab 13.11: suggestions in multi-line comments also become multi-line.
+To apply suggested changes directly from the merge request:
-Reviewers can also suggest changes to multiple lines with a single suggestion
-within merge request diff threads by selecting and dragging selection to all
-relevant line numbers or by adjusting the range offsets. The
-offsets are relative to the position of the diff thread, and specify the
-range to be replaced by the suggestion when it is applied.
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Merge requests** and find your merge request.
+1. Find the comment containing the suggestion you want to apply.
+ - To apply suggestions individually, select **Apply suggestion**.
+ - To apply multiple suggestions in a single commit, select **Add suggestion to batch**.
+1. Optional. Provide a custom commit message to describe your change. If you don't provide a custom message, the default commit message is used.
+1. Select **Apply**.
-![Multi-line suggestion syntax](img/multi-line-suggestion-syntax.png)
+After a suggestion is applied:
-In the previous example, the suggestion covers three lines above and four lines
-below the commented line. When applied, it would replace from 3 lines _above_
-to 4 lines _below_ the commented line, with the suggested change.
+- The suggestion is marked as **Applied**.
+- The comment thread is resolved.
+- GitLab creates a new commit with the changes.
+- If the user has the Developer role, GitLab pushes
+ the suggested change directly into the codebase in the merge request's branch.
-![Multi-line suggestion preview](img/multi-line-suggestion-preview.png)
-
-NOTE:
-Suggestions for multiple lines are limited to 100 lines _above_ and 100
-lines _below_ the commented diff line. This allows for up to 200 changed lines per
-suggestion.
-
-## Code block nested in suggestions
+## Nest code blocks in suggestions
To add a suggestion that includes a
[fenced code block](../../../markdown.md#code-spans-and-blocks), wrap your suggestion
in four backticks instead of three:
-~~~markdown
+`````markdown
````suggestion:-0+2
```shell
git config --global receive.advertisepushoptions true
```
````
-~~~
+`````
![Output of a comment with a suggestion with a fenced code block](img/suggestion_code_block_output_v12_8.png)
## Configure the commit message for applied suggestions
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13086) in GitLab 12.7.
+GitLab uses a default commit message when applying suggestions. This message
+supports placeholders, and can be changed. For example, the default message
+`Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)` renders
+like this if you apply three suggestions to two different files:
-GitLab uses a default commit message
-when applying suggestions: `Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)`
-
-<!-- vale gitlab.BadPlurals = NO -->
+```plaintext
+Apply 3 suggestion(s) to 2 file(s)
+```
-For example, consider that a user applied 3 suggestions to 2 different files, the
-default commit message is: **Apply 3 suggestion(s) to 2 file(s)**
+Merge requests created from forks use the template defined in the target project.
-<!-- vale gitlab.BadPlurals = YES -->
+To meet your project's needs, you can customize these messages and include other
+placeholder variables:
-These commit messages can be customized to follow any guidelines you might have.
-To do so, expand the **Merge requests** tab within your project's **General**
-settings and change the **Merge suggestions** text:
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Settings > Merge requests**.
+1. Scroll to **Merge suggestions**, and alter the text to meet your needs.
+ See [Supported variables](#supported-variables) for a list of placeholders
+ you can use in this message.
-![Custom commit message for applied suggestions](img/suggestions_custom_commit_messages_v14_7.png)
+### Supported variables
-You can also use following variables besides static text:
+The template for commit messages for applied suggestions supports these variables:
| Variable | Description | Output example |
|------------------------|-------------|----------------|
| `%{branch_name}` | The name of the branch to which suggestions were applied. | `my-feature-branch` |
-| `%{files_count}` | The number of files to which suggestions were applied.| **2** |
+| `%{files_count}` | The number of files to which suggestions were applied.| `2` |
| `%{file_paths}` | The paths of the file to which suggestions were applied. Paths are separated by commas.| `docs/index.md, docs/about.md` |
| `%{project_path}` | The project path. | `my-group/my-project` |
-| `%{project_name}` | The human-readable name of the project. | **My Project** |
-| `%{suggestions_count}` | The number of suggestions applied.| **3** |
+| `%{project_name}` | The human-readable name of the project. | `My Project` |
+| `%{suggestions_count}` | The number of suggestions applied.| `3` |
| `%{username}` | The username of the user applying suggestions. | `user_1` |
-| `%{user_full_name}` | The full name of the user applying suggestions. | **User 1** |
+| `%{user_full_name}` | The full name of the user applying suggestions. | `User 1` |
For example, to customize the commit message to output
-**Addresses user_1's review**, set the custom text to
+`Addresses user_1's review`, set the custom text to
`Addresses %{username}'s review`.
-For merge requests created from forks, GitLab uses the template defined in target project.
-
-NOTE:
-Custom commit messages for each applied suggestion is
-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](../../../../policy/alpha-beta-support.md#alpha-features) with a flag named `batch_suggestions`, disabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [Experiment](../../../../policy/alpha-beta-support.md#experiment) 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.
-You can apply multiple suggestions at once to reduce the number of commits added
-to your branch to address your reviewers' requests.
-
-1. To start a batch of suggestions to apply with a single commit, select **Add suggestion to batch**:
-
- ![A code change suggestion displayed, with the add-suggestion option highlighted.](img/add_first_suggestion_to_batch_v13_1.jpg "Add a suggestion to a batch")
-
-1. Add as many additional suggestions to the batch as you wish:
-
- ![A code change suggestion displayed, with the add-more suggestion option highlighted.](img/add_another_suggestion_to_batch_v13_1.jpg "Add another suggestion to a batch")
-
-1. To remove suggestions, select **Remove from batch**:
-
- ![A code change suggestion displayed, with the option to remove that suggestion from its batch highlighted.](img/remove_suggestion_from_batch_v13_1.jpg "Remove a suggestion from a batch")
+To reduce the number of commits added to your branch, you can apply multiple
+suggestions in a single commit.
-1. Having added all the suggestions to your liking, when ready, select **Apply suggestions**. You
- can optionally specify a custom commit message for [batch suggestions](#batch-suggestions)
- (GitLab 14.4 and later) to describe your change. If you don't specify it, the default commit
- message is used.
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Merge requests** and find your merge request.
+1. For each suggestion you want to apply, and select **Add suggestion to batch**.
+1. Optional. To remove a suggestion, select **Remove from batch**.
+1. After you add your desired suggestions, select **Apply suggestions**.
- ![A code change suggestion displayed, with the option to apply the batch of suggestions highlighted.](img/apply_batch_of_suggestions_v13_1.jpg "Apply a batch of suggestions")
+ WARNING:
+ If you apply a batch of suggestions containing changes from multiple authors,
+ you are credited as the resulting commit's author. If your project is configured
+ to [prevent approvals from users who add commits](../approvals/settings.md#prevent-approvals-by-users-who-add-commits), you are no longer an eligible
+ approver for this merge request.
-WARNING:
-Suggestions applied from multiple authors creates a commit authored by the user applying the suggestions.
+1. Optional. Provide a custom commit message for [batch suggestions](#batch-suggestions)
+ (GitLab 14.4 and later) to describe your change. If you don't specify one,
+ the default commit message is used.
## Related topics
diff --git a/doc/user/project/merge_requests/squash_and_merge.md b/doc/user/project/merge_requests/squash_and_merge.md
index 9f87f1e2e0d..075716e90c8 100644
--- a/doc/user/project/merge_requests/squash_and_merge.md
+++ b/doc/user/project/merge_requests/squash_and_merge.md
@@ -33,7 +33,14 @@ squash commits and merge commits.
## Set default squash options for a merge request
Users with permission to create or edit a merge request can set the default squash options
-for a merge request. To do this:
+for a merge request.
+
+Prerequisites:
+
+- Your project must be [configured](#configure-squash-options-for-a-project) to allow or
+ encourage squashing.
+
+To do this:
1. Go to the merge request and select **Edit**.
1. Select or clear the **Squash commits when merge request is accepted** checkbox.
@@ -58,6 +65,10 @@ squash the commits as part of the merge process:
> - [Enabled on GitLab.com and self-managed by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39382) in GitLab 13.3.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/232536) in GitLab 13.8. Feature flag `squash_options` removed.
+Prerequisites:
+
+- You must have at least the Maintainer role for this project.
+
To configure the default squashing behavior for all merge requests in your project:
1. On the top bar, select **Main menu > Projects** and find your project.
diff --git a/doc/user/project/merge_requests/status_checks.md b/doc/user/project/merge_requests/status_checks.md
index 62a2baa049b..0e339c65ed5 100644
--- a/doc/user/project/merge_requests/status_checks.md
+++ b/doc/user/project/merge_requests/status_checks.md
@@ -3,7 +3,6 @@ stage: Govern
group: Compliance
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference, concepts
-disqus_identifier: 'https://docs.gitlab.com/ee/user/project/merge_requests/status_checks.html'
---
# External status checks **(ULTIMATE)**
@@ -12,6 +11,8 @@ disqus_identifier: 'https://docs.gitlab.com/ee/user/project/merge_requests/statu
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/320783) in GitLab 14.1.
> - `failed` status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329636) in GitLab 14.9.
+Status checks are API calls to external systems that request the status of an external requirement.
+
You can create a status check that sends merge request data to third-party tools.
When users create, change, or close merge requests, GitLab sends a notification. The users or automated workflows
can then update the status of merge requests from outside of GitLab.
@@ -70,7 +71,7 @@ using the API. You don't need to wait for a merge request webhook payload to be
## View the status checks on a project
-Within each project's settings, you can see a list of status checks added to the project:
+Within each project's settings, you can see a list of status check services added to the project:
1. In your project, go to **Settings > Merge requests** section.
1. Scroll down to **Status checks**.
@@ -80,9 +81,9 @@ Within each project's settings, you can see a list of status checks added to the
This list shows the service name, API URL, and targeted branch.
It also provides actions to allow you to create, edit, or remove status checks.
-## Add or update a status check
+## Add or update a status check service
-### Add a status check
+### Add a status check service
Within the **Status checks** sub-section, select the **Add status check** button.
The **Add status check** form is then shown.
@@ -91,7 +92,7 @@ The **Add status check** form is then shown.
Filling in the form and selecting the **Add status check** button creates a new status check.
-### Update a status check
+### Update a status check service
Within the **Status checks** sub-section, select the **Edit** button
next to the status check you want to edit.
@@ -134,7 +135,7 @@ for doesn't appear immediately. The search box requires
If you want the status check to be applied to **all** merge requests,
you can select the **All branches** option.
-## Delete a status check
+## Delete a status check service
Within the **Status checks** sub-section, select the **Remove...** button
next to the status check you want to delete.
@@ -151,12 +152,15 @@ the status check and it **is not** recoverable.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/327634) in GitLab 14.1.
> - UI [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91504) in GitLab 15.2.
> - Ability to retry failed external status checks [added](https://gitlab.com/gitlab-org/gitlab/-/issues/383200) in GitLab 15.8.
+> - Widget [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111763) to poll for updates when there are pending status checks in GitLab 15.11.
The status checks widget displays in merge requests and displays the following statuses:
- **pending** (**{status-neutral}**), while GitLab waits for a response from an external status check.
- **success** (**{status-success}**) or **failed** (**{status-failed}**), when GitLab receives a response from an external status check.
+When there are pending status checks, the widget polls for updates every few seconds until it receives a **success** or **failed** response.
+
To retry a failed status check:
1. Expand the merge request widget to show the list of external status checks.