Skip to content

Fix KeyError when GitLab event data lacks target_id#468

Open
BeeGrech wants to merge 1 commit into
psss:mainfrom
BeeGrech:issues
Open

Fix KeyError when GitLab event data lacks target_id#468
BeeGrech wants to merge 1 commit into
psss:mainfrom
BeeGrech:issues

Conversation

@BeeGrech
Copy link
Copy Markdown
Contributor

Problem

Using --full-message with a GitLab config crashes with:

KeyError: 'target_id'

at Issue.body and MergeRequest.body.

Fix

Use .get('target_id') in Issue.iid(), Issue.body,
MergeRequest.__init__, and MergeRequest.body so that events or
objects missing target_id degrade gracefully instead of raising.

Add unit tests covering Issue, MergeRequest, and MergedRequest
with missing target_id and --full-message enabled.

Use .get('target_id') in Issue.iid(), Issue.body,
MergeRequest.__init__, and MergeRequest.body so that events or
objects missing target_id degrade gracefully instead of raising.

Add unit tests covering Issue, MergeRequest, and MergedRequest
with missing target_id and full_message enabled.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Brian Grech <bgrech@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant