GitLab API icon

GitLab API

Gitlab

Actions917

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 merge request at a particular version, such as reviewing code changes or auditing merge request history.

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 diff versions for integration into a CI/CD pipeline or code quality analysis tool.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters for the 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 of the diff to retrieve.

Output

JSON

  • id - The ID of the merge request diff version.
  • merge_request_iid - The internal ID of the merge request.
  • project_id - The ID of the project.
  • diffs - The list of diffs included in this version.
  • state - The state of the merge request version.
  • created_at - Timestamp when this version was created.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID, merge request IID, and version ID are correct and exist in the GitLab instance.
  • Verify that the authentication token has sufficient permissions to access the project and merge request data.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • If the 'unidiff' query parameter is used, ensure it is a valid boolean value.

Links

Discussion