index.md 24,8 КБ
Newer Older
GitLab Bot's avatar
GitLab Bot включено в состав коммита
1
---
GitLab Bot's avatar
GitLab Bot включено в состав коммита
2
3
4
5
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/engineering/ux/technical-writing/#designated-technical-writers"
type: reference, howto
GitLab Bot's avatar
GitLab Bot включено в состав коммита
6
7
---

Michel Engelen's avatar
Michel Engelen включено в состав коммита
8
# Threads
Connor Shea's avatar
Connor Shea включено в состав коммита
9

Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
10
11
The ability to contribute conversationally is offered throughout GitLab.

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
12
You can leave a comment in the following places:
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
13

GitLab Bot's avatar
GitLab Bot включено в состав коммита
14
15
16
17
18
19
- Issues
- Epics **(ULTIMATE)**
- Merge requests
- Snippets
- Commits
- Commit diffs
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
20

Mike Lewis's avatar
Mike Lewis включено в состав коммита
21
There are standard comments, and you also have the option to create a comment
Michel Engelen's avatar
Michel Engelen включено в состав коммита
22
in the form of a thread. A comment can also be [turned into a thread](#start-a-thread-by-replying-to-a-standard-comment)
Mike Lewis's avatar
Mike Lewis включено в состав коммита
23
24
when it receives a reply.

GitLab Bot's avatar
GitLab Bot включено в состав коммита
25
26
The comment area supports [Markdown](../markdown.md) and [quick actions](../project/quick_actions.md). You can edit your own
comment at any time, and anyone with [Maintainer access level](../permissions.md) or
Marland Sitt's avatar
Marland Sitt включено в состав коммита
27
higher can also edit a comment made by someone else.
Connor Shea's avatar
Connor Shea включено в состав коммита
28

Mike Lewis's avatar
Mike Lewis включено в состав коммита
29
You can also reply to a comment notification email to reply to the comment if
GitLab Bot's avatar
GitLab Bot включено в состав коммита
30
[Reply by email](../../administration/reply_by_email.md) is configured for your GitLab instance. Replying to a standard comment
Michel Engelen's avatar
Michel Engelen включено в состав коммита
31
creates another standard comment. Replying to a threaded comment creates a reply in the thread. Email replies support
GitLab Bot's avatar
GitLab Bot включено в состав коммита
32
[Markdown](../markdown.md) and [quick actions](../project/quick_actions.md), just as if you replied from the web.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
33

GitLab Bot's avatar
GitLab Bot включено в состав коммита
34
NOTE: **Note:**
GitLab Bot's avatar
GitLab Bot включено в состав коммита
35
There is a limit of 5,000 comments for every object, for example: issue, epic, and merge request.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
36

Michel Engelen's avatar
Michel Engelen включено в состав коммита
37
## Resolvable comments and threads
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
38

GitLab Bot's avatar
GitLab Bot включено в состав коммита
39
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/5022) in GitLab 8.11.
Michel Engelen's avatar
Michel Engelen включено в состав коммита
40
> - Resolvable threads can be added only to merge request diffs.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
41

Michel Engelen's avatar
Michel Engelen включено в состав коммита
42
Thread resolution helps keep track of progress during planning or code review.
Connor Shea's avatar
Connor Shea включено в состав коммита
43

Michel Engelen's avatar
Michel Engelen включено в состав коммита
44
Every standard comment or thread in merge requests, commits, commit diffs, and
Mike Lewis's avatar
Mike Lewis включено в состав коммита
45
46
snippets is initially displayed as unresolved. They can then be individually resolved by anyone
with at least Developer access to the project or by the author of the change being reviewed.
Samantha Ming's avatar
Samantha Ming включено в состав коммита
47
48
49
If the thread has been resolved and a non-member unresolves their own response,
this will also unresolve the discussion thread.
If the non-member then resolves this same response, this will resolve the discussion thread.
Mike Lewis's avatar
Mike Lewis включено в состав коммита
50

Michel Engelen's avatar
Michel Engelen включено в состав коммита
51
52
The need to resolve all standard comments or threads prevents you from forgetting
to address feedback and lets you hide threads that are no longer relevant.
Connor Shea's avatar
Connor Shea включено в состав коммита
53

Michel Engelen's avatar
Michel Engelen включено в состав коммита
54
!["A thread between two people on a piece of code"](img/thread_view.png)
Connor Shea's avatar
Connor Shea включено в состав коммита
55

Michel Engelen's avatar
Michel Engelen включено в состав коммита
56
### Commit threads in the context of a merge request
micael.bergeron's avatar
micael.bergeron включено в состав коммита
57

GitLab Bot's avatar
GitLab Bot включено в состав коммита
58
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/31847) in GitLab 10.3.
micael.bergeron's avatar
micael.bergeron включено в состав коммита
59

