Skip to content

Fix canceling outdated Maven projects#67

Merged
jakub-bochenski merged 1 commit intojenkinsci:masterfrom
proski:maven-cancel
Apr 24, 2019
Merged

Fix canceling outdated Maven projects#67
jakub-bochenski merged 1 commit intojenkinsci:masterfrom
proski:maven-cancel

Conversation

@proski
Copy link

@proski proski commented Mar 23, 2019

*  Fix canceling outdated Maven projects
   
   The original code would only look for instances of Build to be canceled.
   MavenBuild inherits from AbstractBuild but not from Build, so Maven
   builds would not be canceled.
   
   Use Run for elements of the job.getBuilds(), it is type safe and provides
   the necessary API.
   
   Use run.getId() in the log for better readability.
   
   Check the result of getExecutor(), it has @CheckForNull attribute.

@proski
Copy link
Author

proski commented Mar 26, 2019

Improved the commit message.

@proski proski changed the title Fix cancelling outdated Maven projects Fix canceling outdated Maven projects Mar 27, 2019
@proski
Copy link
Author

proski commented Apr 9, 2019

Updated for the forthcoming pipeline compatibility (#70). Instead of going from Build to AbstractBuild, go all the way to Run, is has the required API to be aborted.

@proski
Copy link
Author

proski commented Apr 9, 2019

Added a check for the result of getExecutor(). If it's null, the build must have finished and doesn't need to be aborted. Using run.getId() in the log instead of printing the object as is.

@proski proski mentioned this pull request Apr 9, 2019
The original code would only look for instances of Build to be canceled.
MavenBuild inherits from AbstractBuild but not from Build, so Maven
builds would not be canceled.

Use Run for elements of the job.getBuilds(), it is type safe and provides
the necessary API.

Use run.getId() in the log for better readability.

Check the result of getExecutor(), it has @checkfornull attribute.
@jakub-bochenski jakub-bochenski merged commit 0288662 into jenkinsci:master Apr 24, 2019
@proski proski deleted the maven-cancel branch April 24, 2019 16:10
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.

2 participants