GitLab API icon

GitLab API

Gitlab

Actions880

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 teams 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 in a specific GitLab project to see the differences.
  2. Retrieve a unified diff format of changes between two commits in a project repository.

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 Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the API request, default is GET.
Query Parameters Parameters to specify the comparison details such as the starting point ('from'), ending point ('to'), optional project ID to compare from, comparison method, and output format.
Path Parameters Path parameter specifying the project ID or URL-encoded path to identify the project repository to compare.

Output

JSON

  • commit - Details of the commit at the 'to' point in the comparison.
  • commits - List of commits between 'from' and 'to' points.
  • diffs - List of file diffs between the two points.
  • compare_timeout - Indicates if the comparison operation timed out.
  • compare_same_ref - Indicates if the 'from' and 'to' points are the same.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID or path is correctly URL-encoded to avoid 404 errors.
  • Verify that the 'from' and 'to' parameters are valid commit SHAs, branch names, or tags in the project repository.
  • Check API rate limits and authentication credentials if requests fail with authorization errors.
  • If the comparison times out, try reducing the range or complexity of the comparison.

Links

Discussion