Michel Engelen's avatar
Michel Engelen включено в состав коммита
60
61
For reviewers with commit-based workflow, it may be useful to add threads to
specific commit diffs in the context of a merge request. These threads will
micael.bergeron's avatar
micael.bergeron включено в состав коммита
62
63
64
65
66
persist through a commit ID change when:

- force-pushing after a rebase
- amending a commit

Michel Engelen's avatar
Michel Engelen включено в состав коммита
67
To create a commit diff thread:
micael.bergeron's avatar
micael.bergeron включено в состав коммита
68
69
70
71

1. Navigate to the merge request **Commits** tab. A list of commits that
   constitute the merge request will be shown.

Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
72
   ![Merge request commits tab](img/merge_request_commits_tab.png)
micael.bergeron's avatar
micael.bergeron включено в состав коммита
73
74
75
76

1. Navigate to a specific commit, click on the **Changes** tab (where you
   will only be presented diffs from the selected commit), and leave a comment.

Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
77
   ![Commit diff discussion in merge request context](img/commit_comment_mr_context.png)
micael.bergeron's avatar
micael.bergeron включено в состав коммита
78

Michel Engelen's avatar
Michel Engelen включено в состав коммита
79
1. Any threads created this way will be shown in the merge request's
micael.bergeron's avatar
micael.bergeron включено в состав коммита
80
81
   **Discussions** tab and are resolvable.

Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
82
   ![Merge request Discussions tab](img/commit_comment_mr_discussions_tab.png)
micael.bergeron's avatar
micael.bergeron включено в состав коммита
83

Michel Engelen's avatar
Michel Engelen включено в состав коммита
84
Threads created this way will only appear in the original merge request
micael.bergeron's avatar
micael.bergeron включено в состав коммита
85
86
87
88
and not when navigating to that commit under your project's
**Repository > Commits** page.

TIP: **Tip:**
Michel Engelen's avatar
Michel Engelen включено в состав коммита
89
When a link of a commit reference is found in a thread inside a merge
micael.bergeron's avatar
micael.bergeron включено в состав коммита
90
91
92
request, it will be automatically converted to a link in the context of the
current merge request.

GitLab Bot's avatar
GitLab Bot включено в состав коммита
93
94
95
96
97
98
99
100
101
### Jumping between unresolved threads (deprecated)

> - [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/199718) in GitLab 13.3.
> - This button's removal is behind a feature flag enabled by default.
> - For GitLab self-managed instances, GitLab administrators with access to the
  [GitLab Rails console](../../administration/feature_flags.md) can opt to disable it by running
  `Feature.disable(:hide_jump_to_next_unresolved_in_threads)` (for the instance) or
  `Feature.disable(:hide_jump_to_next_unresolved_in_threads, Project.find(<project id>))`
  (per project.) **(CORE ONLY)**
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
102
103

When a merge request has a large number of comments it can be difficult to track
Michel Engelen's avatar
Michel Engelen включено в состав коммита
104
105
what remains unresolved. You can jump between unresolved threads with the
Jump button next to the Reply field on a thread.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
106

Sam Bigelow's avatar
Sam Bigelow включено в состав коммита
107
108
109
110
111
You can also use keyboard shortcuts to navigate among threads:

- Use <kbd>n</kbd> to jump to the next unresolved thread.
- Use <kbd>p</kbd> to jump to the previous unresolved thread.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
112
!["8/9 threads resolved"](img/threads_resolved.png)
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
113

Michel Engelen's avatar
Michel Engelen включено в состав коммита
114
### Marking a comment or thread as resolved
Connor Shea's avatar
Connor Shea включено в состав коммита
115

Michel Engelen's avatar
Michel Engelen включено в состав коммита
116
117
You can mark a thread as resolved by clicking the **Resolve thread**
button at the bottom of the thread.
Connor Shea's avatar
Connor Shea включено в состав коммита
118

GitLab Bot's avatar
GitLab Bot включено в состав коммита
119
!["Resolve thread" button](img/resolve_thread_button_v13_3.png)
Connor Shea's avatar
Connor Shea включено в состав коммита
120
121
122

Alternatively, you can mark each comment as resolved individually.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
123
!["Resolve comment" button](img/resolve_comment_button.png)
Connor Shea's avatar
Connor Shea включено в состав коммита
124

Michel Engelen's avatar
Michel Engelen включено в состав коммита
125
### Move all unresolved threads in a merge request to an issue
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
126

GitLab Bot's avatar
GitLab Bot включено в состав коммита
127
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8266) in GitLab 9.1
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
128

Michel Engelen's avatar
Michel Engelen включено в состав коммита
129
130
To continue all open threads from a merge request in a new issue, click the
**Resolve all threads in new issue** button.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
131

Michel Engelen's avatar
Michel Engelen включено в состав коммита
132
![Open new issue for all unresolved threads](img/btn_new_issue_for_all_threads.png)
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
133

