Errorprone errors/warnings.

249 views
Skip to first unread message

Sven Selberg

unread,
Feb 27, 2024, 8:17:04 AM2/27/24
to Repo and Gerrit Discussion
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

If we don't want to ignore errors and we don't want to disable Errorprone partially or all together we should consider making no-Errorrone warnings a requirement for submit.

/Sven
stable-3.7-errorrone-warnings.txt

Matthias Sohn

unread,
Feb 27, 2024, 9:24:08 AM2/27/24
to Sven Selberg, Repo and Gerrit Discussion
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType
 
If we don't want to ignore errors and we don't want to disable Errorprone partially or all together we should consider making no-Errorrone warnings a requirement for submit.

/Sven

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/739a9bf3-7688-4bd8-884d-e3620044bee3n%40googlegroups.com.

Nasser Grainawi

unread,
Feb 27, 2024, 3:52:50 PM2/27/24
to Matthias Sohn, Sven Selberg, Repo and Gerrit Discussion
On Tue, Feb 27, 2024 at 6:24 AM Matthias Sohn <matthi...@gmail.com> wrote:
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType

Right, they do eventually get fixed. I think this is an unfortunate side effect of stable branches being created from master in between an ErrorProne issue being toggled as WARNING (so that issues are found and fixed) and before all the issues are fixed and it's set to ERROR.

Maybe we can try to align this better in the future when creating stable branches by coordinating changes to ErrorProne levels around upcoming release schedules. We could also try to ensure stable branches have no non-ERROR level settings before the .0 release (i.e. fix any warnings during the rc releases).
 
 
If we don't want to ignore errors and we don't want to disable Errorprone partially or all together we should consider making no-Errorrone warnings a requirement for submit.

/Sven

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/739a9bf3-7688-4bd8-884d-e3620044bee3n%40googlegroups.com.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Edwin Kempin

unread,
Feb 28, 2024, 3:28:41 AM2/28/24
to Nasser Grainawi, Matthias Sohn, Sven Selberg, Repo and Gerrit Discussion
On Tue, Feb 27, 2024 at 9:52 PM Nasser Grainawi <nasser....@linaro.org> wrote:


On Tue, Feb 27, 2024 at 6:24 AM Matthias Sohn <matthi...@gmail.com> wrote:
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType

Weird, PreferredInterfaceType hasn't been set to WARNING, but I set it directly to ERROR, after fixing all the issues:
 

Sven Selberg

unread,
Feb 28, 2024, 9:28:22 AM2/28/24
to Repo and Gerrit Discussion
On Wednesday, February 28, 2024 at 9:28:41 AM UTC+1 Edwin Kempin wrote:
On Tue, Feb 27, 2024 at 9:52 PM Nasser Grainawi <nasser....@linaro.org> wrote:


On Tue, Feb 27, 2024 at 6:24 AM Matthias Sohn <matthi...@gmail.com> wrote:
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType

So these are PreferredInterfaceType warnings are meant to be fixed?
I was starting to fix them on the active stable-branches but I just wanted to be sure that this would be accepted first.
 

Weird, PreferredInterfaceType hasn't been set to WARNING, but I set it directly to ERROR, after fixing all the issues:

All I know is that I get the output as attached to this post.
It seems to me like they are "warnings" that are logged as INFO but they are very verbose nonetheless.
Perhaps this can be ignored with some local Bazel configuration.

Matthias Sohn

unread,
Feb 28, 2024, 9:30:27 AM2/28/24
to Sven Selberg, Repo and Gerrit Discussion
On Wed, Feb 28, 2024 at 3:28 PM Sven Selberg <sven.s...@axis.com> wrote:


On Wednesday, February 28, 2024 at 9:28:41 AM UTC+1 Edwin Kempin wrote:
On Tue, Feb 27, 2024 at 9:52 PM Nasser Grainawi <nasser....@linaro.org> wrote:


On Tue, Feb 27, 2024 at 6:24 AM Matthias Sohn <matthi...@gmail.com> wrote:
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType

So these are PreferredInterfaceType warnings are meant to be fixed?
I was starting to fix them on the active stable-branches but I just wanted to be sure that this would be accepted first.
 

Weird, PreferredInterfaceType hasn't been set to WARNING, but I set it directly to ERROR, after fixing all the issues:

All I know is that I get the output as attached to this post.
It seems to me like they are "warnings" that are logged as INFO but they are very verbose nonetheless.
Perhaps this can be ignored with some local Bazel configuration.

AFAIK the errorprone configuration is in tools/BUILD
 

Edwin Kempin

unread,
Feb 28, 2024, 9:30:57 AM2/28/24
to Sven Selberg, Repo and Gerrit Discussion
On Wed, Feb 28, 2024 at 3:28 PM Sven Selberg <sven.s...@axis.com> wrote:


