GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves detailed information about a specific merge request in a GitLab project using the GitLab API v4. It is useful for scenarios where you need to programmatically access merge request details such as status, description, commits behind the target branch, or rebase status. For example, it can be used in CI/CD pipelines, project management automation, or reporting tools to fetch and display merge request data.

Use Case Examples

  1. Fetch details of a merge request by project ID and merge request internal ID to monitor its status.
  2. Retrieve rendered HTML for the merge request title and description for display in a custom dashboard.
  3. Check if a rebase operation is in progress on a merge request to automate merge conflict handling.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Parameter Schema Defines required and optional parameters for the API call, including project ID, merge request internal ID, and optional query parameters to include rendered HTML, diverged commits count, and rebase status.
Query Parameters Optional query parameters to customize the response, such as rendering HTML, including diverged commits count, and rebase status.
Path Parameters Path parameters specifying the project ID and merge request internal ID to identify the merge request.

Output

JSON

  • id - Unique identifier of the merge request.
  • title - Title of the merge request.
  • description - Description of the merge request.
  • state - Current state of the merge request (e.g., opened, closed, merged).
  • created_at - Timestamp when the merge request was created.
  • updated_at - Timestamp when the merge request was last updated.
  • merged_by - User who merged the merge request, if applicable.
  • merge_commit_sha - SHA of the merge commit, if merged.
  • diverged_commits_count - Number of commits the source branch is behind the target branch, if requested.
  • rebase_in_progress - Boolean indicating if a rebase operation is in progress, if requested.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and merge request internal ID are correct and URL-encoded if necessary.
  • Check that the GitLab API key credential is valid and has sufficient permissions to access the project and merge request.
  • If the response is empty or missing expected fields, verify that optional query parameters are correctly set as boolean strings ('true' or 'false').
  • Network issues or incorrect base URL can cause request failures; verify the base URL and network connectivity.

Links

Discussion