GitLab API

GitlabTool

Actions905

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 teams 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 version of a merge request to review code changes before merging.
  2. Automating the retrieval of merge request diff versions for integration with other tools or reporting systems.

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 The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the API 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.
  • head_commit_sha - SHA of the head commit for this diff version.
  • base_commit_sha - SHA of the base commit for this diff version.
  • start_commit_sha - SHA of the start commit for this diff version.
  • state - State of the diff version.
  • created_at - Timestamp when the diff version was created.
  • commits - List of commits included in this diff version.
  • diffs - List of diffs representing the changes in this version.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID, merge request IID, and version ID are correctly specified to avoid 404 errors.
  • Check that the API key credential has sufficient permissions to access the project and merge request data.
  • If the 'unidiff' query parameter is used, ensure it is a valid boolean value to prevent request errors.

Links

Discussion