Commit 1d10e7e1 authored by Suzanne Selhorn's avatar Suzanne Selhorn

Merge branch 'selhorn-threads-4' into 'master'

More updates to Threads for CTRT

See merge request gitlab-org/gitlab!65291
parents 73d9e029 f1927655
...@@ -112,15 +112,67 @@ Prerequisites: ...@@ -112,15 +112,67 @@ Prerequisites:
To resolve a thread: To resolve a thread:
1. Go to the thread. 1. Go to the thread.
1. Below the last reply, in the **Reply** field, either: 1. Do one of the following:
- Select **Resolve thread**. - In the top right of the original comment, select the **Resolve thread** (**{check-circle}**) icon.
- Enter text, select the **Resolve thread** checkbox, and select **Add comment now**. - Below the last reply, in the **Reply** field, select **Resolve thread**.
- Below the last reply, in the **Reply** field, enter text, select the **Resolve thread** checkbox, and select **Add comment now**.
At the top of the page, the number of unresolved threads is updated. At the top of the page, the number of unresolved threads is updated.
![Count of unresolved threads](img/unresolved_threads_v14_1.png) ![Count of unresolved threads](img/unresolved_threads_v14_1.png)
### Commit threads in the context of a merge request ### Move all unresolved threads in a merge request to an issue
If you have multiple unresolved threads in a merge request, you can
create an issue to resolve them separately.
- In the merge request, at the top of the page, select **Resolve all threads in new issue**.
![Open new issue for all unresolved threads](img/btn_new_issue_for_all_threads.png)
All threads are marked as resolved and a link is added from the merge request to
the newly created issue.
### Move one unresolved thread in a merge request to an issue
If you have one specific unresolved thread in a merge request, you can
create an issue to resolve it separately.
- In the merge request, under the last reply to the thread, next to the
**Resolve thread** button, select **Resolve this thread in a new issue**.
![Create issue for thread](img/new_issue_for_thread.png)
The thread is marked as resolved and a link is added from the merge request to
the newly created issue.
### Prevent merge unless all threads are resolved
You can prevent merge requests from being merged until all threads are
resolved.
1. On the top bar, select **Menu > Projects** and find your project.
1. On the left sidebar, select **Settings > General**.
1. Expand **Merge requests**.
1. Under **Merge checks**, select the **All discussions must be resolved** checkbox.
1. Select **Save changes**.
### Automatically resolve threads in a merge request when they become outdated
You can set merge requests to automatically resolve threads when lines are modified
with a new push.
1. On the top bar, select **Menu > Projects** and find your project.
1. On the left sidebar, select **Settings > General**.
1. Expand **Merge requests**.
1. Under **Merge options**, select the
**Automatically resolve merge request diff discussions when they become outdated** checkbox.
1. Select **Save changes**.
Threads are now resolved if a push makes a diff section outdated.
Threads on lines that don't change and top-level resolvable threads are not resolved.
## Commit threads in the context of a merge request
For reviewers with commit-based workflow, it may be useful to add threads to 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 specific commit diffs in the context of a merge request. These threads
...@@ -155,88 +207,6 @@ When a link of a commit reference is found in a thread inside a merge ...@@ -155,88 +207,6 @@ When a link of a commit reference is found in a thread inside a merge
request, it is automatically converted to a link in the context of the request, it is automatically converted to a link in the context of the
current merge request. current merge request.
### Marking a comment or thread as resolved
You can mark a thread as resolved by selecting the **Resolve thread**
button at the bottom of the thread.
!["Resolve thread" button](img/resolve_thread_button_v13_3.png)
Alternatively, you can mark each comment as resolved individually.
!["Resolve comment" button](img/resolve_comment_button.png)
### Move all unresolved threads in a merge request to an issue
To continue all open threads from a merge request in a new issue, select
**Resolve all threads in new issue**.
![Open new issue for all unresolved threads](img/btn_new_issue_for_all_threads.png)
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),
an **open an issue to resolve them later** link displays in the merge
request widget.
![Link in merge request widget](img/resolve_thread_open_issue_v13_9.png)
This prepares an issue with its content referring to the merge request and
the unresolved threads.
![Issue mentioning threads in a merge request](img/preview_issue_for_threads.png)
Hitting **Create issue** causes all threads to be marked as resolved and
add a note referring to the newly created issue.
![Mark threads as resolved notice](img/resolve_thread_issue_notice.png)
You can now proceed to merge the merge request from the UI.
### Moving a single thread to a new issue
To create a new issue for a single thread, you can use the **Resolve this
thread in a new issue** button.
![Create issue for thread](img/new_issue_for_thread.png)
This directs you to a new issue prefilled with the content of the
thread, similar to the issues created for delegating multiple
threads at once. Saving the issue marks the thread as resolved and
add a note to the merge request thread referencing the new issue.
![New issue for a single thread](img/preview_issue_for_thread.png)
### Only allow merge requests to be merged if all threads are resolved
You can prevent merge requests from being merged until all threads are
resolved.
Navigate to your project's settings page, select the
**Only allow merge requests to be merged if all threads are resolved** check
box and hit **Save** for the changes to take effect.
![Only allow merge if all the threads are resolved settings](img/only_allow_merge_if_all_threads_are_resolved.png)
From now on, you can't merge from the UI until all threads
are resolved.
![Only allow merge if all the threads are resolved message](img/resolve_thread_open_issue_v13_9.png)
### Automatically resolve merge request diff threads when they become outdated
You can automatically resolve merge request diff threads on lines modified
with a new push.
Navigate to your project's settings page, select the **Automatically resolve
merge request diffs threads on lines changed with a push** check box and hit
**Save** for the changes to take effect.
![Automatically resolve merge request diff threads when they become outdated](img/automatically_resolve_outdated_discussions.png)
From now on, any threads on a diff are 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.
## Add a comment to a commit ## Add a comment to a commit
You can add comments and threads to a particular commit. You can add comments and threads to a particular commit.
......
...@@ -60,7 +60,7 @@ a merge request. ...@@ -60,7 +60,7 @@ a merge request.
After a merge request receives the [number and type of approvals](rules.md) you configure, it can merge After a merge request receives the [number and type of approvals](rules.md) you configure, it can merge
unless it's blocked for another reason. Merge requests can be blocked by other problems, unless it's blocked for another reason. Merge requests can be blocked by other problems,
such as merge conflicts, [pending discussions](../../../discussions/index.md#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved), such as merge conflicts, [pending discussions](../../../discussions/index.md#prevent-merge-unless-all-threads-are-resolved),
or a [failed CI/CD pipeline](../merge_when_pipeline_succeeds.md). or a [failed CI/CD pipeline](../merge_when_pipeline_succeeds.md).
To prevent merge request authors from approving their own merge requests, To prevent merge request authors from approving their own merge requests,
......
...@@ -251,7 +251,7 @@ Set up your project's merge request settings: ...@@ -251,7 +251,7 @@ Set up your project's merge request settings:
- Enable [merge request approvals](../merge_requests/approvals/index.md). - Enable [merge request approvals](../merge_requests/approvals/index.md).
- Enable [status checks](../merge_requests/status_checks.md). - Enable [status checks](../merge_requests/status_checks.md).
- Enable [merge only if pipeline succeeds](../merge_requests/merge_when_pipeline_succeeds.md). - Enable [merge only if pipeline succeeds](../merge_requests/merge_when_pipeline_succeeds.md).
- Enable [merge only when all threads are resolved](../../discussions/index.md#only-allow-merge-requests-to-be-merged-if-all-threads-are-resolved). - Enable [merge only when all threads are resolved](../../discussions/index.md#prevent-merge-unless-all-threads-are-resolved).
- Enable [require an associated issue from Jira](../../../integration/jira/issues.md#require-associated-jira-issue-for-merge-requests-to-be-merged). - Enable [require an associated issue from Jira](../../../integration/jira/issues.md#require-associated-jira-issue-for-merge-requests-to-be-merged).
- Enable [`delete source branch after merge` option by default](../merge_requests/getting_started.md#deleting-the-source-branch). - Enable [`delete source branch after merge` option by default](../merge_requests/getting_started.md#deleting-the-source-branch).
- Configure [suggested changes commit messages](../merge_requests/reviews/suggestions.md#configure-the-commit-message-for-applied-suggestions). - Configure [suggested changes commit messages](../merge_requests/reviews/suggestions.md#configure-the-commit-message-for-applied-suggestions).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment