Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30565

Jenkins should ask for confirmation before aborting a build

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      Jenkins does not ask for confirmation before aborting a build. Since this can cause significant harm in the case of long-running builds or builds with side effects (partial deployments etc.), this should be added to the abort functionality.

      Queued items can be parameterized or triggered in a way that makes them difficult to reproduce (actions added etc.) so those should probably be protected from accidentally canceling them as well.

          [JENKINS-30565] Jenkins should ask for confirmation before aborting a build

          Probably the main issue that in highly active queue UI can send abort to wrong running job because of refresh rendering.

          Kanstantsin Shautsou added a comment - Probably the main issue that in highly active queue UI can send abort to wrong running job because of refresh rendering.

          Daniel Beck added a comment -

          True. Another reason for having this. That was actually the reason I went the extra inch and added the job name for queue items, and job name and build name for running builds, rather than just asking "Are you sure you want to abort?".

          Daniel Beck added a comment - True. Another reason for having this. That was actually the reason I went the extra inch and added the job name for queue items, and job name and build name for running builds, rather than just asking "Are you sure you want to abort?".

          Side effect is that if i mistakenly run build i want abort it very fast. And now i can do it.

          Kanstantsin Shautsou added a comment - Side effect is that if i mistakenly run build i want abort it very fast. And now i can do it.

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.properties
          core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly
          core/src/main/resources/hudson/widgets/HistoryWidget/entry.properties
          core/src/main/resources/lib/hudson/buildCaption.jelly
          core/src/main/resources/lib/hudson/buildCaption.properties
          core/src/main/resources/lib/hudson/executors.jelly
          core/src/main/resources/lib/hudson/executors.properties
          core/src/main/resources/lib/hudson/queue.jelly
          core/src/main/resources/lib/hudson/queue.properties
          core/src/main/resources/lib/layout/stopButton.jelly
          http://jenkins-ci.org/commit/jenkins/3af3a27116ccec048ce9eb61f947d74e0fe37611
          Log:
          [FIX JENKINS-30565] Ask for confirmation before canceling/aborting (#1835)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.properties core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly core/src/main/resources/hudson/widgets/HistoryWidget/entry.properties core/src/main/resources/lib/hudson/buildCaption.jelly core/src/main/resources/lib/hudson/buildCaption.properties core/src/main/resources/lib/hudson/executors.jelly core/src/main/resources/lib/hudson/executors.properties core/src/main/resources/lib/hudson/queue.jelly core/src/main/resources/lib/hudson/queue.properties core/src/main/resources/lib/layout/stopButton.jelly http://jenkins-ci.org/commit/jenkins/3af3a27116ccec048ce9eb61f947d74e0fe37611 Log: [FIX JENKINS-30565] Ask for confirmation before canceling/aborting (#1835)

          Oleg Nenashev added a comment -

          The fix has been released in 2.21

          Oleg Nenashev added a comment - The fix has been released in 2.21

          Oleg Nenashev added a comment -

          danielbeck Is it something we want to have in 2.19.x LTS?

          Oleg Nenashev added a comment - danielbeck Is it something we want to have in 2.19.x LTS?

          HI,
          After installing Jenkins 2.21, we indeed have a confirmation message before canceling running job or deleting job from queue but when we check the box 'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect.

          Job is well canceled or removed form queue only when we click on the confirmation message.
          Could you have a look on that please ?
          Thx

          Alexandre Aubert added a comment - HI, After installing Jenkins 2.21, we indeed have a confirmation message before canceling running job or deleting job from queue but when we check the box 'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect. Job is well canceled or removed form queue only when we click on the confirmation message. Could you have a look on that please ? Thx

          Daniel Beck added a comment -

          'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect.

          Don't do that then. It's a browser feature designed to prevent popup spam. It won't magically remember your previous answer.

          oleg_nenashev No, not a backportable fix.

          Daniel Beck added a comment - 'don't display this kind of message anymore' the message well doesn't display anymore but job cancelation has no effect. Don't do that then. It's a browser feature designed to prevent popup spam. It won't magically remember your previous answer. oleg_nenashev No, not a backportable fix.

          steve sides added a comment -

          "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment.
          What I am currently looking at, I click the red x abort job button, a dialog comes up; I dismiss it; I click the red x again; another dialog comes up; I check that box and click ok. However, the job is not cancelled. Jenkins is still hung. The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins. This is halfway through a pipeline job using 2.26.

          steve sides added a comment - "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment. What I am currently looking at, I click the red x abort job button, a dialog comes up; I dismiss it; I click the red x again; another dialog comes up; I check that box and click ok. However, the job is not cancelled. Jenkins is still hung. The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins. This is halfway through a pipeline job using 2.26.

          Daniel Beck added a comment -

          "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment.

          I did not. You told your browser "From now on, automatically reject all popup messages from this site", and that's what happens. Jenkins asks for confirmation, your browser tells it "No", and nothing gets cancelled. Remember, your computer does what you tell it to do, not what you want

          The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins.

          Or, you know, restart your browser to clear the flag you accidentally set.

          Daniel Beck added a comment - "the message well doesn't display anymore but job cancelation has no effect" hmmm...maybe you missed this point of the comment. I did not. You told your browser "From now on, automatically reject all popup messages from this site", and that's what happens. Jenkins asks for confirmation, your browser tells it "No", and nothing gets cancelled. Remember, your computer does what you tell it to do, not what you want The job cancellation has no effect and the jenkins ui is stuck, and the job will not be cancelled. I have to delete the job and/or restart jenkins. Or, you know, restart your browser to clear the flag you accidentally set.

          Paul Carr added a comment -

          This should be feature switchable .... we have hundreds of automated tests that will eventually fail if a server is down. Once we know they're all going to fail we now have to click the popup to cancel each. Could we have an option in the Manage Jenkins menu to disable these popups ?

          Paul Carr added a comment - This should be feature switchable .... we have hundreds of automated tests that will eventually fail if a server is down. Once we know they're all going to fail we now have to click the popup to cancel each. Could we have an option in the Manage Jenkins menu to disable these popups ?

          Paul Carr added a comment -

          This should really be switchable in the jenkins config

          Paul Carr added a comment - This should really be switchable in the jenkins config

          Oleg Nenashev added a comment -

          > Could we have an option in the Manage Jenkins menu to disable these popups ?

          Likely it lies within the "feel free to contribute". If you have hundreds of tests, the best solution is to write a system Groovy script for it

          Oleg Nenashev added a comment - > Could we have an option in the Manage Jenkins menu to disable these popups ? Likely it lies within the "feel free to contribute". If you have hundreds of tests, the best solution is to write a system Groovy script for it

          Paul Carr added a comment -

          Wouldn't that make upgrading more painful ? Having to remember to copy the groovy script etc ?  This was a feature requested by 1 person, with 2 additional votes, and it's made it straight into the main build. I suspect more people than just me will find it infuriating when they eventually upgrade.

          Paul Carr added a comment - Wouldn't that make upgrading more painful ? Having to remember to copy the groovy script etc ?  This was a feature requested by 1 person, with 2 additional votes, and it's made it straight into the main build. I suspect more people than just me will find it infuriating when they eventually upgrade.

          Daniel Beck added a comment -

          This is resolved, anything else is a followup RFE.

          Daniel Beck added a comment - This is resolved, anything else is a followup RFE.

          Paul Carr added a comment -

          OK.

          Paul Carr added a comment - OK.

          Requiring all cancelled jobs to be acknowledge is ridiculous without being able to turn it off as a configuration setting.  I regularly have to cancel lots of running jobs. 

          Please add a configuration setting or pull this back.

          Eric Waltersdorf added a comment - Requiring all cancelled jobs to be acknowledge is ridiculous without being able to turn it off as a configuration setting.  I regularly have to cancel lots of running jobs.  Please add a configuration setting or pull this back.

          Daniel Beck added a comment -

          ewalt72 Again,

          This is resolved, anything else is a followup RFE.

          Please file that, and link it from here, if you feel something like that is necessary. Also, provide your use case. From my POV "I regularly have dozens or hundreds of builds in the queue and need to cancel them quickly" rather indicates a much different underlying problem to me. Stack Overflow calls this the "X/Y problem", maybe an entirely different solution would be more practical.

          Daniel Beck added a comment - ewalt72 Again, This is resolved, anything else is a followup RFE. Please file that, and link it from here, if you feel something like that is necessary. Also, provide your use case. From my POV "I regularly have dozens or hundreds of builds in the queue and need to cancel them quickly" rather indicates a much different underlying problem to me. Stack Overflow calls this the "X/Y problem", maybe an entirely different solution would be more practical.

          Oleg Nenashev added a comment - - edited

          If somebody wants to disable this feature, it is pretty trivial to do so by adding a SystemProperty to Jenkins. By default Jenkins should require confirmation IMHO

          Oleg Nenashev added a comment - - edited If somebody wants to disable this feature, it is pretty trivial to do so by adding a SystemProperty to Jenkins. By default Jenkins should require confirmation IMHO

          Daniel Beck added a comment -

          pretty trivial to do so

          Let's please not add new options without having determined whether there's an actual need for it. See my preceding comment.

          Daniel Beck added a comment - pretty trivial to do so Let's please not add new options without having determined whether there's an actual need for it. See my preceding comment.

            danielbeck Daniel Beck
            danielbeck Daniel Beck
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: