Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task does not fail if report generation fails #909

Closed
Vampire opened this issue Jun 25, 2023 · 6 comments · Fixed by #929
Closed

Task does not fail if report generation fails #909

Vampire opened this issue Jun 25, 2023 · 6 comments · Fixed by #929
Assignees
Labels

Comments

@Vampire
Copy link

Vampire commented Jun 25, 2023

If there is an error during report generation, for example if you configure the HTML report and give it a syntactically incorrect XSL, you get the error from the XSLT engine printed, but the task finishes successfully. The task should fail instead if anything goes wrong during report generation. Especially as on next execution the task will simply be up-to-date or taken from task output cache, where the task output cache will contain a stale report from last time the generation was successful.

@KengoTODA
Copy link
Member

It seems that there is no way to detect the failure in this gradle-plugin side; HTML bug reporter ignores thrown exception.

I'll try to monitor its stderr output and make the task fail if Could not generate HTML output is found.

@KengoTODA KengoTODA self-assigned this Aug 1, 2023
KengoTODA added a commit that referenced this issue Aug 1, 2023
Signed-off-by: Kengo TODA <skypencil@gmail.com>
@Vampire
Copy link
Author

Vampire commented Aug 2, 2023

Hm, but the exception is preserved in some field.
I'd have guessed that this should then be queried later and made the whole execution fail with non-0 exit code?
There is probably some bug about that in Spotbugs I guess.

@KengoTODA
Copy link
Member

The fix for this issue #929 is not published yet. Did you confirm it with a built Gradle plugin from that branch?

@KengoTODA
Copy link
Member

There is probably some bug about that in Spotbugs I guess.

This is true. I recently little bit tired to maintain the SpotBugs core, hope that someone will send a PR to fix these kinds of problems...

@Vampire
Copy link
Author

Vampire commented Aug 3, 2023

Did you confirm it with a built Gradle plugin from that branch?

No

KengoTODA added a commit that referenced this issue Aug 8, 2023
* test: reproduce the reported issue as #909

Signed-off-by: Kengo TODA <skypencil@gmail.com>

* test: fix test case

Signed-off-by: Kengo TODA <skypencil@gmail.com>

* fix: Task does not fail if report generation fails

Signed-off-by: Kengo TODA <skypencil@gmail.com>

* chore: format code by spotless

Signed-off-by: Kengo TODA <skypencil@gmail.com>

* chore: resolve problems reported by SonarQube

Signed-off-by: Kengo TODA <skypencil@gmail.com>

---------

Signed-off-by: Kengo TODA <skypencil@gmail.com>
@github-actions
Copy link

github-actions bot commented Aug 9, 2023

🎉 This issue has been resolved in version 5.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants