GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation interacts with the GitLab API to compare two points in a project's repository, such as commits, branches, or tags. It is useful for developers and DevOps engineers who want to programmatically retrieve differences between two states in a GitLab project repository, for example, to review changes before merging or to analyze code evolution.

Use Case Examples

  1. Compare the 'main' branch with a feature branch to see the changes introduced by the feature.
  2. Compare two specific commits to understand the differences between them.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making 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.
Parameter Schema Defines the parameters required for the repository comparison, including project ID, 'from' and 'to' points for comparison, and optional flags for comparison method and output format.
Query Parameters Collection of query parameters for the comparison API call, including 'from', 'to', 'from_project_id', 'straight', and 'unidiff'.
Path Parameters Collection of path parameters, specifically the project ID for which the repository comparison is performed.

Output

JSON

  • comparison - The comparison result object returned by the GitLab API, containing details about the differences between the specified points in the repository.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID is correct and accessible with the provided authentication.
  • Verify that the 'from' and 'to' parameters are valid commit SHAs, branch names, or tag names in the project repository.
  • Check network connectivity and base URL correctness if the API request fails.
  • If authentication is skipped, ensure the GitLab instance allows unauthenticated access to the repository comparison endpoint.

Links

Discussion