Skip to content

Allow skipping failure for RAT and Source Patterns#992

Merged
madrob merged 2 commits intoapache:mainfrom
madrob:gradle-fail
Sep 1, 2022
Merged

Allow skipping failure for RAT and Source Patterns#992
madrob merged 2 commits intoapache:mainfrom
madrob:gradle-fail

Conversation

@madrob
Copy link
Contributor

@madrob madrob commented Aug 31, 2022

I'd like to be able to still run these checks and report on them, but also be able to prevent them from failing the build. Useful in CI environment where I will have the output and also want to make sure other checks get run instead of failing fast here.

This pattern was modeled on the validation.git.failOnModified option.

if (shouldFail) {
throw new GradleException(message)
} else {
logger.lifecycle("NOTE: ${message}")
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a logger.warning (or warn?) method you could use here instead. otherwise lgtm.

@madrob madrob merged commit eaaabbf into apache:main Sep 1, 2022
@madrob madrob deleted the gradle-fail branch September 1, 2022 14:25
@uschindler
Copy link
Contributor

Hi,
I am fine with that, but actually in an CI environment this is not needed. On Jenkins all jobs start with gradlew --continue, so the GradleException when thrown during task execution is converted to a warning.
So to me this seems useless as CI already works well, but it was merged already,

@uschindler
Copy link
Contributor

Info: "When executed with --continue, Gradle will execute every task to be executed where all of the dependencies for that task completed without failure, instead of stopping as soon as the first failure is encountered. Each of the encountered failures will be reported at the end of the build.

If a task fails, any subsequent tasks that were depending on it will not be executed. For example, tests will not run if there is a compilation failure in the code under test; because the test task will depend on the compilation task (either directly or indirectly)."

@uschindler
Copy link
Contributor

uschindler commented Sep 1, 2022

But as check tasks are last in execution (only "check" depends on it), this is fine.

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.

3 participants