Michel Engelen's avatar
Michel Engelen включено в состав коммита
134
135
Alternatively, when your project only accepts merge requests [when all threads
are resolved](#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved),
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
136
137
there will be an **open an issue to resolve them later** link in the merge
request widget.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
138

Michel Engelen's avatar
Michel Engelen включено в состав коммита
139
![Link in merge request widget](img/resolve_thread_open_issue.png)
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
140

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
141
This will prepare an issue with its content referring to the merge request and
Michel Engelen's avatar
Michel Engelen включено в состав коммита
142
the unresolved threads.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
143

Michel Engelen's avatar
Michel Engelen включено в состав коммита
144
![Issue mentioning threads in a merge request](img/preview_issue_for_threads.png)
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
145

Michel Engelen's avatar
Michel Engelen включено в состав коммита
146
Hitting **Submit issue** will cause all threads to be marked as resolved and
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
147
add a note referring to the newly created issue.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
148

Michel Engelen's avatar
Michel Engelen включено в состав коммита
149
![Mark threads as resolved notice](img/resolve_thread_issue_notice.png)
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
150

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
151
You can now proceed to merge the merge request from the UI.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
152

Michel Engelen's avatar
Michel Engelen включено в состав коммита
153
### Moving a single thread to a new issue
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
154

GitLab Bot's avatar
GitLab Bot включено в состав коммита
155
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8266) in GitLab 9.1
Connor Shea's avatar
Connor Shea включено в состав коммита
156

Michel Engelen's avatar
Michel Engelen включено в состав коммита
157
158
To create a new issue for a single thread, you can use the **Resolve this
thread in a new issue** button.
Connor Shea's avatar
Connor Shea включено в состав коммита
159

Michel Engelen's avatar
Michel Engelen включено в состав коммита
160
![Create issue for thread](img/new_issue_for_thread.png)
Connor Shea's avatar
Connor Shea включено в состав коммита
161

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
162
This will direct you to a new issue prefilled with the content of the
Michel Engelen's avatar
Michel Engelen включено в состав коммита
163
164
165
thread, similar to the issues created for delegating multiple
threads at once. Saving the issue will mark the thread as resolved and
add a note to the merge request thread referencing the new issue.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
166

Michel Engelen's avatar
Michel Engelen включено в состав коммита
167
![New issue for a single thread](img/preview_issue_for_thread.png)
Connor Shea's avatar
Connor Shea включено в состав коммита
168

Michel Engelen's avatar
Michel Engelen включено в состав коммита
169
### Only allow merge requests to be merged if all threads are resolved
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
170

GitLab Bot's avatar
GitLab Bot включено в состав коммита
171
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7125) in GitLab 8.14.
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
172

Michel Engelen's avatar
Michel Engelen включено в состав коммита
173
You can prevent merge requests from being merged until all threads are
Bob Van Landuyt's avatar
Bob Van Landuyt включено в состав коммита
174
resolved.
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
175
176

Navigate to your project's settings page, select the
Michel Engelen's avatar
Michel Engelen включено в состав коммита
177
**Only allow merge requests to be merged if all threads are resolved** check
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
178
179
box and hit **Save** for the changes to take effect.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
180
![Only allow merge if all the threads are resolved settings](img/only_allow_merge_if_all_threads_are_resolved.png)
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
181

Michel Engelen's avatar
Michel Engelen включено в состав коммита
182
From now on, you will not be able to merge from the UI until all threads
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
183
184
are resolved.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
185
![Only allow merge if all the threads are resolved message](img/resolve_thread_open_issue.png)
Rémy Coutable's avatar
Rémy Coutable включено в состав коммита
186

Michel Engelen's avatar
Michel Engelen включено в состав коммита
187
### Automatically resolve merge request diff threads when they become outdated
Ashley Dumaine's avatar
Ashley Dumaine включено в состав коммита
188

GitLab Bot's avatar
GitLab Bot включено в состав коммита
189
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14053) in GitLab 10.0.
Ashley Dumaine's avatar
Ashley Dumaine включено в состав коммита
190

Michel Engelen's avatar
Michel Engelen включено в состав коммита
191
You can automatically resolve merge request diff threads on lines modified
Sean McGivern's avatar
Sean McGivern включено в состав коммита
192
193
194
with a new push.

Navigate to your project's settings page, select the **Automatically resolve
Michel Engelen's avatar
Michel Engelen включено в состав коммита
195
merge request diffs threads on lines changed with a push** check box and hit
Ashley Dumaine's avatar
Ashley Dumaine включено в состав коммита
196
197
**Save** for the changes to take effect.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
198
![Automatically resolve merge request diff threads when they become outdated](img/automatically_resolve_outdated_discussions.png)
Ashley Dumaine's avatar
Ashley Dumaine включено в состав коммита
199

Michel Engelen's avatar
Michel Engelen включено в состав коммита
200
201
202
From now on, any threads on a diff will be resolved by default if a push
makes that diff section outdated. Threads on lines that don't change and
top-level resolvable threads are not automatically resolved.
Ashley Dumaine's avatar
Ashley Dumaine включено в состав коммита
203

