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

Ensure that warnings as errors are enabled for CI checks on main #9150

Open
cwperks opened this issue Aug 7, 2023 · 5 comments
Open

Ensure that warnings as errors are enabled for CI checks on main #9150

cwperks opened this issue Aug 7, 2023 · 5 comments
Assignees
Labels
bug Something isn't working Build Libraries & Interfaces Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. CI CI related good first issue Good for newcomers

Comments

@cwperks
Copy link
Member

cwperks commented Aug 7, 2023

Following the merge of #9120, publication of maven snapshots started failing due to a compilation warning. On the backport of that change to 2.x, the @SuppressWarnings("unchecked") annotation was added to the method with the compilation warning to ensure that the backport PR passed CI checks.

It looks like there may be a difference between how CI checks are performed on main vs 2.x since it was required to add the annotation in 2.x, but not on main. I'm filing an issue to investigate why there is a difference in the checks between the 2 branches and ensure that these checks are running on the main branch as well as 2.x.

Issue discussed in PR to resolve the maven snapshot publication here: #9149

@cwperks cwperks added bug Something isn't working untriaged labels Aug 7, 2023
@cwperks cwperks changed the title Ensure that warnings as errors on enabled for the build on main Ensure that warnings as errors are enabled for the build on main Aug 7, 2023
@cwperks cwperks changed the title Ensure that warnings as errors are enabled for the build on main Ensure that warnings as errors are enabled for CI checks on main Aug 7, 2023
@cwperks
Copy link
Member Author

cwperks commented Aug 7, 2023

I've noticed that when I build with JDK19 that it does not output compile warnings, but after switching to JDK17 it does.

@cwperks
Copy link
Member Author

cwperks commented Aug 7, 2023

The workflow that started failing with the compiler warning explicitly uses JDK 17: https://github.com/opensearch-project/OpenSearch/blob/main/.github/workflows/publish-maven-snapshots.yml

@cwperks
Copy link
Member Author

cwperks commented Aug 7, 2023

If core is not already running CI checks with multiple supported JDK versions then it could be beneficial to do so. I believe this error did not occur on main, but did on 2.x because the checks were run with different JDK versions.

@minalsha minalsha added good first issue Good for newcomers CI CI related and removed untriaged labels Aug 11, 2023
@cwperks
Copy link
Member Author

cwperks commented Aug 15, 2023

Run ./gradlew :libs:opensearch-core:compileJava from 70e1b2274bf6c1245063442882e561d4fb37742a using JDK 17 and you receive the warning.

Run it again with JDK 19 and you no longer receive the warning.

@afrodidact
Copy link

I want to take this as a good first issue for my osci-2023 contribution.

@bbarani bbarani added the Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Build Libraries & Interfaces Build Build Tasks/Gradle Plugin, groovy scripts, build tools, Javadoc enforcement. CI CI related good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants