postbuildscript-plugin icon indicating copy to clipboard operation
postbuildscript-plugin copied to clipboard

Catch canceled step and mark build has failure

Open hashar opened this issue 1 year ago • 1 comments

When using the Parameterized plugin, the triggered job can be canceled. That causes an AbortException to be thrown. Since it is not handled, PostBuildScript let it through and the build is marked in failure even when one explicitly asks to ignore any error.

Catch AbortException and mark the build has being in failure in such a case instead of bubbling up the exception.

Fixes: https://phabricator.wikimedia.org/T352319

Before submitting a pull request, please make sure the following is done:

  1. Fork the repository and create your branch from master.
  2. If you've fixed a bug or added code that should be tested, please add JUnit tests.
  3. Ensure the test suite passes (mvn clean verify).
  4. Run mvn hpi:run and go to http://localhost:8080/jenkins/ to test your changes. Add a job that produces your bug / feature scenario.

hashar avatar Sep 26 '24 15:09 hashar

I am in the process of writing a test to cover this and will update the PR once I have finished.

hashar avatar Sep 30 '24 10:09 hashar

Thanks for the contribution, @hashar ! Sorry, that I didn't react earlier. I somehow must have overseen it.

dheid avatar Oct 12 '24 13:10 dheid

@dheid no worries and thank you for the review, merge and release!

I found another issue which this times lie in the parameterized plugin :-]

hashar avatar Oct 18 '24 12:10 hashar