[JIRA] (JENKINS-60301) Cancel builds on new patch sets

13 views
Skip to first unread message

john.viklund@effnet.com (JIRA)

unread,
Nov 27, 2019, 7:53:03 AM11/27/19
to jenkinsc...@googlegroups.com
John V created an issue
 
Jenkins / New Feature JENKINS-60301
Cancel builds on new patch sets
Issue Type: New Feature New Feature
Assignee: Luca Domenico Milanesio
Components: gerrit-code-review-plugin
Created: 2019-11-27 12:52
Priority: Minor Minor
Reporter: John V

It would be nice the have the option to cancel ongoing builds for old patch sets when a new patch set is uploaded.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

luca.milanesio@gmail.com (JIRA)

unread,
Nov 27, 2019, 7:57:38 AM11/27/19
to jenkinsc...@googlegroups.com
Luca Domenico Milanesio commented on New Feature JENKINS-60301
 
Re: Cancel builds on new patch sets

Isn't it the way it works now? When a new PS gets pushed, the branch reindexing will remove the job of the old build, cancelling it if it's still active.

What is instead the behaviour that you observe upon the upload of a new patch-set?

john.viklund@effnet.com (JIRA)

unread,
Nov 27, 2019, 8:03:03 AM11/27/19
to jenkinsc...@googlegroups.com
John V commented on New Feature JENKINS-60301

Not from what I have seen, the project for the old patch set only gets marked as disabled on Jenkins, but the actual build keeps on going until its finished.

What I would like to see is the option to be able to make it stop completely (as if you would manually click the stop build button on Jenkins) when the new patchset is detected

luca.milanesio@gmail.com (JIRA)

unread,
Nov 27, 2019, 8:05:01 AM11/27/19
to jenkinsc...@googlegroups.com

Gotcha, it's a valid concern then. The new PS build is triggered, anyway, the old job would consume CPU without being able to report any valid feedback, as the PS is obsolete anyway.

Point taken, thanks for reporting it.

john.viklund@effnet.com (JIRA)

unread,
Dec 2, 2019, 3:57:02 AM12/2/19
to jenkinsc...@googlegroups.com
John V commented on New Feature JENKINS-60301

Forgot to mention that I'm using it in a Multibranch Pipeline together with the git-refs-filter module in Gerrit.

I did some research and found this file:
https://github.com/jenkinsci/cloudbees-folder-plugin/blob/master/src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java

It contains the function updateChildren which I believe is the one handling the disabling of old patch-sets in my case. An alternative to adding something to the gerrit plugin could be if that plugin had the option to also stop jobs when it does the disabling. At least that would be sufficient for my use-case.

luca.milanesio@gmail.com (JIRA)

unread,
Jan 5, 2020, 2:17:03 PM1/5/20
to jenkinsc...@googlegroups.com

Yes, I did a bit of research and I came to the same conclusion: this is something for the computed-folder-plugin rather than the gerrit-code-review plugin.

It should be reported and resolved there, as the strategy for stopping the job when it becomes orphan should be done in that class.

WDYT?

john.viklund@effnet.com (JIRA)

unread,
Jan 7, 2020, 9:48:01 AM1/7/20
to jenkinsc...@googlegroups.com
John V commented on New Feature JENKINS-60301

I agree it would make more sense to have it in there, I've created JENKINS-60677.

Reply all
Reply to author
Forward
0 new messages