GitLab Extended icon

GitLab Extended

Extended GitLab node

Actions18

Overview

This node operation allows you to create a discussion on a specific merge request in a GitLab project. Discussions are threaded conversations attached to code changes, enabling reviewers and collaborators to comment on specific lines or sections of the merge request. This is particularly useful for code review workflows where detailed feedback or suggestions need to be provided inline with the code.

For example, you might use this node to add a comment suggesting a code improvement on line 42 of a newly added file in a merge request, helping your team maintain code quality and clarity during the review process.

Properties

Name Meaning
Merge Request IID The internal ID (IID) of the merge request to which the discussion will be added, e.g., 7.
Note Body The text content of the note or comment to post in the discussion, e.g., "Looks good to me".
Post as Suggestion Boolean flag indicating whether the note should be formatted as a suggestion (code change proposal).
Position Type The type of position for the discussion; options are: text (for textual comments) or image.
New Path The file path of the new version of the file where the discussion is positioned.
Old Path The file path of the old version of the file where the discussion is positioned.
New Line The line number in the new file version where the discussion is anchored.
Old Line The line number in the old file version where the discussion is anchored (optional, defaults to 0).
Base SHA The base commit SHA of the merge request's diff.
Head SHA The head commit SHA of the merge request's diff.
Start SHA The start commit SHA of the merge request's diff.

Output

The node outputs an array of JSON objects representing the created discussion(s) returned from the GitLab API. Each object contains details about the discussion, including its ID, notes, position information, author, timestamps, and other metadata related to the discussion thread.

If the node supports binary data output, it is not applicable here since discussions are purely textual and metadata-based.

Dependencies

  • Requires an API key credential for authenticating with the GitLab API.
  • The node expects the GitLab project to be identified either by a project ID or by owner and project name.
  • Proper permissions on the GitLab project to create discussions on merge requests are necessary.

Troubleshooting

  • Error: "The 'oldLine' parameter must be a non-negative number."
    This error occurs if the Old Line property is set to a negative value. Ensure that Old Line is zero or a positive integer.

  • Authentication errors may occur if the API key credential is missing, invalid, or lacks sufficient permissions. Verify the credential configuration and access rights.

  • Invalid merge request IID: If the specified merge request IID does not exist or is incorrect, the API call will fail. Double-check the IID value.

  • Incorrect file paths or SHAs: The discussion position depends on accurate file paths and commit SHAs. Incorrect values can cause the API to reject the request or place the discussion incorrectly.

Links and References

Discussion