Michel Engelen's avatar
Michel Engelen включено в состав коммита
204
## Commit threads
micael.bergeron's avatar
micael.bergeron включено в состав коммита
205

Michel Engelen's avatar
Michel Engelen включено в состав коммита
206
You can add comments and threads to a particular commit under your
micael.bergeron's avatar
micael.bergeron включено в состав коммита
207
208
209
project's **Repository > Commits**.

CAUTION: **Attention:**
Michel Engelen's avatar
Michel Engelen включено в состав коммита
210
Threads created this way will be lost if the commit ID changes after a
micael.bergeron's avatar
micael.bergeron включено в состав коммита
211
212
force push.

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
213
## Threaded discussions
Bob Van Landuyt's avatar
Bob Van Landuyt включено в состав коммита
214

GitLab Bot's avatar
GitLab Bot включено в состав коммита
215
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7527) in GitLab 9.1.
Bob Van Landuyt's avatar
Bob Van Landuyt включено в состав коммита
216

Michel Engelen's avatar
Michel Engelen включено в состав коммита
217
218
219
While resolvable threads are only available to merge request diffs,
threads can also be added without a diff. You can start a specific
thread which will look like a thread, on issues, commits, snippets, and
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
220
merge requests.
Bob Van Landuyt's avatar
Bob Van Landuyt включено в состав коммита
221

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
222
To start a threaded discussion, click on the **Comment** button toggle dropdown,
Michel Engelen's avatar
Michel Engelen включено в состав коммита
223
select **Start thread** and click **Start thread** when you're ready to
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
224
post the comment.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
225
226
227

![Comment type toggle](img/comment_type_toggle.gif)

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
228
229
This will post a comment with a single thread to allow you to discuss specific
comments in greater detail.
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett включено в состав коммита
230

Michel Engelen's avatar
Michel Engelen включено в состав коммита
231
![Thread comment](img/discussion_comment.png)
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
232

Michel Engelen's avatar
Michel Engelen включено в состав коммита
233
## Image threads
Clement Ho's avatar
Clement Ho включено в состав коммита
234

GitLab Bot's avatar
GitLab Bot включено в состав коммита
235
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14061) in GitLab 10.1.
Clement Ho's avatar
Clement Ho включено в состав коммита
236

Michel Engelen's avatar
Michel Engelen включено в состав коммита
237
238
239
Sometimes a thread is revolved around an image. With image threads,
you can easily target a specific coordinate of an image and start a thread
around it. Image threads are available in merge requests and commit detail views.
Clement Ho's avatar
Clement Ho включено в состав коммита
240

Michel Engelen's avatar
Michel Engelen включено в состав коммита
241
To start an image thread, hover your mouse over the image. Your mouse pointer
Clement Ho's avatar
Clement Ho включено в состав коммита
242
should convert into an icon, indicating that the image is available for commenting.
Michel Engelen's avatar
Michel Engelen включено в состав коммита
243
Simply click anywhere on the image to create a new thread.
Clement Ho's avatar
Clement Ho включено в состав коммита
244

Michel Engelen's avatar
Michel Engelen включено в состав коммита
245
![Start image thread](img/start_image_discussion.gif)
Clement Ho's avatar
Clement Ho включено в состав коммита
246
247

After you click on the image, a comment form will be displayed that would be the start
Michel Engelen's avatar
Michel Engelen включено в состав коммита
248
249
of your thread. Once you save your comment, you will see a new badge displayed on
top of your image. This badge represents your thread.
Clement Ho's avatar
Clement Ho включено в состав коммита
250

GitLab Bot's avatar
GitLab Bot включено в состав коммита
251
NOTE: **Note:**
Michel Engelen's avatar
Michel Engelen включено в состав коммита
252
253
254
This thread badge is typically associated with a number that is only used as a visual
reference for each thread. In the merge request thread tab,
this badge will be indicated with a comment icon since each thread will render a new
Clement Ho's avatar
Clement Ho включено в состав коммита
255
256
image section.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
257
258
Image threads also work on diffs that replace an existing image. In this diff view
mode, you can toggle the different view modes and still see the thread point badges.
Clement Ho's avatar
Clement Ho включено в состав коммита
259
260
261
262
263

| 2-up | Swipe | Onion Skin |
| :-----------: | :----------: | :----------: |
| ![2-up view](img/two_up_view.png) | ![swipe view](img/swipe_view.png) | ![onion skin view](img/onion_skin_view.png) |

Michel Engelen's avatar
Michel Engelen включено в состав коммита
264
Image threads also work well with resolvable threads. Resolved threads
Clement Ho's avatar
Clement Ho включено в состав коммита
265
266
267
on diffs (not on the merge request discussion tab) will appear collapsed on page
load and will have a corresponding badge counter to match the counter on the image.

Michel Engelen's avatar
Michel Engelen включено в состав коммита
268
![Image resolved thread](img/image_resolved_discussion.png)
Clement Ho's avatar
Clement Ho включено в состав коммита
269

