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

Make the rest of the modules forward compatible with Java 17 #199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

teamurko
Copy link
Collaborator

Summary

The following changes were made:

  1. upgrade libraries and pick consistent versions
  2. add jvm flags to allow forbidden export and opening private methods, this is currently enabled for tests, similar flags will need to be added when running OH services/apps as long as the dependencies use deprecated APIs

The changes are expected to be non-consequential since the target bytecode is Java 8.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests
  • Upgrade

For all the boxes checked, please include additional details of the changes made in this pull request.

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

For all the boxes checked, include additional details of the changes made in this pull request.

Copy link
Collaborator

@autumnust autumnust left a comment

Choose a reason for hiding this comment

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

nothing major, lgtm overall

@@ -68,8 +68,13 @@ dependencies {
implementation 'com.fasterxml.woodstox:woodstox-core:6.2.7'

// open telemetry related classed. Latest Okhttp version is 4.10.0, pinning to 4.9.3 to avoid dependency issues
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall we move this comment to where ok_http3_version is defined

@@ -7,7 +7,7 @@ ext {
jakarta_annotation_version = "1.3.5"
reactor_version = "3.4.3"
jodatime_version = "2.9.9"
junit_version = "4.13.1"
junit_version = "5.11.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall we move this to top of build.gradle ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, it's in the parent file already, will remove this duplicate

@@ -71,6 +71,7 @@ shadowJar {
// e.g. java.lang.NoClassDefFoundError: openhouse/relocated/com/google/protobuf/GeneratedMessageV3
// when users use fixtures library in their tests
exclude 'com.google.protobuf.**'
exclude 'com.google.gson.**'
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤞 hope this is safe

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it was the latest change i had to make, the reason is relocation rules didn't result in the same behavior between Java versions and I couldn't make imports work on both, but there is an option to just drop Java 8 compile support so we don't bother to with it, potentially if this is a problem we can drop Java 8

implementation 'com.squareup.okio:okio:3.2.0'
implementation 'com.squareup.okio:okio-jvm:3.2.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.20'
Copy link
Member

Choose a reason for hiding this comment

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

Is there a specific dependency on kotlin lib?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's pulled com.square.up, I'm pinning it here to a specific version

implementation 'com.squareup.okio:okio:3.2.0'
implementation 'com.squareup.okio:okio-jvm:3.2.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.20'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.20'
Copy link
Collaborator

Choose a reason for hiding this comment

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

have we checked newly added libraries are ELR friendly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these dependencies are pulled transitively, i'm pinning the version

@@ -142,3 +147,12 @@ shadowJar {
// By default shadow doesn't configure the build task to depend on the shadowJar task.
tasks.build.dependsOn tasks.shadowJar

test {
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
Copy link
Member

Choose a reason for hiding this comment

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

For my understanding, what are the usage of these args?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

at build time, if the java version is 9 or later we add these flag, these flags were introduced in java 9 when reflection API to change visibility of methods was removed

@abhisheknath2011
Copy link
Member

abhisheknath2011 commented Sep 18, 2024

Summary

The following changes were made:

  1. upgrade libraries and pick consistent versions
  2. add jvm flags to allow forbidden export and opening private methods, this is currently enabled for tests, similar flags will need to be added when running OH services/apps as long as the dependencies use deprecated APIs

The changes are expected to be non-consequential since the target bytecode is Java 8.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests
  • Upgrade

For all the boxes checked, please include additional details of the changes made in this pull request.

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

For all the boxes checked, include additional details of the changes made in this pull request.

Can we update the testing done section docker testing for java 17 upgrade?

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