GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves a specific version of a merge request diff from a GitLab project using the GitLab API. It is useful for developers and DevOps engineers who need to access detailed information about changes in a particular merge request version, such as reviewing code diffs or auditing changes over time.

Use Case Examples

  1. Fetching the diff of a specific merge request version to review code changes before merging.
  2. Automating the retrieval of merge request version details for integration into CI/CD pipelines or reporting tools.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the API request, default is GET.
Query Parameters Optional query parameters for the API request, including 'unidiff' to specify if the diff should be in Unified diff format.
Path Parameters Required path parameters identifying the project, merge request, and version ID.

Output

JSON

  • id - The ID of the merge request diff version.
  • state - The state of the merge request version.
  • created_at - Timestamp when the merge request version was created.
  • commits - List of commits included in this merge request version.
  • diffs - The diffs associated with this merge request version.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID, merge request IID, and version ID are correctly provided and exist in the GitLab instance.
  • Verify that the API key credential has sufficient permissions to access merge request details.
  • Check the base URL to confirm it points to the correct GitLab instance, especially if using a self-hosted GitLab.
  • If the 'unidiff' query parameter is used, ensure it is a valid boolean value.

Links

Discussion