GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves merge requests associated with a specific commit in a GitLab project repository. It is useful for developers and project managers who want to track which merge requests include a particular commit, aiding in code review, auditing, and project management workflows. For example, it can be used to fetch all merge requests related to a commit identified by its SHA or a branch/tag name within a project.

Use Case Examples

  1. Fetch merge requests for a commit SHA 'abc123' in project with ID '42' to review related code changes.
  2. List merge requests for the latest commit on a branch to verify pending code reviews.

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.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET.
Query Parameters Optional query parameters for pagination, including page number and items per page.
Path Parameters Required path parameters identifying the project and commit.

Output

JSON

  • merge_requests - List of merge requests associated with the specified commit.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and commit SHA or branch/tag name are correct and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to access the project and repository data.
  • Check network connectivity and the base URL if using a self-hosted GitLab instance.
  • Common error messages include 404 Not Found if the project or commit does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion