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

Restore support for Java 8 #767

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Restore support for Java 8 #767

merged 2 commits into from
Dec 20, 2023

Conversation

reta
Copy link
Collaborator

@reta reta commented Dec 12, 2023

Description

Restore support for Java 8

Issues Resolved

Closes #156

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dblock
Copy link
Member

dblock commented Dec 12, 2023

YES! Let's add CI.

@reta
Copy link
Collaborator Author

reta commented Dec 12, 2023

YES! Let's add CI.

Thanks @dblock ! Working on it :)

@reta reta force-pushed the issue-156 branch 6 times, most recently from 75061d1 to 642afb6 Compare December 12, 2023 20:06
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@reta
Copy link
Collaborator Author

reta commented Dec 12, 2023

@dblock @VachaShah ended up with the following change:

  • the opensearch-java baseline is back to 1.8 (since RestClient is also back to 1.8)
  • the integration tests heavily rely on OpenSearch core test framework (it could not be switched to JDK 8), so these tests need JDK-11 baseline, the solution here (one of) is to split tests into src/test/java and src/test/java11
  • the Gradle build uses grgit-gradle 5.x that also needs JDK-11 baseline so we cannot build with JDK 8 sadly (it explains why GA/CI has no JDK 8 in matrix)

@dblock
Copy link
Member

dblock commented Dec 13, 2023

  • the Gradle build uses grgit-gradle 5.x that also needs JDK-11 baseline so we cannot build with JDK 8 sadly (it explains why GA/CI has no JDK 8 in matrix)

I think this should be a blocker. Can we downgrade? We need at least some CI on JDK8, anything even a basic integration test would be enough.

dblock
dblock previously approved these changes Dec 13, 2023
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

I would be ok we merge it with an issue on re-adding JDK8 to CI, unless it's doable with the downgrade of the dependent library.

@reta
Copy link
Collaborator Author

reta commented Dec 13, 2023

I think this should be a blocker. Can we downgrade? We need at least some CI on JDK8, anything even a basic integration test would be enough.

We could downgrade but to unsupported version (which is not good), alliteratively we could try to use other way to get the git details needed, I will look further

@dblock
Copy link
Member

dblock commented Dec 18, 2023

@VachaShah or @Bukhtawar ?

VachaShah
VachaShah previously approved these changes Dec 18, 2023
Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

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

I am fine with merging this, thank you @reta for adding this! A few TODOs:

  1. We can add the restored support details to the client documentation. For example, here https://github.com/opensearch-project/opensearch-java/blob/main/DEVELOPER_GUIDE.md.
  2. As @dblock mentioned, CI with JDK-8.

@reta
Copy link
Collaborator Author

reta commented Dec 18, 2023

As @dblock mentioned, CI with JDK-8.

Was trying to pull it off, but there are 3 blockers (previously I thought there is only 1 but it turns out Gradle reports issues one at a time):

  1. grgit-gradle - this one could be rewritten
  2. spotless - we need at least 6.23.x for JDK-21 but it seems like 6.11.x was the last one that supported JDK-8
  3. OpenSearch build tools (OpenSearch Gradle plugins) - needs JDK-11

So I am not sure what could we do here besides enforcing the target / source level

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@reta reta dismissed stale reviews from VachaShah and dblock via bd0f87f December 18, 2023 20:42
@reta
Copy link
Collaborator Author

reta commented Dec 18, 2023

  1. . For example, here https://github.com/opensearch-project/opensearch-java/blob/main/DEVELOPER_GUIDE.md.

Thanks @VachaShah, we have this documented in the COMPATIBILITY.md, so updated the versions there

@dblock
Copy link
Member

dblock commented Dec 18, 2023

So I am not sure what could we do here besides enforcing the target / source level

Open a GitHub issue?

@reta
Copy link
Collaborator Author

reta commented Dec 18, 2023

Open a GitHub issue?

For grgit and spotless decisions to move baselines to JDK-11 were deliberate (I could link the related issues if you are curious), so I don't think we should be opening an issue here. For OpenSearch build tools we probably could try to go with JDK 8 baseline but that would not solve the problem at large

@dblock dblock merged commit ff5e0a2 into opensearch-project:main Dec 20, 2023
45 checks passed
@dblock dblock added the backport 2.x Backport to 2.x branch label Dec 20, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-767-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ff5e0a2d5f04acb4c11c3217b6e8fc71161a2a4b
# Push it to GitHub
git push --set-upstream origin backport/backport-767-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-767-to-2.x.

@dblock
Copy link
Member

dblock commented Dec 20, 2023

Ok, I merged this, will need a manual backport - let's try to release a version that restored JDK8 support?

reta added a commit to reta/opensearch-java that referenced this pull request Dec 20, 2023
* Restore support for Java 8

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Address code review comments (update compatibility)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

---------

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit ff5e0a2)
dblock pushed a commit that referenced this pull request Jan 2, 2024
* Restore support for Java 8 (#767)

* Restore support for Java 8

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Address code review comments (update compatibility)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

---------

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit ff5e0a2)

* Update build.gradle.kts to use OpenSearch 2.12.0-SNAPSHOT

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

---------

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock added a commit that referenced this pull request Jan 3, 2024
reta added a commit to reta/opensearch-java that referenced this pull request Jan 3, 2024
…ct#767) (opensearch-project#777)"

This reverts commit 081a17e.

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/opensearch-java that referenced this pull request Jan 3, 2024
…ct#767) (opensearch-project#777)"

This reverts commit 081a17e.

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Jan 3, 2024
)

This reverts commit 081a17e.

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/opensearch-java that referenced this pull request Jan 8, 2024
…ct#767) (opensearch-project#777)"

This reverts commit 081a17e.

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@BrendonFaleiro BrendonFaleiro mentioned this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PROPOSAL] Restore support for Java 8
3 participants