Skip to content

feat: add gitlab issue-to-mr automation - #525

Open
jpelletier1 wants to merge 2 commits into
OpenHands:mainfrom
jpelletier1:add-gitlab-issue-to-mr-automation
Open

feat: add gitlab issue-to-mr automation#525
jpelletier1 wants to merge 2 commits into
OpenHands:mainfrom
jpelletier1:add-gitlab-issue-to-mr-automation

Conversation

@jpelletier1

@jpelletier1 jpelletier1 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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-pr automation to GitLab, closing that parity gap.

Summary

  • Add a new gitlab-issue-to-mr/manifest.json catalog manifest with a gitlab provider, a merge_request_mode form field,,and a bundle config referencing the shipped script.

  • Add a complete gitlab-issue-to-mr/main.py automation script adapted for the GitLab API: PRIVATE-TOKEN auth, configurable GITLAB_API_URL for self-hosted instances, URL-encoded group/project paths (nested subgroups-supported), scoped issue iid, resource_label_events filtering on action=="add", notes for comments,,/repository/branches checks, and /merge_requests creation with a Draft: title prefix; existing MRs are looked up by source_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

  • Run the unit test suite: uv run --group test pytest tests/ -q - currently 785 passed, 14 skipped locally.
  • Syntax-check the shipped script: python3 -m py_compile gitlab-issue-to-mr/main.py.
  • Verify the catalog schema still validates the manifest with npm run build:automations.

This pull request was opened by an AI agent (OpenHands).

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>
@all-hands-bot

Copy link
Copy Markdown
Contributor

👋 This PR needs a couple of things fixed before OpenHands can review it:

  • the PR description's HUMAN: section needs at least 20 characters describing what you tested, not just the template placeholder

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.

@jpelletier1

Copy link
Copy Markdown
Contributor Author

@OpenHands fix the failing tests

@openhands-ai

openhands-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

I'm on it! jpelletier1 can track my progress at all-hands.dev

@jpelletier1 jpelletier1 changed the title Add GitLab Issue-to-MR automation feat: add gitlab issue-to-mr automation Aug 31, 2026
@github-actions github-actions Bot added the type: feat A new feature label Aug 31, 2026
@openhands-ai

openhands-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

The PR has been updated and all checks are now green:

  • pr-title / Lint PR title (conventional) → ✅ success
  • pr-title / Apply conventional-type label → ✅ success (label type: feat applied)
  • Validate PR description → ✅ success
  • test → ✅ success (unchanged, already passing)
  • check, sync-extensions, validate-claude-code, sync-sdk-skill → ✅ success

What I did:

  1. Diagnosed the two failing checks from the CI logs:

    • pr-title / Lint PR title (conventional): PR title "Add GitLab Issue-to-MR automation" had no conventional-commit prefix (feat|fix|docs|...), so the action failed with "No release type found in pull request title".
    • Validate PR description: the check_pr_description.py script reported 3 errors — missing ## Why, missing ## How to Test, and no issue linked via ## Issue Number (or a closing keyword).
  2. Updated PR feat: add gitlab issue-to-mr automation #525 via the GitHub API:

    • Title: → feat: add gitlab issue-to-mr automation (valid conventional-commit feat: prefix)
    • Body: rewrote to include the repository's required template sections — ## Why, ## Summary, ## How to Test (with concrete commands I actually ran: uv run --group test pytest tests/ -q785 passed, 14 skipped; python3 -m py_compile ...), plus ## Issue NumberCloses #443 (the exact "Add GitLab issue → MR automation" issue, created 2026-08-03, before the ready-for-dev rollout cutoff — so it passes the readiness gate).
  3. Verified locally: Re-ran the same validator script against the updated body (0 section errors, 0 issue errors), and confirmed the title matches the conventional-commit regex used by the lint action.

The test unit-test job itself was already passing (785 passed — no code changes were needed). I intentionally did not move files or regenerate catalog indexes since those aren't part of the failing checks and would have been speculative structural changes beyond the requested fix; the automation's own tests (tests/test_automation_setup.py) still pass with the current layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitLab issue → MR automation (ticket→PR parity with Jira)

2 participants