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

Update Jackson to version 2.13 #12961

Closed
wants to merge 16 commits into from
Closed

Update Jackson to version 2.13 #12961

wants to merge 16 commits into from

Conversation

patrickmann
Copy link
Contributor

@patrickmann patrickmann commented Jun 28, 2022

We want to upgrade to a recent Jackson version, while initially keeping everything else unchanged (as much as possible).
https://github.com/Graylog2/graylog-plugin-enterprise/issues/3674

Notes: Requires a fork of MongoJack 2.10.1 with minimal changes to work with Jackson 2.13.3: https://github.com/graylog-labs/mongojack

Details

  • If configuration of ObjectMapper is modified after first usage, changes may or may not take effect, and configuration calls themselves may fail [link]. This behavior appears to have changed since version 2.9. It only affects a few tests which attempt to modify the mapper:
    graylog2-server/src/test/java/org/graylog/events/contentpack/facade/EventDefinitionFacadeTest.java
    graylog2-server/src/test/java/org/graylog/events/contentpack/facade/NotificationFacadeTest.java

  • DateTimeFormatter now throws an exception for empty string, resulting in a JSON missing node that needs to be handled:
    graylog2-server/src/main/java/org/graylog/plugins/beats/Beats2Codec.java

  • Jackson 2.11 changed the default DateTime formatting for timezone offset to hh:mm instead of hhmm [link]. We need to explicitly set the legacy format in the ObjectMapper.
    graylog2-server/src/main/java/org/graylog2/shared/bindings/providers/ObjectMapperProvider.java
    graylog2-server/src/test/java/org/graylog/plugins/views/migrations/V20200204122000_MigrateUntypedViewsToDashboardsTest.java
    _graylog2-server/src/test/java/org/graylog2/jackson/MongoJodaDateTimeSerializerTest.java
    graylog2-server/src/test/java/org/graylog2/jackson/MongoZonedDateTimeSerializerTest.java

  • The new Mongo driver version has a slightly different error message for key collisions. This requires a change to a test:
    graylog2-server/src/test/java/org/graylog2/migrations/V2018070614390000_EnforceUniqueGrokPatternsTest.java

  • Jackson no longer includes Joda date/time by default. The Joda module needs to be explicitly registered:
    graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java

/jenkins-pr-deps https://github.com/Graylog2/graylog-plugin-enterprise/pull/3766

@patrickmann patrickmann marked this pull request as draft June 28, 2022 14:24
@patrickmann patrickmann requested a review from mpfz0r July 20, 2022 16:05
@bernd bernd changed the title Modifications to upgrade to Jackson 2.13.3 Update Jackson to version 2.13 Jul 21, 2022
@@ -169,8 +169,7 @@
<dependency>
<!-- Workaround for https://github.com/FasterXML/jackson-bom/pull/38 -->
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_2.13</artifactId>
<version>2.9.10</version>
<artifactId>jackson-module-scala_3</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, we haven't updated to scala 3 yet.
This workaround was only needed for jackson 2.9
I think it can be removed entirely

@patrickmann
Copy link
Contributor Author

Postponed to 5.0, when we expect to drop ES6.

@patrickmann
Copy link
Contributor Author

This was just a test branch, which we no longer need.

@patrickmann patrickmann deleted the test/jackson-2.13.2 branch September 27, 2022 15:50
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.

3 participants