Victor Wu's avatar
Victor Wu включено в состав коммита
270
## Lock discussions
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
271

GitLab Bot's avatar
GitLab Bot включено в состав коммита
272
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14531) in GitLab 10.1.
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
273

Michel Engelen's avatar
Michel Engelen включено в состав коммита
274
For large projects with many contributors, it may be useful to stop threads
Victor Wu's avatar
Victor Wu включено в состав коммита
275
in issues or merge requests in these scenarios:
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
276

Michel Engelen's avatar
Michel Engelen включено в состав коммита
277
278
279
- The project maintainer has already resolved the thread and it is not helpful
  for continued feedback.
- The project maintainer has already directed new conversation
Evan Read's avatar
Evan Read включено в состав коммита
280
  to newer issues or merge requests.
Michel Engelen's avatar
Michel Engelen включено в состав коммита
281
- The people participating in the thread are trolling, abusive, or otherwise
Evan Read's avatar
Evan Read включено в состав коммита
282
  being unproductive.
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
283

Victor Wu's avatar
Victor Wu включено в состав коммита
284
285
286
In these cases, a user with Developer permissions or higher in the project can lock (and unlock)
an issue or a merge request, using the "Lock" section in the sidebar. For issues,
a user with Reporter permissions can lock (and unlock).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
287

Victor Wu's avatar
Victor Wu включено в состав коммита
288
| Unlock | Lock |
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
289
290
291
| :-----------: | :----------: |
| ![Turn off discussion lock](img/turn_off_lock.png) | ![Turn on discussion lock](img/turn_on_lock.png) |

Victor Wu's avatar
Victor Wu включено в состав коммита
292
System notes indicate locking and unlocking.
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
293
294
295

![Discussion lock system notes](img/discussion_lock_system_notes.png)

Clement Ho's avatar
Clement Ho включено в состав коммита
296
In a locked issue or merge request, only team members can add new comments and
Victor Wu's avatar
Victor Wu включено в состав коммита
297
edit existing comments. Non-team members are restricted from adding or editing comments.
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
298

Victor Wu's avatar
Victor Wu включено в состав коммита
299
| Team member | Non-team member |
Jarka Kadlecova's avatar
Jarka Kadlecova включено в состав коммита
300
301
302
| :-----------: | :----------: |
| ![Comment form member](img/lock_form_member.png) | ![Comment form non-member](img/lock_form_non_member.png) |

Jan Beckmann's avatar
Jan Beckmann включено в состав коммита
303
Additionally, locked issues and merge requests can not be reopened.
Jarka Kadlecová's avatar
Jarka Kadlecová включено в состав коммита
304

GitLab Bot's avatar
GitLab Bot включено в состав коммита
305
## Merge Request Reviews
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
306

GitLab Bot's avatar
GitLab Bot включено в состав коммита
307
308
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.4.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/28154) to GitLab Core in 13.1.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323

When looking at a Merge Request diff, you are able to start a review.
This allows you to create comments inside a Merge Request that are **only visible to you** until published,
in order to allow you to submit them all as a single action.

### Starting a review

In order to start a review, simply write a comment on a diff as normal under the **Changes** tab
in an MR and click on the **Start a review** button.

![Starting a review](img/mr_review_start.png)

Once a review is started, you will see any comments that are part of this review marked `Pending`.
All comments that are part of a review show two buttons:

Michel Engelen's avatar
Michel Engelen включено в состав коммита
324
- **Finish review**: Submits all comments that are part of the review, making them visible to other users.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
325
326
327
328
- **Add comment now**: Submits the specific comment as a regular comment instead of as part of the review.

![A comment that is part of a review](img/pending_review_comment.png)

GitLab Bot's avatar
GitLab Bot включено в состав коммита
329
You can use [quick actions](../project/quick_actions.md) inside review comments. The comment will show the actions that will be performed once published.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
330
331
332
333
334
335
336
337
338
339
340

![A review comment with quick actions](img/review_comment_quickactions.png)

To add more comments to a review, start writing a comment as normal and click the **Add to review** button.

![Adding a second comment to a review](img/mr_review_second_comment.png)

This will add the comment to the review.

![Second review comment](img/mr_review_second_comment_added.png)

Michel Engelen's avatar
Michel Engelen включено в состав коммита
341
### Resolving/Unresolving threads
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
342

