Skip to content

Comments

Update to Java 21#119

Open
OwenCorrigan76 wants to merge 7 commits intostrimzi:mainfrom
OwenCorrigan76:Update_Java_21
Open

Update to Java 21#119
OwenCorrigan76 wants to merge 7 commits intostrimzi:mainfrom
OwenCorrigan76:Update_Java_21

Conversation

@OwenCorrigan76
Copy link
Contributor

This PR moves the Strimzi Kafka Access Operator repo to Java 21.

@OwenCorrigan76 OwenCorrigan76 added this to the 0.3.0 milestone Feb 9, 2026
@OwenCorrigan76 OwenCorrigan76 force-pushed the Update_Java_21 branch 2 times, most recently from 20274e9 to 54276dd Compare February 9, 2026 16:21
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

Just some quick notes. Thanks for looking into it.

kind: Namespace
metadata:
name: strimzi-access-operator
name: myproject
Copy link
Member

Choose a reason for hiding this comment

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

These changes should not be here?

Copy link
Contributor Author

@OwenCorrigan76 OwenCorrigan76 Feb 13, 2026

Choose a reason for hiding this comment

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

Thanks for the review. Careless mistake. Fixed

Comment on lines 105 to 109
<!-- Javadoc -->
<module name="JavadocStyle">
<property name="checkEmptyJavadoc" value="true"/>
<property name="checkFirstSentence" value="false"/>
</module>
Copy link
Member

Choose a reason for hiding this comment

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

It makes sense to move Javadoc validation to Checkstyle. But you should likely mirror the rules from other repos. See for example here: https://github.com/strimzi/strimzi-kafka-bridge/pull/1067/changes

