GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to retrieve blame information for a specific file in a project repository. It is useful for developers or teams who want to track changes and authorship of lines within a file over a specified range. For example, it can be used to identify who last modified certain lines in a source code file on a particular branch or commit.

Use Case Examples

  1. Get blame information for lines 10 to 20 in the file 'lib/class.rb' of the project 'gitlab-org/gitlab' on the 'main' branch.
  2. Retrieve the author and commit details for a specific file path in a GitLab project repository.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the API request, defaulting to GET.
Parameter Schema Defines the required path and query parameters for the API call, including project ID, file path, branch/tag/commit reference, and line range to blame.
Query Parameters Collection of query parameters including 'ref' (branch/tag/commit), 'range[start]' (start line), and 'range[end]' (end line) to specify the blame range.
Path Parameters Collection of path parameters including 'id' (project ID) and 'file_path' (URL encoded path to the file) to specify the target file.

Output

JSON

  • blame - The blame information for the specified file and line range, including details about the commits and authors responsible for each line.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and file path are correctly URL encoded and valid in the GitLab instance.
  • Verify that the specified branch, tag, or commit reference exists in the repository.
  • Check that the line range specified in 'range[start]' and 'range[end]' is within the bounds of the file.
  • Authentication errors may occur if the API key is missing, invalid, or lacks sufficient permissions.

Links

Discussion