Michel Engelen's avatar
Michel Engelen включено в состав коммита
343
Review comments can also resolve/unresolve [resolvable threads](#resolvable-comments-and-threads).
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
344
When replying to a comment, you will see a checkbox that you can click in order to resolve or unresolve
Michel Engelen's avatar
Michel Engelen включено в состав коммита
345
the thread once published.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
346
347
348

![Resolve checkbox](img/mr_review_resolve.png)

Michel Engelen's avatar
Michel Engelen включено в состав коммита
349
If a particular pending comment will resolve or unresolve the thread, this will be shown on the pending
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
350
351
352
comment itself.

![Resolve status](img/mr_review_resolve2.png)
Michel Engelen's avatar
Michel Engelen включено в состав коммита
353
354

![Unresolve status](img/mr_review_unresolve.png)
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
355
356
357
358
359
360
361
362

### Submitting a review

If you have any comments that have not been submitted, you will see a bar at the
bottom of the screen with two buttons:

- **Discard**: Discards all comments that have not been submitted.
- **Finish review**: Opens a list of comments ready to be submitted for review.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
363
364
  Clicking **Submit review** will publish all comments. Any quick actions
  submitted are performed at this time.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
365

GitLab Bot's avatar
GitLab Bot включено в состав коммита
366
367
368
369
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.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
370
371
372
373
374
375
376
377

![Review submission](img/review_preview.png)

Submitting the review will send a single email to every notifiable user of the
merge request with all the comments associated to it.

Replying to this email will, consequentially, create a new comment on the associated merge request.

Felipe Artur's avatar
Felipe Artur включено в состав коммита
378
379
## Filtering notes

GitLab Bot's avatar
GitLab Bot включено в состав коммита
380
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/26723) in GitLab 11.5.
Felipe Artur's avatar
Felipe Artur включено в состав коммита
381

Evan Read's avatar
Evan Read включено в состав коммита
382
For issues with many comments like activity notes and user comments, sometimes
Michel Engelen's avatar
Michel Engelen включено в состав коммита
383
finding useful information can be hard. There is a way to filter comments from single notes and threads for merge requests and issues.
Felipe Artur's avatar
Felipe Artur включено в состав коммита
384

Felipe Artur's avatar
Felipe Artur включено в состав коммита
385
From a merge request's **Discussion** tab, or from an epic/issue overview, find the filter's dropdown menu on the right side of the page, from which you can choose one of the following options:
Felipe Artur's avatar
Felipe Artur включено в состав коммита
386
387

- **Show all activity**: displays all user comments and system notes
Evan Read's avatar
Evan Read включено в состав коммита
388
  (issue updates, mentions from other issues, changes to the description, etc).
Felipe Artur's avatar
Felipe Artur включено в состав коммита
389
- **Show comments only**: only displays user comments in the list.
Evan Read's avatar
Evan Read включено в состав коммита
390
- **Show history only**: only displays activity notes.
Felipe Artur's avatar
Felipe Artur включено в состав коммита
391
392
393
394
395
396
397

![Notes filters dropdown options](img/index_notes_filters.png)

Once you select one of the filters in a given issue or MR, GitLab will save
your preference, so that it will persist when you visit the same page again
from any device you're logged into.

Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
398
399
## Suggest Changes

GitLab Bot's avatar
GitLab Bot включено в состав коммита
400
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/18008) in GitLab 11.6.
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
401

Evan Read's avatar
Evan Read включено в состав коммита
402
As a reviewer, you're able to suggest code changes with a simple
GitLab Bot's avatar
GitLab Bot включено в состав коммита
403
Markdown syntax in Merge Request Diff threads. Then, the
Evan Read's avatar
Evan Read включено в состав коммита
404
Merge Request author (or other users with appropriate
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
405
[permission](../permissions.md)) is able to apply these
GitLab Bot's avatar
GitLab Bot включено в состав коммита
406
407
Suggestions with a click, which will generate a commit in
the merge request authored by the user that applied them.
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
408
409

1. Choose a line of code to be changed, add a new comment, then click
Evan Read's avatar
Evan Read включено в состав коммита
410
   on the **Insert suggestion** icon in the toolbar:
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
411

GitLab Bot's avatar
GitLab Bot включено в состав коммита
412
   ![Add a new comment](img/suggestion_button_v12_7.png)
Evan Read's avatar
Evan Read включено в состав коммита
413

Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
414
415
1. In the comment, add your suggestion to the pre-populated code block:

GitLab Bot's avatar
GitLab Bot включено в состав коммита
416
   ![Add a suggestion into a code block tagged properly](img/make_suggestion_v12_7.png)
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
417

GitLab Bot's avatar
GitLab Bot включено в состав коммита
418
1. Click either **Start a review** or **Add to review** to add your comment to a [review](#merge-request-reviews), or **Add comment now** to add the comment to the thread immediately.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
419

GitLab Bot's avatar
GitLab Bot включено в состав коммита
420
   The Suggestion in the comment can be applied by the merge request author
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
421
   directly from the merge request:
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
422

GitLab Bot's avatar
GitLab Bot включено в состав коммита
423
   ![Apply suggestions](img/apply_suggestion_v12_7.png)
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
424

GitLab Bot's avatar
GitLab Bot включено в состав коммита
425
Once the author applies a Suggestion, it will be marked with the **Applied** label,
Michel Engelen's avatar
Michel Engelen включено в состав коммита
426
the thread will be automatically resolved, and GitLab will create a new commit
GitLab Bot's avatar
GitLab Bot включено в состав коммита
427
428
and push the suggested change directly into the codebase in the merge request's
branch. [Developer permission](../permissions.md) is required to do so.
Jacques Erasmus's avatar
Jacques Erasmus включено в состав коммита
429

GitLab Bot's avatar
GitLab Bot включено в состав коммита
430
### Multi-line Suggestions
Oswaldo Ferreira's avatar
Oswaldo Ferreira включено в состав коммита
431

GitLab Bot's avatar
GitLab Bot включено в состав коммита
432
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/53310) in GitLab 11.10.
Oswaldo Ferreira's avatar
Oswaldo Ferreira включено в состав коммита
433

