Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events API - targetType returning 'Null' (Confirmed BUG) #1148

Open
heat23 opened this issue Aug 8, 2024 · 4 comments
Open

Events API - targetType returning 'Null' (Confirmed BUG) #1148

heat23 opened this issue Aug 8, 2024 · 4 comments

Comments

@heat23
Copy link

heat23 commented Aug 8, 2024

When using the Events API like this:

List<Event> events = api.getEventsApi() .getUserEventsStream(user, null, null, new Date(), after, null) .collect(Collectors.toList());

For the results where actionName = accepted, targetType is coming back as NULL. I would expect the value to be MergeRequest. Any ideas?

@jmini jmini added the question label Aug 12, 2024
@jmini
Copy link
Collaborator

jmini commented Aug 12, 2024

How does it looks like in the JSON?

You can log the HTTP traffic. See: #1109 (comment)

@heat23
Copy link
Author

heat23 commented Aug 13, 2024

@jmini Thanks for your response. I tried Level.INFO but only got the request URL - It didn't dump the response. I tried Level.ALL and I got NO log messages.

api = new GitLabApi("https://mygitlabinstance", db.getApiKey()) .withRequestResponseLogging(Level.ALL);

Any idea why it isn't logging the raw response?

@heat23
Copy link
Author

heat23 commented Aug 13, 2024

@jmini I tried this using curl and confirmed that the API does indeed return a non-null target_type:

From curl
"id": 2864260, "project_id": 6637, "action_name": "accepted", "target_id": 245740, "target_iid": 724, "target_type": "MergeRequest", "author_id": 473,

from gitlab4j (both 5.1, 5.6, and 6.0-rc5)
"id" : 2864260, "projectId" : 6637, "actionName" : "accepted", "targetId" : 245740, "targetIid" : 724, "targetType" : null,

What can be done to resolve this BUG in version 5.x?

@heat23 heat23 changed the title Events API - targetType returning 'Null' Events API - targetType returning 'Null' (Confirmed BUG) Aug 13, 2024
@jmini
Copy link
Collaborator

jmini commented Sep 18, 2024

The specification says the value should be merge_request https://docs.gitlab.com/ee/api/events.html#target-types but your curl command indicated you got MergeRequest 🤯

jmini added a commit to jmini/gitlab4j-api that referenced this issue Sep 19, 2024
@jmini jmini removed the question label Sep 19, 2024
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

No branches or pull requests

2 participants