mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
Add labels support to PR and MR creation tools (#9402)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -462,6 +462,7 @@ class GitLabService(BaseGitService, GitService):
|
||||
target_branch: str,
|
||||
title: str,
|
||||
description: str | None = None,
|
||||
labels: list[str] | None = None,
|
||||
) -> str:
|
||||
"""
|
||||
Creates a merge request in GitLab
|
||||
@@ -472,6 +473,7 @@ class GitLabService(BaseGitService, GitService):
|
||||
target_branch: The name of the branch you want the changes merged into
|
||||
title: The title of the merge request (optional, defaults to a generic title)
|
||||
description: The description of the merge request (optional)
|
||||
labels: A list of labels to apply to the merge request (optional)
|
||||
|
||||
Returns:
|
||||
- MR URL when successful
|
||||
@@ -494,6 +496,10 @@ class GitLabService(BaseGitService, GitService):
|
||||
'description': description,
|
||||
}
|
||||
|
||||
# Add labels if provided
|
||||
if labels and len(labels) > 0:
|
||||
payload['labels'] = ','.join(labels)
|
||||
|
||||
# Make the POST request to create the MR
|
||||
response, _ = await self._make_request(
|
||||
url=url, params=payload, method=RequestMethod.POST
|
||||
|
||||
Reference in New Issue
Block a user