GitLab Bot's avatar
GitLab Bot включено в состав коммита
434
435
Reviewers can also suggest changes to multiple lines with a single Suggestion
within merge request diff threads by adjusting the range offsets. The
Michel Engelen's avatar
Michel Engelen включено в состав коммита
436
offsets are relative to the position of the diff thread, and specify the
James Ramsay's avatar
James Ramsay включено в состав коммита
437
range to be replaced by the suggestion when it is applied.
Oswaldo Ferreira's avatar
Oswaldo Ferreira включено в состав коммита
438
439
440

![Multi-line suggestion syntax](img/multi-line-suggestion-syntax.png)

GitLab Bot's avatar
GitLab Bot включено в состав коммита
441
In the example above, the Suggestion covers three lines above and four lines
James Ramsay's avatar
James Ramsay включено в состав коммита
442
443
below the commented line. When applied, it would replace from 3 lines _above_
to 4 lines _below_ the commented line, with the suggested change.
Oswaldo Ferreira's avatar
Oswaldo Ferreira включено в состав коммита
444
445
446
447

![Multi-line suggestion preview](img/multi-line-suggestion-preview.png)

NOTE: **Note:**
James Ramsay's avatar
James Ramsay включено в состав коммита
448
449
450
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.
Oswaldo Ferreira's avatar
Oswaldo Ferreira включено в состав коммита
451

GitLab Bot's avatar
GitLab Bot включено в состав коммита
452
453
454
455
456
457
458
459
### Code block nested in Suggestions

If you need to make a suggestion that involves a
[fenced code block](../markdown.md#code-spans-and-blocks), wrap your suggestion in four backticks
instead of the usual three.

![A comment editor with a suggestion with a fenced code block](img/suggestion_code_block_editor_v12_8.png)

GitLab Bot's avatar
GitLab Bot включено в состав коммита
460
![Output of a comment with a suggestion with a fenced code block](img/suggestion_code_block_output_v12_8.png)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
461

GitLab Bot's avatar
GitLab Bot включено в состав коммита
462
463
### Configure the commit message for applied Suggestions

GitLab Bot's avatar
GitLab Bot включено в состав коммита
464
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13086) in GitLab 12.7.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
465

GitLab Bot's avatar
GitLab Bot включено в состав коммита
466
467
468
469
470
471
GitLab uses a default commit message
when applying Suggestions: `Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)`

For example, consider that a user applied 3 suggestions to 2 different files, the default commit message will be: **Apply 3 suggestion(s) to 2 file(s)**

These commit messages can be customized to follow any guidelines you might have. To do so, expand the **Merge requests**
GitLab Bot's avatar
GitLab Bot включено в состав коммита
472
473
tab within your project's **General** settings and change the
**Merge suggestions** text:
GitLab Bot's avatar
GitLab Bot включено в состав коммита
474

GitLab Bot's avatar
GitLab Bot включено в состав коммита
475
![Custom commit message for applied Suggestions](img/suggestions_custom_commit_messages_v13_1.jpg)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
476
477
478

You can also use following variables besides static text:

GitLab Bot's avatar
GitLab Bot включено в состав коммита
479
480
| Variable | Description | Output example |
|---|---|---|
GitLab Bot's avatar
GitLab Bot включено в состав коммита
481
482
483
| `%{branch_name}` | The name of the branch the Suggestion(s) was(were) applied to. | `my-feature-branch` |
| `%{files_count}` | The number of file(s) to which Suggestion(s) was(were) applied.| **2** |
| `%{file_paths}` | The path(s) of the file(s) Suggestion(s) was(were) applied to. Paths are separated by commas.| `docs/index.md, docs/about.md` |
GitLab Bot's avatar
GitLab Bot включено в состав коммита
484
485
| `%{project_path}` | The project path. | `my-group/my-project` |
| `%{project_name}` | The human-readable name of the project. | **My Project** |
GitLab Bot's avatar
GitLab Bot включено в состав коммита
486
487
488
| `%{suggestions_count}` | The number of Suggestions applied.| **3** |
| `%{username}` | The username of the user applying Suggestion(s). | `user_1` |
| `%{user_full_name}` | The full name of the user applying Suggestion(s). | **User 1** |
GitLab Bot's avatar
GitLab Bot включено в состав коммита
489
490
491

