GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to apply a suggestion identified by its ID. It is useful in automation workflows where you want to programmatically apply code suggestions or merge request suggestions in GitLab projects. For example, it can be used to automatically apply a suggestion after certain validations or approvals in a CI/CD pipeline.

Use Case Examples

  1. Automatically apply a suggestion in a GitLab merge request after successful tests.
  2. Apply suggestions in bulk for multiple merge requests using an automated workflow.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, defaulting to PUT for this operation.
Path Parameters The path parameters for the API request, specifically the 'id' of the suggestion to apply.

Output

JSON

  • id - The ID of the applied suggestion.
  • state - The state of the suggestion after applying.
  • applied_at - Timestamp when the suggestion was applied.
  • merge_request_id - ID of the merge request associated with the suggestion.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the 'id' path parameter is correctly set and corresponds to an existing suggestion in GitLab.
  • Verify that the authentication credentials are valid and have sufficient permissions to apply suggestions.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure the API endpoint is reachable.
  • Common error messages include 404 Not Found if the suggestion ID does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion