gradle-doctor icon indicating copy to clipboard operation
gradle-doctor copied to clipboard

warnWhenNotUsingParallelGC fails the build, warn is a confusing keyword here

Open deepy opened this issue 4 years ago • 5 comments

Currently warnWhenNotUsingParallelGC is a check that fails the build

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'foo'.
> =============================== Gradle Doctor Prescriptions ============================================
  | For faster builds, use the parallel GC.                                                              |
  | Add -XX:+UseParallelGC to the org.gradle.jvmargs                                                     |
  ========================================================================================================

Normally when I see the word warn I'd expect a warning to be printed but the build to succeed. Looking through at extension it seems like maybe these checks could benefit from being an enum like: IGNORE, WARN, FAIL

deepy avatar Mar 04 '21 10:03 deepy

I like the idea of the enum. I will play with this a bit. The thing is an enum can be tricky to use with the kotlin Gradle DSL since then you'll have to import the enum. A string might be better.

runningcode avatar Mar 04 '21 13:03 runningcode

overload a setter and have both :-)?

deepy avatar Mar 04 '21 14:03 deepy

I've been thinking about messages some more and I think an additional value would be useful.

My scenario is that we've got a large team working on this but not everyone works on the build and as a result we're showing a lot of information to people who can't make good use of it. However, we'd still want to do the checks and get tagged build-scans for analysis purposes.

So something like TAG_ONLY, BACKGROUND or SILENT.

Though I guess that leaves us without a good way to make use of the report

deepy avatar Mar 12 '21 12:03 deepy

Very good point. What does background do? Warn only? What about erroring the build?

so tag, warn, error and off?

maybe the tagging, warning, and error messages should all be configured independently?

runningcode avatar Mar 12 '21 13:03 runningcode

the way I see it: warnings should be shown but not fail the build, errors should always be shown and fail the build, anything silent should never fail the build.

tag, background, or silent is just suggestions on name, neither should fail the build or be shown

deepy avatar Mar 12 '21 13:03 deepy