For example, to customize the commit message to output
**Addresses user_1's review**, set the custom text to
GitLab Bot's avatar
GitLab Bot включено в состав коммита
492
`Addresses %{username}'s review`.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
493
494

NOTE: **Note:**
GitLab Bot's avatar
GitLab Bot включено в состав коммита
495
Custom commit messages for each applied Suggestion (and for batch Suggestions) will be
GitLab Bot's avatar
GitLab Bot включено в состав коммита
496
introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381).
GitLab Bot's avatar
GitLab Bot включено в состав коммита
497
498
499

### Batch Suggestions

GitLab Bot's avatar
GitLab Bot включено в состав коммита
500
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](https://about.gitlab.com/handbook/product/#alpha).
GitLab Bot's avatar
GitLab Bot включено в состав коммита
501
502
503
504
> - It was deployed behind a feature flag, disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/227799) on GitLab 13.2.
> - It's enabled on GitLab.com.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-batch-suggestions-core-only).
GitLab Bot's avatar
GitLab Bot включено в состав коммита
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523

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 that will be applied with a single commit, click **Add suggestion to batch**:

   ![A code change suggestion displayed, with the button to add the suggestion to a batch 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 button to add an additional suggestion to a batch highlighted.](img/add_another_suggestion_to_batch_v13_1.jpg "Add another suggestion to a batch")

1. To remove suggestions, click **Remove from batch**:

   ![A code change suggestion displayed, with the button to remove that suggestion from its batch highlighted.](img/remove_suggestion_from_batch_v13_1.jpg "Remove a suggestion from a batch")

1. Having added all the suggestions to your liking, when ready, click **Apply suggestions**:

   ![A code change suggestion displayed, with the button to apply the batch of suggestions highlighted.](img/apply_batch_of_suggestions_v13_1.jpg "Apply a batch of suggestions")
GitLab Bot's avatar
GitLab Bot включено в состав коммита
524

GitLab Bot's avatar
GitLab Bot включено в состав коммита
525
#### Enable or disable Batch Suggestions **(CORE ONLY)**
GitLab Bot's avatar
GitLab Bot включено в состав коммита
526
527

Batch Suggestions is
GitLab Bot's avatar
GitLab Bot включено в состав коммита
528
deployed behind a feature flag that is **enabled by default**.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
529
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
530
can opt to disable it for your instance.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
531
532
533
534
535

To enable it:

```ruby
# Instance-wide
GitLab Bot's avatar
GitLab Bot включено в состав коммита
536
Feature.enable(:batch_suggestions)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
537
538
539
540
541
542
```

To disable it:

```ruby
# Instance-wide
GitLab Bot's avatar
GitLab Bot включено в состав коммита
543
Feature.disable(:batch_suggestions)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
544
545
```

Michel Engelen's avatar
Michel Engelen включено в состав коммита
546
## Start a thread by replying to a standard comment
Constance Okoghenun's avatar
Constance Okoghenun включено в состав коммита
547

GitLab Bot's avatar
GitLab Bot включено в состав коммита
548
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/30299) in GitLab 11.9
Constance Okoghenun's avatar
Constance Okoghenun включено в состав коммита
549

Michel Engelen's avatar
Michel Engelen включено в состав коммита
550
To reply to a standard (non-thread) comment, you can use the **Reply to comment** button.
Constance Okoghenun's avatar
Constance Okoghenun включено в состав коммита
551
552
553

![Reply to comment button](img/reply_to_comment_button.png)

Michel Engelen's avatar
Michel Engelen включено в состав коммита
554
The **Reply to comment** button is only displayed if you have permissions to reply to an existing thread, or start a thread from a standard comment.
Constance Okoghenun's avatar
Constance Okoghenun включено в состав коммита
555
556
557
558
559

Clicking on the **Reply to comment** button will bring the reply area into focus and you can type your reply.

![Reply to comment feature](img/reply_to_comment.gif)

Michel Engelen's avatar
Michel Engelen включено в состав коммита
560
561
Replying to a non-thread comment will convert the non-thread comment to a
thread once the reply is submitted. This conversion is considered an edit
Mike Lewis's avatar
Mike Lewis включено в состав коммита
562
to the original comment, so a note about when it was last edited will appear underneath it.
Constance Okoghenun's avatar
Constance Okoghenun включено в состав коммита
563

Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
564
This feature only exists for Issues, Merge requests, and Epics. Commits, Snippets and Merge request diff threads are
Michel Engelen's avatar
Michel Engelen включено в состав коммита
565
not supported yet.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
566
567
568
569
570
571
572
573
574
575
576
577

## Assign an issue to the commenting user

> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/191455) in GitLab 13.1.

You can assign an issue to a user who made a comment.

In the comment, click the **More Actions** menu and click **Assign to commenting user**.

Click the button again to unassign the commenter.

![Assign to commenting user](img/quickly_assign_commenter_v13_1.png)