On Wednesday, February 28, 2024 at 9:28:41 AM UTC+1 Edwin Kempin wrote:
On Tue, Feb 27, 2024 at 9:52 PM Nasser Grainawi <nasser....@linaro.org> wrote:


On Tue, Feb 27, 2024 at 6:24 AM Matthias Sohn <matthi...@gmail.com> wrote:
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType

So these are PreferredInterfaceType warnings are meant to be fixed?
Yes, all PreferredInterfaceType have been fixed in master.
 

Nasser Grainawi

unread,
Feb 28, 2024, 11:19:02 AM2/28/24
to Edwin Kempin, Sven Selberg, Repo and Gerrit Discussion
On Wed, Feb 28, 2024 at 6:30 AM 'Edwin Kempin' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:


On Wed, Feb 28, 2024 at 3:28 PM Sven Selberg <sven.s...@axis.com> wrote:


On Wednesday, February 28, 2024 at 9:28:41 AM UTC+1 Edwin Kempin wrote:
On Tue, Feb 27, 2024 at 9:52 PM Nasser Grainawi <nasser....@linaro.org> wrote:


On Tue, Feb 27, 2024 at 6:24 AM Matthias Sohn <matthi...@gmail.com> wrote:
On Tue, Feb 27, 2024 at 2:17 PM Sven Selberg <sven.s...@axis.com> wrote:
Hi,

Currently when building Gerrit you get a stream of Errorprone warnings (see attachement for stable-3.7 build) that is ~95% of the output and makes it difficult to interpret errors etc.
Furthermore it is basically impossible to determine whether your patch introduces more Errorprone errors.

What is the purpose of running Errorprone if we don't fix the errors?

Can we lower the "log-level" so that these warning doesn't show by default?
A large portion (140 / 176 of current stable-3.7 warnings) seems to be warnings about PreferredInterfaceType which seems to be a prevalent "error" in Gerrit source-code (mainly using $COLLECTION instead of Immutable$COLLECTION) can we ignore this error?

AFAICS Edwin was recently working on fixing these warnings: https://gerrit-review.googlesource.com/q/message:PreferredInterfaceType

So these are PreferredInterfaceType warnings are meant to be fixed?
Yes, all PreferredInterfaceType have been fixed in master.
 
I was starting to fix them on the active stable-branches but I just wanted to be sure that this would be accepted first.
 

Weird, PreferredInterfaceType hasn't been set to WARNING, but I set it directly to ERROR, after fixing all the issues:

All I know is that I get the output as attached to this post.
It seems to me like they are "warnings" that are logged as INFO but they are very verbose nonetheless.
Perhaps this can be ignored with some local Bazel configuration.

We should figure out why this is happening. Based on the config in tools/BUILD, these are the only non-ERROR rules:
$ git grep -- '-Xep' stable-3.7 | grep -v ':ERROR"'
stable-3.7:tools/BUILD:        "-Xep:BanJNDI:WARN",
stable-3.7:tools/BUILD:        "-Xep:DoNotMockAutoValue:WARN",
stable-3.7:tools/BUILD:        "-Xep:EscapedEntity:WARN",
stable-3.7:tools/BUILD:        "-Xep:FloggerLogString:WARN",
stable-3.7:tools/BUILD:        "-Xep:ImpossibleNullComparison:WARN",
stable-3.7:tools/BUILD:        "-Xep:JavaUtilDate:WARN",
stable-3.7:tools/BUILD:        "-Xep:LiteProtoToString:WARN",
stable-3.7:tools/BUILD:        "-Xep:MutableConstantField:WARN",
stable-3.7:tools/BUILD:        "-Xep:ProvidesMethodOutsideOfModule:WARN",


I'll try to see if a bazel version update or something else caused the PreferredInterfaceType warnings to start appearing.

Nasser Grainawi

unread,
Feb 28, 2024, 2:57:56 PM2/28/24
to Edwin Kempin, Sven Selberg, Repo and Gerrit Discussion
Found it, https://errorprone.info/bugpattern/PreferredInterfaceType states "Alternate names: MutableConstantField". So this line is what is generating those warnings. Since I don't think we want to be making changes to stable branches just to fix warnings, I'll push some changes to turn off any WARN rules on stable branches.

Nasser Grainawi

unread,
Feb 28, 2024, 4:55:19 PM2/28/24
to Edwin Kempin, Sven Selberg, Repo and Gerrit Discussion

Edwin Kempin

unread,
Feb 29, 2024, 2:38:44 AM2/29/24
to Nasser Grainawi, Sven Selberg, Repo and Gerrit Discussion
Thanks for figuring this out. 

 
Since I don't think we want to be making changes to stable branches just to fix warnings, I'll push some changes to turn off any WARN rules on stable branches.


Thanks!

I think we should consider disabling the warnings also in master. If we want a certain ErrorProne issue to be fixed, it might be better to have a tracking issue for this.
Reply all
Reply to author
Forward
0 new messages