Add an Inline Comment to a File
When a code review is in progress, you can add inline comments directly to the lines of code in a file. You can’t, however, add an inline comment after a merge request has been merged or closed.
Here's how to add inline comments directly to the source code being reviewed:
Click the Pending Comments tab to see your pending or unpublished comments.
To reply to a published comment, click Reply , enter your comment, and click Reply. Replies to published comments will be published immediately but you can only edit or delete them if you added them. In addition, you can't edit or delete comments added by other users. You can only reply to those.
To filter published comments, select Filter and enter a term or partial string to filter by.
To edit one of your comments, select the comment and then click
Edit
. Make your changes and then click Save to post your
edited comment.
Manage Unpublished Comments
The Pending Comments tab displays all pending comments with the code where these comments were added. The comments appear inline in the code.
Here are several things you can do with unpublished comments:
-
To edit a comment, click Edit
.
-
To publish a pending comment, click Publish to the right side of the comment header.
-
To publish all pending comments, click Publish All.
-
To discard all pending comments, click Discard All.
-
To delete a comment, click Delete
.
Manage Inline Comments
You can use the Changed Files tab to work with inline comments. Click the Line comment navigator icon to open the comments list and navigate to a comment.
Each inline comment includes icons you can use to update the comment.
- Use the Expand and Collapse icons to expand and collapse the comment thread. Outdated comments (that applied to subsequently deleted code) are collapsed by default.
-
To edit a comment, click the Edit comment icon.
-
To delete a comment, click the Delete comment icon.
-
To publish a pending comment, click the Publish comment icon.
-
To reply to a comment, click the Reply icon, then select Reply. You can also select Need Attention, Addressed, or Resolve. This supports the Need Attention > Addressed > Resolved workflow. Resolve is always available unless a comment is marked Need Attention – a comment marked Need Attention must be addressed before it can be resolved.