HDDS-16084. Add ErrorProne to Ozone CI - #11056
Open
ivandika3 wants to merge 10 commits into
Open
Conversation
ivandika3
marked this pull request as ready for review
August 19, 2026 16:06
rich7420
reviewed
Aug 20, 2026
| omKeyLocationInfoGroup.getLocationList() | ||
| .stream().map(omKeyLocationInfo -> pipelines.add( | ||
| omKeyLocationInfo.getPipeline()))); | ||
| omKeyInfo.getKeyLocationVersions().forEach(omKeyLocationInfoGroup -> |
Contributor
There was a problem hiding this comment.
Not a test-lint fix — getPipelines() returned empty before (the old stream().map(...add...) was never consumed), so this actually changes what Recon reports. Please add a test for a non-empty pipeline list and call the behavior fix out in the description instead of under "Fix tests".
| if (resp.getStatus() != OK) { | ||
| throw new OMException(resp.getMessage(), | ||
| ResultCodes.values()[resp.getStatus().ordinal()]); | ||
| ResultCodes.valueOf(resp.getStatus().name())); |
Contributor
There was a problem hiding this comment.
valueOf(name()) is the right pattern, but this changes error-code translation for any status where the Status and ResultCodes ordinals differ. Is this an intended behavior fix? If so, a small test (a status past the first divergence) + a note in the description would help.
Contributor
|
@ivandika3 thanks for the patch! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
ErrorProne is a well-known static analysis tool used in other ASF projects such as Celeborn, Druid, HBase, Solr, Beam, etc used to catch common Java coding errors. It is pretty lightweight compared to fbinfer (HDDS-15560).
This patch adds ErrorProne to the Ozone CI that fails if there are any ERROR bug patterns found (https://errorprone.info/bugpatterns), where as WARNING are included in the summary.txt but does not fail the CI.
This patch also fixes all the ERROR bug patterns found in the current Ozone codebase. The fixes are split into multiple commits. I have attached errorprone-error-fixes.md for the bug patterns and the possible risks. This seems to catch some real bugs such as in
CompactionDagandReconContainerMetadataManagerImplas well as noop assertions.Note that the WARNING issues are currently not fixed and we can raise follow up tasks to handle these. Additionally, we currently do not have any ErrorProne
ThreadSafeannotation. We can add this in the future to catch thread safety violation. ThisThreadSafeannotation can hopefully work in conjunction with fbinfer HDDS-15560.Note for reviewer:
ProtobufBufferOrdinalrule (https://errorprone.info/bugpattern/ProtocolBufferOrdinal), but seems currently theResultCodes.valueOf(protoStatus.name())should be safe.Generated by: GPT 5.6 Sol
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16084
How was this patch tested?
CI (Clean CI: https://github.com/ivandika3/ozone/actions/runs/32216855338).