Assuming there are more changes it needs in the code, opening a separate PR might make sense (it is not dependent on Java 21 anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted this. I will work on this in a new PR as suggested. Thanks

api/pom.xml Outdated
Comment on lines 16 to 17
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to mirror this in all modules? Why isn't that only in the main pom.xml? The same for javadoc.fail.on.warnings now, when it is disabled everywhere? (assuming it is still needed at all)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed from all but main pom.

Dockerfile Outdated

# Set JAVA_HOME env var
ENV JAVA_HOME=/usr/lib/jvm/jre-17
ENV JAVA_HOME=/usr/lib/jvm/jre-21
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ENV JAVA_HOME=/usr/lib/jvm/jre-21
ENV JAVA_HOME=/usr/lib/jvm/jre-${JAVA_VERSION}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

@im-konge im-konge left a comment

Choose a reason for hiding this comment

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

One comment + I agree with the Jakub's comments there. Thanks for looking on this :)

Copy link
Member

@im-konge im-konge left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

So, you disabled the Javadoc validation from the JDK. But you do not seem to replace it with the Checkstyle Javadoc validation as we do it in other projects. I think that is something that needs to be done here or in a separate PR before this one (whichever you prefer). But I do not think we should just drop the validation now and say that we fix it some time later.

Comment on lines 198 to 199
example, to build docker images that have the Java 21 JRE installed use `JAVA_VERSION=21 make docker_build`. If not
present, the container images will use Java **21** by default.
Copy link
Member

Choose a reason for hiding this comment

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

Same as above - does this really make sense given we support Java 21 only?

it to the desired Java version. For example, for building with Java 21 you can use `export JAVA_VERSION_BUILD=21`.

> *Note*: Operator currently developed and tested with Java 17.
> *Note*: Operator currently developed and tested with Java 21.
Copy link
Member

Choose a reason for hiding this comment

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

I know you did not added this section. But given we basically support Java 21 only - what point does it have?

@ppatierno
Copy link
Member

ppatierno commented Feb 15, 2026

@OwenCorrigan76 regarding what Jakub mentioned, so replacing the Javadoc validation with the Checkstyle one, you could get some inspiration from what was done on the bridge here strimzi/strimzi-kafka-bridge#1067 (using the bridge as example because it's a project which is size-wise similar to kafka access operator). Let me know if you need any advice/help/insights to better understand what's needed.

@OwenCorrigan76
Copy link
Contributor Author

Thanks a mil for the comments guys. Will address today.

ocorriga added 3 commits February 17, 2026 09:46
Signed-off-by: ocorriga <ocorriga@redhat.com>
Signed-off-by: ocorriga <ocorriga@redhat.com>
Signed-off-by: ocorriga <ocorriga@redhat.com>
Signed-off-by: ocorriga <ocorriga@redhat.com>
@scholzj
Copy link
Member

scholzj commented Feb 17, 2026

@OwenCorrigan76 The point of the Javadoc changes is that we do want to have the Javadoc changes validated. So you should not be disabling it without having the replacement first. So you can:

  • First do the PR to move the validation of the Javadocs to Checkstyle and disable the failure on Javadoc warnings. I would say that you should have failure on errors ever disabled.
  • Do all of it in a single PR
  • Fix the Javadoc to not have errors and warnings in Java 21, but I think that is pretty hard. So the previous 2 options are the better ones.

Signed-off-by: ocorriga <ocorriga@redhat.com>
@OwenCorrigan76
Copy link
Contributor Author

Thanks @scholzj. I think this should now be ok?? I've added a suppression for Systemtests and unit tests as is done in other repos. Is that ok?

There is some other failure on the build around make: *** [Makefile.docker:27: docker_build] Error 1 that I must investigate now.

Comment on lines 17 to 18
<suppress checks=".*"
files="systemtest[/\\].*\.java"/>
Copy link
Member

Choose a reason for hiding this comment

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

This is not a good thing IMO.
By this, you will completely disable all the checks - including * imports, unused imports etc.
Did you saw this in some other repo? We have these checks for STs disabled only for the generated classes, as we are not able to do anything with them (this is for the operators repo).

@im-konge im-konge self-requested a review February 17, 2026 18:20
@scholzj
Copy link
Member

scholzj commented Feb 17, 2026

Thanks @scholzj. I think this should now be ok?? I've added a suppression for Systemtests and unit tests as is done in other repos. Is that ok?

I think it is definitely fine to have a supression for tests and system tests. But as mentioned by Lukas, It should be minimized. So probably Javadocs only. And f it needs something more than just the Javadocs, please share what it complains about and we can have a look. In general, we should aim to remove these suppressions. But we can leave the STs Javadocs for later. You can check the Operators suppressions to see what we suppress there: https://github.com/strimzi/strimzi-kafka-operator/blob/main/.checkstyle/suppressions.xml

There is some other failure on the build around make: *** [Makefile.docker:27: docker_build] Error 1 that I must investigate now.

It seems that there was some Red Hat RPM repo outage. Restarting the build seemed to have worked.

Signed-off-by: ocorriga <ocorriga@redhat.com>
@OwenCorrigan76
Copy link
Contributor Author

@scholzj @im-konge I have removed the supress all systemtests and just supressed checkstyle checks from Javadocs.

<suppress checks=".*"
files="io[/\\]strimzi[/\\]kafka[/\\]access[/\\]model[/\\].*(Builder|Fluent|FluentImpl)\.java"/>
<suppress checks="JavadocMethod|JavadocType|JavadocVariable|MissingJavadocType|MissingJavadocMethod"
files="(systemtest|src[/\\]test[/\\]java)[/\\].*\.java"/>
Copy link
Member

@im-konge im-konge Feb 19, 2026

Choose a reason for hiding this comment

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

Suggested change
files="(systemtest|src[/\\]test[/\\]java)[/\\].*\.java"/>
files="systemtest[/\\]src[/\\]test[/\\]java)[/\\].*\.java"/>

I think it should be like this? Or is | there on purpose?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Or if you are trying to suppress it for both STs and for regular tests, I think it should be done separately. Because this is a bit confusing for me.

Signed-off-by: ocorriga <ocorriga@redhat.com>
Copy link
Member

@im-konge im-konge left a comment

Choose a reason for hiding this comment

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

I think this will work fine, LGTM.

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