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

Add 'Are you sure' on Reload configuration from disk

      The button "Reload configuration from disk" in Manage Jenkins can be easily pressed by mistake by an administrator.

      This happened to us and we lost functionality of Jenkins for more than an hour (we waited for Jenkins to come back by itself but it never did and we decided to restart the service on the master).

      Why not make the link points to an "Are you sure?" page like for the safe restart link?

      Thank you very much!

          [JENKINS-15340] Add 'Are you sure' on Reload configuration from disk

          Jesse Glick added a comment -

          Jenkins.doReload ought to @RequiresPOST or similar. Probably should be something like <l:confirmationLink href="…" post="true">…</> which would show a JavaScript popup confirmation dialog where available, then POST to the indicated URL; this has been asked for in other contexts.

          Jesse Glick added a comment - Jenkins.doReload ought to @RequiresPOST or similar. Probably should be something like <l:confirmationLink href="…" post="true">…</> which would show a JavaScript popup confirmation dialog where available, then POST to the indicated URL; this has been asked for in other contexts.

          Jesse Glick added a comment -

          Partially mitigated by JENKINS-12318 fix.

          Jesse Glick added a comment - Partially mitigated by JENKINS-12318 fix.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/ManagementLink.java
          core/src/main/java/jenkins/management/ReloadLink.java
          core/src/main/java/jenkins/model/Jenkins.java
          core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java
          core/src/main/resources/jenkins/model/Jenkins/manage.jelly
          core/src/main/resources/jenkins/model/Jenkins/manage.properties
          core/src/main/resources/lib/layout/breadcrumbs.js
          core/src/main/resources/lib/layout/confirmationLink.jelly
          core/src/main/resources/lib/layout/task.jelly
          http://jenkins-ci.org/commit/jenkins/9eb69772a505890a9767375b7c2a78e278895ef9
          Log:
          [FIXED JENKINS-15340] Ask for confirmation before reloading config from disk, as it may be expensive.
          First of all, /reload should require POST (also prevents XSS DoS attacks).
          Adding <l:confirmationLink> to encapsulate a link that requires confirmation upon clicking.
          Allowing a ManagementLink to request confirmation (also implying POST); could be used also for e.g. /quietDown.
          Enhancing <l:task> to support confirmation as well, and honoring this in context menu items.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/ManagementLink.java core/src/main/java/jenkins/management/ReloadLink.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java core/src/main/resources/jenkins/model/Jenkins/manage.jelly core/src/main/resources/jenkins/model/Jenkins/manage.properties core/src/main/resources/lib/layout/breadcrumbs.js core/src/main/resources/lib/layout/confirmationLink.jelly core/src/main/resources/lib/layout/task.jelly http://jenkins-ci.org/commit/jenkins/9eb69772a505890a9767375b7c2a78e278895ef9 Log: [FIXED JENKINS-15340] Ask for confirmation before reloading config from disk, as it may be expensive. First of all, /reload should require POST (also prevents XSS DoS attacks). Adding <l:confirmationLink> to encapsulate a link that requires confirmation upon clicking. Allowing a ManagementLink to request confirmation (also implying POST); could be used also for e.g. /quietDown. Enhancing <l:task> to support confirmation as well, and honoring this in context menu items.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2449
          [FIXED JENKINS-15340] Ask for confirmation before reloading config from disk, as it may be expensive. (Revision 9eb69772a505890a9767375b7c2a78e278895ef9)

          Result = UNSTABLE
          Jesse Glick : 9eb69772a505890a9767375b7c2a78e278895ef9
          Files :

          • core/src/main/resources/lib/layout/task.jelly
          • core/src/main/resources/lib/layout/breadcrumbs.js
          • core/src/main/java/hudson/model/ManagementLink.java
          • core/src/main/resources/jenkins/model/Jenkins/manage.jelly
          • core/src/main/resources/lib/layout/confirmationLink.jelly
          • core/src/main/resources/jenkins/model/Jenkins/manage.properties
          • core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java
          • core/src/main/java/jenkins/model/Jenkins.java
          • changelog.html
          • core/src/main/java/jenkins/management/ReloadLink.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2449 [FIXED JENKINS-15340] Ask for confirmation before reloading config from disk, as it may be expensive. (Revision 9eb69772a505890a9767375b7c2a78e278895ef9) Result = UNSTABLE Jesse Glick : 9eb69772a505890a9767375b7c2a78e278895ef9 Files : core/src/main/resources/lib/layout/task.jelly core/src/main/resources/lib/layout/breadcrumbs.js core/src/main/java/hudson/model/ManagementLink.java core/src/main/resources/jenkins/model/Jenkins/manage.jelly core/src/main/resources/lib/layout/confirmationLink.jelly core/src/main/resources/jenkins/model/Jenkins/manage.properties core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java core/src/main/java/jenkins/model/Jenkins.java changelog.html core/src/main/java/jenkins/management/ReloadLink.java

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/test/java/hudson/model/ManagementLinkTest.java
          http://jenkins-ci.org/commit/jenkins/e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e
          Log:
          JENKINS-15340 Do not try to click on links with onclick attributes as these require confirmation.

          Compare: https://github.com/jenkinsci/jenkins/compare/9eb69772a505...e1f070bbef42

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/java/hudson/model/ManagementLinkTest.java http://jenkins-ci.org/commit/jenkins/e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e Log: JENKINS-15340 Do not try to click on links with onclick attributes as these require confirmation. Compare: https://github.com/jenkinsci/jenkins/compare/9eb69772a505...e1f070bbef42

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2450
          JENKINS-15340 Do not try to click on links with onclick attributes as these require confirmation. (Revision e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e)

          Result = UNSTABLE
          Jesse Glick : e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e
          Files :

          • test/src/test/java/hudson/model/ManagementLinkTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2450 JENKINS-15340 Do not try to click on links with onclick attributes as these require confirmation. (Revision e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e) Result = UNSTABLE Jesse Glick : e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e Files : test/src/test/java/hudson/model/ManagementLinkTest.java

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/ManagementLink.java
          core/src/main/java/jenkins/management/ReloadLink.java
          core/src/main/java/jenkins/model/Jenkins.java
          core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java
          core/src/main/resources/jenkins/model/Jenkins/manage.jelly
          core/src/main/resources/jenkins/model/Jenkins/manage.properties
          core/src/main/resources/lib/layout/breadcrumbs.js
          core/src/main/resources/lib/layout/confirmationLink.jelly
          core/src/main/resources/lib/layout/task.jelly
          http://jenkins-ci.org/commit/jenkins/e3f905fa5347e3265a9919fd8112902ed53d9fd9
          Log:
          [FIXED JENKINS-15340] Ask for confirmation before reloading config from disk, as it may be expensive.
          First of all, /reload should require POST (also prevents XSS DoS attacks).
          Adding <l:confirmationLink> to encapsulate a link that requires confirmation upon clicking.
          Allowing a ManagementLink to request confirmation (also implying POST); could be used also for e.g. /quietDown.
          Enhancing <l:task> to support confirmation as well, and honoring this in context menu items.(cherry picked from commit 9eb69772a505890a9767375b7c2a78e278895ef9)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/ManagementLink.java core/src/main/java/jenkins/management/ReloadLink.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java core/src/main/resources/jenkins/model/Jenkins/manage.jelly core/src/main/resources/jenkins/model/Jenkins/manage.properties core/src/main/resources/lib/layout/breadcrumbs.js core/src/main/resources/lib/layout/confirmationLink.jelly core/src/main/resources/lib/layout/task.jelly http://jenkins-ci.org/commit/jenkins/e3f905fa5347e3265a9919fd8112902ed53d9fd9 Log: [FIXED JENKINS-15340] Ask for confirmation before reloading config from disk, as it may be expensive. First of all, /reload should require POST (also prevents XSS DoS attacks). Adding <l:confirmationLink> to encapsulate a link that requires confirmation upon clicking. Allowing a ManagementLink to request confirmation (also implying POST); could be used also for e.g. /quietDown. Enhancing <l:task> to support confirmation as well, and honoring this in context menu items.(cherry picked from commit 9eb69772a505890a9767375b7c2a78e278895ef9) Conflicts: changelog.html

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/test/java/hudson/model/ManagementLinkTest.java
          http://jenkins-ci.org/commit/jenkins/d7f7a4a7df01a7b3b57c27a095cc70496476a817
          Log:
          JENKINS-15340 Do not try to click on links with onclick attributes as these require confirmation.(cherry picked from commit e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/java/hudson/model/ManagementLinkTest.java http://jenkins-ci.org/commit/jenkins/d7f7a4a7df01a7b3b57c27a095cc70496476a817 Log: JENKINS-15340 Do not try to click on links with onclick attributes as these require confirmation.(cherry picked from commit e1f070bbef425fcbc9376eb99190a9b7bf3c4e5e)

          Martin d'Anjou added a comment - - edited

          Asking "Are you sure" tells nothing to the user about the consequences. Instead, these kinds of confirmation boxes should tell the user what will happen and what to expect before asking the user if they are sure. Telling the use "it's expensive" is not informative either. Telling the user "you will lose all in-flight builds and all pending builds" is informative. I have "by accident" reloaded configuration from disk, and I would have liked to know the consequences (they were bad).

          Martin d'Anjou added a comment - - edited Asking "Are you sure" tells nothing to the user about the consequences. Instead, these kinds of confirmation boxes should tell the user what will happen and what to expect before asking the user if they are sure. Telling the use "it's expensive" is not informative either. Telling the user "you will lose all in-flight builds and all pending builds" is informative. I have "by accident" reloaded configuration from disk, and I would have liked to know the consequences (they were bad).

          Daniel Beck added a comment -

          Martin: Recent Jenkins versions (1.507+) are considered to no longer lose information on running builds when reloading, see JENKINS-3265. This warning (now) exists primarily to prevent accidental reloads that make the Jenkins UI unavailable for several minutes (especially with larger instances).

          I experienced some build data loss in combination with 'Cloudbees Restart Aborted Builds Plugin' (Jenkins Enterprise) but without that plugin, have repeatedly and successfully reloaded configuration from disk without losing in-progress build information.

          If you're on a recent Jenkins version and lost data, you should probably file a new issue and provide more information about your environment.

          Daniel Beck added a comment - Martin: Recent Jenkins versions (1.507+) are considered to no longer lose information on running builds when reloading, see JENKINS-3265 . This warning (now) exists primarily to prevent accidental reloads that make the Jenkins UI unavailable for several minutes (especially with larger instances). I experienced some build data loss in combination with 'Cloudbees Restart Aborted Builds Plugin' (Jenkins Enterprise) but without that plugin, have repeatedly and successfully reloaded configuration from disk without losing in-progress build information. If you're on a recent Jenkins version and lost data, you should probably file a new issue and provide more information about your environment.

            Unassigned Unassigned
            dblanchette Denis Blanchette
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: