gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

Bugfix/merge request event object attributes

Open katrinSaleschus opened this issue 5 months ago • 4 comments

This is my contribution to finish the great work of @bdgould in Object Attributes #1198

katrinSaleschus avatar Sep 02 '25 08:09 katrinSaleschus

The dates gave me a bit of a headache. As documented in the following issues, they come from GitLab in various formats. I hope you find my solution acceptable. Synchronize date time format across api Webhook test events have different time formats than actual events Inconsistent date time formats across the API and webhooks

katrinSaleschus avatar Sep 03 '25 13:09 katrinSaleschus

I need to figure out your change and understand it.

I am surprised by the change of the tests and the dates. I understand the GitLab is not consistent but those example json files are supposed to represent "real" JSON responses sent by GitLab. If you modify those, how are we making sure that this client continues to parse those JSON responses correctly?

jmini avatar Sep 10 '25 04:09 jmini

I changed the test data because it didn't match what I received from GitLab. And you mentioned here that this could be the case. Since the data from GitLab is inconsistent anyway, I didn't undo the change. But if you want me to, I'm happy to do so. Perhaps it would also make sense to only partially undo the change, as this would best reflect reality.

katrinSaleschus avatar Sep 10 '25 06:09 katrinSaleschus

I would say the main change to what @bdgould did are the custom Deserializer to make sure the library can handle multiple date formats.

katrinSaleschus avatar Sep 10 '25 06:09 katrinSaleschus