feat: add gitlab issue-to-mr automation - #525
Conversation
Port the github-issue-to-pr automation to GitLab, creating a new catalog entry and automation script adapted for the GitLab API: - manifest.json: catalog entry with gitlab provider, merge_request_mode field, and bundle config referencing the new script - main.py: full automation script handling all GitLab API differences (PRIVATE-TOKEN auth, URL-encoded project paths, iid vs number, resource_label_events with action=add, notes for comments, merge_requests endpoint with Draft: title prefix, glab CLI in prompts, configurable GITLAB_API_URL for self-hosted instances) Co-authored-by: openhands <openhands@all-hands.dev>
|
👋 This PR needs a couple of things fixed before OpenHands can review it:
Push an update once this is addressed and this check re-runs automatically. This is an automated check - no AI was used to generate this comment. |
|
@OpenHands fix the failing tests |
|
I'm on it! jpelletier1 can track my progress at all-hands.dev |
|
The PR has been updated and all checks are now green:
What I did:
The |
Why
The catalog already covers ticket-to-PR automations for GitHub, Jira, Linear, and Bitbucket, but a native GitLab issue-to-MR path was missing. GitLab-hosted projects could not queue implementations from labelled issues without a separate Jira or Linear ticketing system. This PR ports the proven
github-issue-to-prautomation to GitLab, closing that parity gap.Summary
Add a new
gitlab-issue-to-mr/manifest.jsoncatalog manifest with agitlabprovider, amerge_request_modeform field,,and a bundle config referencing the shipped script.Add a complete
gitlab-issue-to-mr/main.pyautomation script adapted for the GitLab API:PRIVATE-TOKENauth, configurableGITLAB_API_URLfor self-hosted instances, URL-encodedgroup/projectpaths (nested subgroups-supported), scoped issueiid,resource_label_eventsfiltering onaction=="add",notesfor comments,,/repository/brancheschecks, and/merge_requestscreation with aDraft:title prefix; existing MRs are looked up bysource_branch.Preserve all architectural patterns from the GitHub version: per-repo polling with KV-state, dedup on label event ID,,credential-free clone,,least-privilege secret forwarding,,AI disclosure on public comments,,and stalled-claim recovery/finalization retries.
Issue Number
Closes #443
How to Test
uv run --group test pytest tests/ -q- currently785 passed, 14 skippedlocally.python3 -m py_compile gitlab-issue-to-mr/main.py.npm run build:automations.This pull request was opened by an AI agent (OpenHands).