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 the target scala version to 2.13 for mbknor-jackson-jsonschema and kafka #310

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

junyuc25
Copy link

@junyuc25 junyuc25 commented Nov 14, 2023

Issue #, if available:

Description of changes:
Updating the following libraries to use the version compiled with Scala 2.13.

  1. mbknor-jackson-jsonschema_2.12
  2. kafka_2.12

Motivation:
There is ongoing work to upgrade AWS SDK to V2 for the Apache Spark as tracked in this Jira. When upgrading the Spark Kinesis connector module (which transitively depends on glue-schema-registry), the GSR library also pulls in mbknor-jackson-jsonschema_2.12. However, as Apache Spark 4.0 release will drop support for scala 2.12 (Jira ticket), this lib is considered as banned dependency, resulting in build failures. We would need to replace dependencies that are compiled with scala 2.12 within the GSR repository to proceed with the SDK upgrade. Hence this PR.

Example build failure information:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.3.0:enforce (enforce-versions) on project spark-streaming-kinesis-asl_2.13:
[ERROR] Rule 2: org.apache.maven.enforcer.rules.dependency.BannedDependencies failed with message:
[ERROR] org.apache.spark:spark-streaming-kinesis-asl_2.13:jar:4.0.0-SNAPSHOT
[ERROR]   software.amazon.kinesis:amazon-kinesis-client:jar:2.5.2
[ERROR]     software.amazon.glue:schema-registry-serde:jar:1.1.14
[ERROR]       com.kjetland:mbknor-jackson-jsonschema_2.12:jar:1.0.39 <--- banned via the exclude/include list

Testing:

  1. The unit tests passed with mvn clean package
  2. Ran integration tests locally using run-local-tests.sh. Although there are 3 test failures, these failures are also observed when running against master branch. Hence they should not be caused by this PR.
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   GlueSchemaRegistryKafkaIntegrationTest.testKafkaStreamsProcess:397->assertStreamsRecordsEquality:483 
Expected: is <0>
     but: was <6>
[ERROR]   GlueSchemaRegistryKafkaIntegrationTest.testKafkaStreamsProcess:397->assertStreamsRecordsEquality:483 
Expected: is <0>
     but: was <2>
[ERROR]   GlueSchemaRegistryKinesisIntegrationTest.testProduceConsumeWithKPLAndKCL:345->assertKinesisRecords:550 array contents differ at index [0], expected: <{"name": "Sansa", "favorite_number": 99, "favorite_color": "white"}> but was: <{"name": "Hermione", "favorite_number": 1, "favorite_color": "red"}>
[INFO] 
[ERROR] Tests run: 72, Failures: 3, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  22:16 min
[INFO] Finished at: 2023-12-04T09:59:18Z
[INFO] ------------------------------------------------------------------------

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@junyuc25 junyuc25 marked this pull request as ready for review November 15, 2023 02:15
@blacktooth
Copy link
Contributor

Can you please run the integration tests as well?

@er1c
Copy link

er1c commented Dec 1, 2023

Does this actually publish something as a 2.13, and wouldn't you want to publish to both a 2.12 and a 2.13?

@blacktooth
Copy link
Contributor

Please add the motivation for this PR.

@junyuc25
Copy link
Author

junyuc25 commented Dec 4, 2023

Can you please run the integration tests as well?

Sure. Added the testing notes to the PR description. @blacktooth

@junyuc25
Copy link
Author

junyuc25 commented Dec 4, 2023

Please add the motivation for this PR.

Updated the PR descriptions.

@junyuc25
Copy link
Author

junyuc25 commented Dec 4, 2023

Does this actually publish something as a 2.13, and wouldn't you want to publish to both a 2.12 and a 2.13?

No. The glue-schema-registry currently has dependency on libraries that are compiled with Scala 2.12. This PR attempts to replace those libraries with ones that are compiled with 2.13 instead.

Copy link
Contributor

@YangSan0622 YangSan0622 left a comment

Choose a reason for hiding this comment

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

The integration test failure was something existed for a while, those failure disappear if we run those tests by itself. I think it is safe to merge the change.

@YangSan0622 YangSan0622 merged commit d74f2fa into awslabs:master Dec 13, 2023
9 checks passed
@er1c
Copy link

er1c commented Dec 14, 2023

I'm still a bit concerned this will break bin-compat with my scala 2.12 app. Is there a test artifact?

@blacktooth
Copy link
Contributor

blacktooth commented Dec 14, 2023

I'm still a bit concerned this will break bin-compat with my scala 2.12 app. Is there a test artifact?

Yes, this can potentially break existing builds. @junyuc25 The preferable solution is to push a separate artifact for 2.13.

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.

5 participants