GitLab Extended icon

GitLab Extended

Extended GitLab node

Overview

This node enables creating a merge request in a GitLab project. A merge request is a fundamental feature in GitLab used to propose changes from one branch (source) into another (target), facilitating code review and collaboration before merging.

Common scenarios where this node is beneficial include:

  • Automating the creation of merge requests as part of CI/CD pipelines.
  • Integrating GitLab merge request creation into broader workflows, such as issue tracking or deployment automation.
  • Creating merge requests programmatically based on external triggers or events.

Practical example:

  • After pushing a feature branch to a repository, automatically create a merge request targeting the main branch with a descriptive title and optional detailed description.

Properties

Name Meaning
Authentication Choose between using saved credentials ("Credential") or specifying custom connection details ("Custom").
GitLab Server Base URL of your GitLab instance, e.g., "https://gitlab.com". Used only if "Custom" authentication is selected.
Access Token Personal access token with API permissions for authentication. Used only if "Custom" authentication is selected.
Project Owner Namespace or owner of the project. Ignored if "Project ID" is set. Used only if "Custom" authentication is selected.
Project Name Project slug or name. Ignored if "Project ID" is set. Used only if "Custom" authentication is selected.
Project ID Numeric project ID. Takes precedence over owner and name if provided. Used only if "Custom" authentication is selected.
Source Branch Required. Name of the source branch containing the changes to be merged, e.g., "feature/api".
Target Branch Required. Name of the target branch to merge into, e.g., "main". Defaults to "main".
Title Required. Title of the merge request, e.g., "Fix login bug".
Description Optional detailed description of the merge request, e.g., "Steps to reproduce the bug".

Output

The node outputs JSON data representing the created merge request object returned by the GitLab API. This typically includes fields such as:

  • id: Internal ID of the merge request.
  • iid: Project-specific merge request number.
  • title: Title of the merge request.
  • description: Detailed description.
  • state: Current state (e.g., opened).
  • source_branch and target_branch: Branch names involved.
  • web_url: URL to view the merge request in GitLab.
  • Other metadata like author info, timestamps, labels, etc.

No binary data output is produced by this operation.

Dependencies

  • Requires an API authentication token with appropriate permissions to create merge requests in the target GitLab project.
  • If using saved credentials, the node expects a configured credential with access rights.
  • For custom authentication, the user must provide the GitLab server URL, access token, and project identification details.
  • The node uses GitLab's REST API endpoints under the hood.

Troubleshooting

  • Invalid or missing authentication: Ensure that either valid saved credentials or correct custom authentication details (server URL, access token) are provided.
  • Project identification errors: If both project ID and project owner/name are missing or incorrect, the API call will fail. Provide a valid numeric project ID or correct owner and project name.
  • Branch not found: The source and target branches must exist in the repository; otherwise, the merge request creation will fail.
  • Permission denied: The access token must have sufficient permissions to create merge requests in the specified project.
  • API rate limits or network issues: Temporary failures may occur due to API limits or connectivity problems; retrying later might help.

Error messages thrown by the node generally reflect these issues and should guide corrective actions accordingly.

Links and References

Discussion