Skip to content

Conversation

@derkoe
Copy link
Contributor

@derkoe derkoe commented Aug 13, 2019

  • Dates with colon offset like "2018-03-12T10:16:46+07:00" threw a
    DateTimeParseException
  • Changing the order of the offset patterns fixes this

 - Dates with colon offset like "2018-03-12T10:16:46+07:00" threw a
   DateTimeParseException
 - Changing the order of the offset patterns fixes this
@gmessner
Copy link
Collaborator

gmessner commented Aug 14, 2019

@derkoe
I'm not seeing this exception in either unit or integration tests. Just wondering what API calls are you seeing the exception being thrown, or can you provide some sample code where the exception is thrown?

Also, what version of Java are you using?

@derkoe
Copy link
Contributor Author

derkoe commented Aug 14, 2019

@gmessner this is thrown in the Jenkins plugin on MR web hooks using your API (have to file a bug there as well). Seems to happen since our upgrade to GitLab 12.1.

Here's the part of the stacktrace:

java.time.format.DateTimeParseException: Text '2019-08-12T17:08:14+02:00' could not be parsed, unparsed text found at index 22
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1952)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
at java.time.OffsetDateTime.parse(OffsetDateTime.java:402)
at org.gitlab4j.api.utils.ISO8601.toInstant(ISO8601.java:155)
at org.gitlab4j.api.utils.ISO8601.toDate(ISO8601.java:169)
at org.gitlab4j.api.utils.JacksonJson$JsonDateDeserializer.deserialize(JacksonJson.java:281)
at org.gitlab4j.api.utils.JacksonJson$JsonDateDeserializer.deserialize(JacksonJson.java:275)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)

Oh we are using OpenJDK 8 (1.8.0_212-1) on Jenkins. The bug is reproducible with OpenJDK 11 (11.0.3)

@derkoe
Copy link
Contributor Author

derkoe commented Aug 14, 2019

Here's the Jenkins issue https://issues.jenkins-ci.org/browse/JENKINS-58919

@gmessner
Copy link
Collaborator

@derkoe
I asked for additional info because getting the date parsing correct is a bit touchy with GitLab, which is why the ISO8601 class is so thoroughly tested. Just don't want to break something trying to fix something else.

I will pull down your fix and run both the Unit and integration tests if all is OK will merge and do a release.

@derkoe
Copy link
Contributor Author

derkoe commented Aug 14, 2019

Thanks! I've just built a SNAPSHOT of gitlab4j and the Jenkins plugin and will deploy it to our Jenkins tonight. I'll give feedback if this worked.

@gmessner gmessner merged commit bbaa278 into gitlab4j:master Aug 14, 2019
@gmessner
Copy link
Collaborator

@derkoe
Release 4.12.1 is out with this fix.

Thanks for your contribution.

@derkoe
Copy link
Contributor Author

derkoe commented Aug 16, 2019

SNAPSHOT build of plugin works!

@gmessner-nb
Copy link

@derkoe
You can switch to 4.12.1 it has this fix in it, released it last night.

@jetersen
Copy link
Contributor

You want to say thanks for the swift turn around @gmessner-nb much appreciated!

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.

4 participants