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

When entering offline reason for a node, it should be prefixed with a date+time stamp

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      When a user enters a comment on why he/she moved a node to offline, it'd be great if it'll be automatically prefixed with a data+time stamp:
      'Took node offline for investigation of bug 1234'
      would be:
      '26-May-14 19:00 - Took node offline for investigation of bug 1234'

      (Of course, username is also welcome!)

          [JENKINS-23197] When entering offline reason for a node, it should be prefixed with a date+time stamp

          Yaniv Kaul created issue -

          Yaniv Kaul added a comment -

          I assume the change is under /core/src/main/java/hudson/model/Node.java :

          void setTemporaryOfflineCause(OfflineCause cause) {
          try {
          if (temporaryOfflineCause != cause)

          { temporaryOfflineCause = cause; // <---- Add date here. Jenkins.getInstance().save(); // Gotta be a better way to do this }

          } catch (java.io.IOException e)

          { LOGGER.warning("Unable to complete save, temporary offline status will not be persisted: " + e.getMessage()); }

          }

          Yaniv Kaul added a comment - I assume the change is under /core/src/main/java/hudson/model/Node.java : void setTemporaryOfflineCause(OfflineCause cause) { try { if (temporaryOfflineCause != cause) { temporaryOfflineCause = cause; // <---- Add date here. Jenkins.getInstance().save(); // Gotta be a better way to do this } } catch (java.io.IOException e) { LOGGER.warning("Unable to complete save, temporary offline status will not be persisted: " + e.getMessage()); } }

          Matt Legrand added a comment -

          This is a good suggestion. I just added the improvement - here's the pull request link:
          https://github.com/jenkinsci/jenkins/pull/1605

          This is my first time doing this - hopefully it will go well!

          Matt Legrand added a comment - This is a good suggestion. I just added the improvement - here's the pull request link: https://github.com/jenkinsci/jenkins/pull/1605 This is my first time doing this - hopefully it will go well!

          Code changed in jenkins
          User: Matt Legrand
          Path:
          core/src/main/java/hudson/slaves/OfflineCause.java
          http://jenkins-ci.org/commit/jenkins/9a69d6191ab3259709ed7fba0411b652a32bbab9
          Log:
          JENKINS-23197: add datestamp to node-offline message

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Matt Legrand Path: core/src/main/java/hudson/slaves/OfflineCause.java http://jenkins-ci.org/commit/jenkins/9a69d6191ab3259709ed7fba0411b652a32bbab9 Log: JENKINS-23197 : add datestamp to node-offline message

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/slaves/OfflineCause.java
          core/src/main/resources/hudson/slaves/OfflineCause/cause.jelly
          test/src/test/java/hudson/model/NodeTest.java
          http://jenkins-ci.org/commit/jenkins/0dd2dbc0bf3b29aa64376ecda9959a781aa33b89
          Log:
          [FIXED JENKINS-23197] add timestamp to node-offline message

          Merge pull request #1605.

          Compare: https://github.com/jenkinsci/jenkins/compare/8d3cd91e2818...0dd2dbc0bf3b

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/slaves/OfflineCause.java core/src/main/resources/hudson/slaves/OfflineCause/cause.jelly test/src/test/java/hudson/model/NodeTest.java http://jenkins-ci.org/commit/jenkins/0dd2dbc0bf3b29aa64376ecda9959a781aa33b89 Log: [FIXED JENKINS-23197] add timestamp to node-offline message Merge pull request #1605. Compare: https://github.com/jenkinsci/jenkins/compare/8d3cd91e2818...0dd2dbc0bf3b
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Matt Legrand made changes -
          Labels Original: offline New: lts-candidate offline

          Daniel Beck added a comment -

          Improvements are generally not eligible for backporting.

          Daniel Beck added a comment - Improvements are generally not eligible for backporting.

          Matt Legrand added a comment -

          No problem. We use the LTS here, and wanted to get the change. But it's not critical to us.

          Matt Legrand added a comment - No problem. We use the LTS here, and wanted to get the change. But it's not critical to us.
          Daniel Beck made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: nodeofflinenotification [ 17614 ]

            Unassigned Unassigned
            ykaul Yaniv Kaul
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: