summaryrefslogtreecommitdiff
path: root/doc/user/discussions/index.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 14:21:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 14:21:10 +0000
commitcb0d23c455b73486fd1015f8ca9479b5b7e3585d (patch)
treed7dc129a407fd74266d2dc561bebf24665197c2f /doc/user/discussions/index.md
parentc3e911be175c0aabfea1eb030f9e0ef23f5f3887 (diff)
downloadgitlab-ce-cb0d23c455b73486fd1015f8ca9479b5b7e3585d.tar.gz
Add latest changes from gitlab-org/gitlab@12-7-stable-ee
Diffstat (limited to 'doc/user/discussions/index.md')
-rw-r--r--doc/user/discussions/index.md87
1 files changed, 58 insertions, 29 deletions
diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md
index d4e485d7c32..6016837a769 100644
--- a/doc/user/discussions/index.md
+++ b/doc/user/discussions/index.md
@@ -4,12 +4,12 @@ The ability to contribute conversationally is offered throughout GitLab.
You can leave a comment in the following places:
-- issues
-- epics **(ULTIMATE)**
-- merge requests
-- snippets
-- commits
-- commit diffs
+- Issues
+- Epics **(ULTIMATE)**
+- Merge requests
+- Snippets
+- Commits
+- Commit diffs
There are standard comments, and you also have the option to create a comment
in the form of a thread. A comment can also be [turned into a thread](#start-a-thread-by-replying-to-a-standard-comment)
@@ -29,9 +29,7 @@ There is a limit of 5,000 comments for every object, for example: issue, epic, a
## Resolvable comments and threads
-> **Notes:**
->
-> - The main feature was [introduced][ce-5022] in GitLab 8.11.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5022) in GitLab 8.11.
> - Resolvable threads can be added only to merge request diffs.
Thread resolution helps keep track of progress during planning or code review.
@@ -352,7 +350,10 @@ bottom of the screen with two buttons:
Clicking **Submit review** will publish all comments. Any quick actions
submitted are performed at this time.
-Alternatively, every pending comment has a button to finish the entire review.
+Alternatively, to finish the entire review from a pending comment:
+
+- Click the **Finish review** button on the comment.
+- Use the `/submit_review` [quick action](../project/quick_actions.md) in the text of non-review comment.
![Review submission](img/review_preview.png)
@@ -389,47 +390,45 @@ As a reviewer, you're able to suggest code changes with a simple
Markdown syntax in Merge Request Diff threads. Then, the
Merge Request author (or other users with appropriate
[permission](../permissions.md)) is able to apply these
-suggestions with a click, which will generate a commit in
-the Merge Request authored by the user that applied them.
+Suggestions with a click, which will generate a commit in
+the merge request authored by the user that applied them.
1. Choose a line of code to be changed, add a new comment, then click
on the **Insert suggestion** icon in the toolbar:
- ![Add a new comment](img/insert_suggestion.png)
+ ![Add a new comment](img/suggestion_button_v12_7.png)
1. In the comment, add your suggestion to the pre-populated code block:
- ![Add a suggestion into a code block tagged properly](img/make_suggestion.png)
+ ![Add a suggestion into a code block tagged properly](img/make_suggestion_v12_7.png)
1. Click **Comment**.
- The suggestions in the comment can be applied by the merge request author
+ NOTE: **Note:**
+ If you're using GitLab Premium, GitLab.com Silver, and higher tiers, the thread will display [Review](#merge-request-reviews-premium) options. Click either **Start a review**, **Add comment now**, or **Add to review** to obtain the same result.
+
+ The Suggestion in the comment can be applied by the merge request author
directly from the merge request:
- ![Apply suggestions](img/suggestion.png)
+ ![Apply suggestions](img/apply_suggestion_v12_7.png)
-Once the author applies a suggestion, it will be marked with the **Applied** label,
+Once the author applies a Suggestion, it will be marked with the **Applied** label,
the thread will be automatically resolved, and GitLab will create a new commit
-with the message `Apply suggestion to <file-name>` and push the suggested change
-directly into the codebase in the merge request's branch.
-[Developer permission](../permissions.md) is required to do so.
-
-> **Note:**
-Custom commit messages will be introduced by
-[#54404](https://gitlab.com/gitlab-org/gitlab-foss/issues/54404).
+and push the suggested change directly into the codebase in the merge request's
+branch. [Developer permission](../permissions.md) is required to do so.
-### Multi-line suggestions
+### Multi-line Suggestions
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/53310) in GitLab 11.10.
-Reviewers can also suggest changes to multiple lines with a single suggestion
-within Merge Request diff threads by adjusting the range offsets. The
+Reviewers can also suggest changes to multiple lines with a single Suggestion
+within merge request diff threads 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.
![Multi-line suggestion syntax](img/multi-line-suggestion-syntax.png)
-In the example above, the suggestion covers three lines above and four lines
+In the example above, 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.
@@ -440,6 +439,37 @@ Suggestions covering multiple lines are limited to 100 lines _above_ and 100
lines _below_ the commented diff line, allowing up to 200 changed lines per
suggestion.
+### Configure the commit message for applied Suggestions
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/13086) in GitLab 12.7.
+
+GitLab uses `Apply suggestion to %{file_path}` by default as commit messages
+when applying Suggestions. This commit message 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:
+
+![Custom commit message for applied Suggestions](img/suggestions_custom_commit_messages_v12_7.png)
+
+You can also use following variables besides static text:
+
+| Variable | Description | Output example |
+|---|---|---|
+| `%{project_path}` | The project path. | `my-group/my-project` |
+| `%{project_name}` | The human-readable name of the project. | **My Project** |
+| `%{file_path}` | The path of the file the Suggestion is applied to. | `docs/index.md` |
+| `%{branch_name}` | The name of the branch the Suggestion is applied on. | `my-feature-branch` |
+| `%{username}` | The username of the user applying the Suggestion. | `user_1` |
+| `%{user_full_name}` | The full name of the user applying the Suggestion. | **User 1** |
+
+For example, to customize the commit message to output
+**Addresses user_1's review**, set the custom text to
+`Addresses %{username}'s review`.
+
+NOTE: **Note:**
+Custom commit messages for each applied Suggestion will be
+introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/issues/25381).
+
## Start a thread by replying to a standard comment
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/30299) in GitLab 11.9
@@ -461,7 +491,6 @@ to the original comment, so a note about when it was last edited will appear und
This feature only exists for Issues, Merge requests, and Epics. Commits, Snippets and Merge request diff threads are
not supported yet.
-[ce-5022]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/5022
[ce-7125]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/7125
[ce-7527]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/7527
[ce-7180]: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/7180