GitLab API

GitlabTool

Actions1000

Overview

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

Use Case Examples

  1. Fetch merge requests for 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 integration status.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters for pagination such as page number and items per page.
Path Parameters Required path parameters identifying the project and commit.

Output

JSON

  • id - Unique identifier of the merge request.
  • title - Title of the merge request.
  • description - Description of the merge request.
  • state - Current state of the merge request (e.g., opened, closed, merged).
  • created_at - Timestamp when the merge request was created.
  • updated_at - Timestamp when the merge request was last updated.
  • merged_by - User who merged the merge request, if applicable.
  • merged_at - Timestamp when the merge request was merged, if applicable.
  • closed_by - User who closed the merge request, if applicable.
  • closed_at - Timestamp when the merge request was closed, if applicable.
  • target_branch - Target branch of the merge request.
  • source_branch - Source branch of the merge request.
  • upvotes - Number of upvotes the merge request has received.
  • downvotes - Number of downvotes the merge request has received.
  • author - Author of the merge request.
  • assignees - List of users assigned to the merge request.
  • reviewers - List of users requested to review the merge request.
  • labels - Labels associated with the merge request.
  • work_in_progress - Indicates if the merge request is a work in progress.
  • milestone - Milestone associated with the merge request.
  • merge_when_pipeline_succeeds - Flag indicating if the merge should happen when the pipeline succeeds.
  • merge_status - Current merge status of the merge request.
  • sha - SHA of the commit associated with the merge request.
  • squash - Indicates if the merge request will be squashed when merged.
  • discussion_locked - Indicates if the discussion on the merge request is locked.
  • should_remove_source_branch - Indicates if the source branch should be removed after merging.
  • force_remove_source_branch - Indicates if the source branch removal is forced.
  • web_url - Web URL to access the merge request.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and commit SHA/path are correctly provided; incorrect values will result in errors or empty responses.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to access the project's repository data.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Pagination parameters (page, per_page) should be set appropriately to avoid missing data or excessive data retrieval.

Links

Discussion