Skip to content

Use merge_requests API for created MRs in GitLab plugin - #480

Merged
psss merged 2 commits into
mainfrom
gitlab-mr-created
Oct 13, 2026
Merged

psss merged 2 commits into
mainfrom
gitlab-mr-created

Conversation

@lukaszachy

Copy link
Copy Markdown
Collaborator

The events API does not reliably return all merge requests. Switch to the global merge_requests endpoint filtered by author_username and date range for complete results.

@psss psss left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Looks good, only the --full-message use case seems to be broken:

  File "/home/psplicha/git/did/did/plugins/gitlab.py", line 361, in body
    self.data['project_id'], self.data['target_id'])
                             ~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'target_id'

Here's a simple fix and test suggested by Claude: 4aa1f72, looks good?

@psss psss changed the title Use merge_requests API for created MRs in GitLab plugin Use merge_requests API for created MRs in GitLab plugin Oct 12, 2026
lukaszachy and others added 2 commits October 13, 2026 09:31
The events API does not reliably return all merge requests.
Switch to the global merge_requests endpoint filtered by
author_username and date range for complete results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MergedRequest wraps data from the global merge_requests API, which
has no 'target_id' key. In full_message mode the inherited Issue.body
looked up 'target_id', raising KeyError. Populate the body directly
from the inline 'description' field instead, avoiding both the crash
and an unnecessary API call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@psss
psss force-pushed the gitlab-mr-created branch from 4aa1f72 to d869dc4 Compare October 13, 2026 07:31
@lukaszachy

Copy link
Copy Markdown
Collaborator Author

@psss thanks for the full-message fixup.

@psss
psss merged commit 9b433d6 into main Oct 13, 2026
17 checks passed
@psss
psss deleted the gitlab-mr-created branch October 13, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants