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

Zentimestamp plugin no longer compatible with Jenkins 1.597

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      With Jenkins 1.597, the environment variable BUILD_ID was changed from timestamp to the build number. The zentimestamp plugin can not alter the content of BUILD_ID anymore. A new environment variable should be introduced, like BUILD_TIMESTAMP. This can be modified by the plugin then.

        Attachments

          Issue Links

            Activity

            mre_mchp Michael Rentschler created issue -
            mre_mchp Michael Rentschler made changes -
            Field Original Value New Value
            Description As of version 3.0 the zen timestamp plugin appears to be no longer compatible with Hudson. I tested it in a stand alone Hudson instance (no additional plugins) against Hudson versions 2.2.0 and 2.1.0 and noticed that the BUILD_ID variable is not getting replaced by the correct pattern.

            I rolled back to version 2.2 of the plugin which appears to still be compatible with both versions of Hudson above.

            I did not see any errors in the logs when running projects with the plugin activated, only that the environment variable contained the original timestamp formatting.
            With Jenkins 1.597, the environment variable {{BUILD_ID}} was changed from timestamp to the build number. The {{zentimestamp}} plugin can not alter the content of {{BUILD_ID}} anymore. A new environment variable should be introduced, like {{BUILD_TIMESTAMP}}. This can be modified by the plugin then.
            mre_mchp Michael Rentschler made changes -
            Link This issue is related to JENKINS-24380 [ JENKINS-24380 ]
            mre_mchp Michael Rentschler made changes -
            Link This issue is related to JENKINS-26624 [ JENKINS-26624 ]
            mre_mchp Michael Rentschler made changes -
            Link This issue is related to JENKINS-26520 [ JENKINS-26520 ]
            Hide
            rome roma added a comment -

            I'm using Jenkins 1.597 and BUILD_ID. Now, I'm forced to use ZenTimestamp plugin(3.3) to convert Build_ID from BUILD_NUMBER to YYYY-MM-DD_hh-mm-ss. Today (February 5th, 2005) , I found that the timestamp set to BUILD_ID is 2015-02-36_03-53-58. February doesn't have 36 days. Another incompatible issue?

            Show
            rome roma added a comment - I'm using Jenkins 1.597 and BUILD_ID. Now, I'm forced to use ZenTimestamp plugin(3.3) to convert Build_ID from BUILD_NUMBER to YYYY-MM-DD_hh-mm-ss. Today (February 5th, 2005) , I found that the timestamp set to BUILD_ID is 2015-02-36_03-53-58. February doesn't have 36 days. Another incompatible issue?
            Hide
            schristou Steven Christou added a comment -

            roma That is not a compatibility bug. You're using `DD` (upper case) which is day in year, so January (31 days) + February 5th (5 days) = 36 days. Instead you should use `dd` (lower case) which will show the day in month. See http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html for more information.

            Show
            schristou Steven Christou added a comment - roma That is not a compatibility bug. You're using `DD` (upper case) which is day in year , so January (31 days) + February 5th (5 days) = 36 days. Instead you should use `dd` (lower case) which will show the day in month . See http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html for more information.
            schristou Steven Christou made changes -
            Remote Link This issue links to "PR 1 (Web Link)" [ 12600 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: christ66
            Path:
            pom.xml
            src/ittest/java/hudson/plugins/zentimestamp/ZenTimestampJobPropertyTest.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampAction.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampNodeProperty.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampRunListener.java
            src/main/resources/hudson/plugins/zentimestamp/Messages.properties
            src/main/resources/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper/help-pattern.html
            src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/config.properties
            src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/help-changeBUILDID.html
            src/main/resources/index.jelly
            src/main/webapp/help-node.html
            http://jenkins-ci.org/commit/zentimestamp-plugin/3bbe8cfc2c77ee663d68e2f64914edaee5981add
            Log:
            JENKINS-26626 Switch to use BUILD_TIMESTAMP environment variable instead of the BUILD_ID. Newer versions of Jenkins use the BUID_ID as being the build number.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: pom.xml src/ittest/java/hudson/plugins/zentimestamp/ZenTimestampJobPropertyTest.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampAction.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampNodeProperty.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampRunListener.java src/main/resources/hudson/plugins/zentimestamp/Messages.properties src/main/resources/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper/help-pattern.html src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/config.properties src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/help-changeBUILDID.html src/main/resources/index.jelly src/main/webapp/help-node.html http://jenkins-ci.org/commit/zentimestamp-plugin/3bbe8cfc2c77ee663d68e2f64914edaee5981add Log: JENKINS-26626 Switch to use BUILD_TIMESTAMP environment variable instead of the BUILD_ID. Newer versions of Jenkins use the BUID_ID as being the build number.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Gregory Boissinot
            Path:
            pom.xml
            src/ittest/java/hudson/plugins/zentimestamp/ZenTimestampJobPropertyTest.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampAction.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampNodeProperty.java
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampRunListener.java
            src/main/resources/hudson/plugins/zentimestamp/Messages.properties
            src/main/resources/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper/help-pattern.html
            src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/config.properties
            src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/help-changeBUILDID.html
            src/main/resources/index.jelly
            src/main/webapp/help-node.html
            http://jenkins-ci.org/commit/zentimestamp-plugin/d0489822ae9081a09b63ccf413302973e25686bb
            Log:
            Merge pull request #1 from christ66/JENKINS-26626

            JENKINS-26626 Switch to use BUILD_TIMESTAMP environment variable

            Compare: https://github.com/jenkinsci/zentimestamp-plugin/compare/c04098bcef9f...d0489822ae90

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: pom.xml src/ittest/java/hudson/plugins/zentimestamp/ZenTimestampJobPropertyTest.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampAction.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampNodeProperty.java src/main/java/hudson/plugins/zentimestamp/ZenTimestampRunListener.java src/main/resources/hudson/plugins/zentimestamp/Messages.properties src/main/resources/hudson/plugins/zentimestamp/ZenTimestampFormatBuildWrapper/help-pattern.html src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/config.properties src/main/resources/hudson/plugins/zentimestamp/ZenTimestampJobProperty/help-changeBUILDID.html src/main/resources/index.jelly src/main/webapp/help-node.html http://jenkins-ci.org/commit/zentimestamp-plugin/d0489822ae9081a09b63ccf413302973e25686bb Log: Merge pull request #1 from christ66/ JENKINS-26626 JENKINS-26626 Switch to use BUILD_TIMESTAMP environment variable Compare: https://github.com/jenkinsci/zentimestamp-plugin/compare/c04098bcef9f...d0489822ae90
            Hide
            schristou Steven Christou added a comment -

            The PR was merged, so I am marking as fixed.

            The Zentimestamp plugin will use the `BUILD_TIMESTAMP` environment variable instead of the `BUILD_ID`.

            Show
            schristou Steven Christou added a comment - The PR was merged, so I am marking as fixed. The Zentimestamp plugin will use the `BUILD_TIMESTAMP` environment variable instead of the `BUILD_ID`.
            schristou Steven Christou made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            schristou Steven Christou made changes -
            Assignee Gregory Boissinot [ gbois ] Steven Christou [ schristou ]
            Hide
            mre_mchp Michael Rentschler added a comment - - edited

            With older Jenkins versions, the timestamp environment variable (formerly BUILD_ID) was
            already set to the default timestamp format by the Jenkins core and was only modified by the Zen Timestamp plugin if the option "Change date pattern" was checked (inside the job or node configuration) and a different format was selected.

            The new Zen plugin must be fixed to set the BUILD_TIMESTAMP variable in any case, even if there was no format defined inside the job or node configuration, by using the default timestamp format. This must be done by the plugin now, since BUILD_TIMESTAMP is not set by the core anymore.

            Show
            mre_mchp Michael Rentschler added a comment - - edited With older Jenkins versions, the timestamp environment variable (formerly BUILD_ID) was already set to the default timestamp format by the Jenkins core and was only modified by the Zen Timestamp plugin if the option "Change date pattern" was checked (inside the job or node configuration) and a different format was selected. The new Zen plugin must be fixed to set the BUILD_TIMESTAMP variable in any case , even if there was no format defined inside the job or node configuration, by using the default timestamp format. This must be done by the plugin now, since BUILD_TIMESTAMP is not set by the core anymore .
            mre_mchp Michael Rentschler made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Hide
            mre_mchp Michael Rentschler added a comment -

            It must be right enough to install the Zen Timestamp plugin, then the BUILD_TIMESTAMP environment variable should be set for each build, using the default/legacy timestamp format. No further configuration needed, unless the timestamp format must be changed.

            Show
            mre_mchp Michael Rentschler added a comment - It must be right enough to install the Zen Timestamp plugin, then the BUILD_TIMESTAMP environment variable should be set for each build, using the default/legacy timestamp format. No further configuration needed, unless the timestamp format must be changed.
            Hide
            tobeychris Chris Tobey added a comment -

            This should also expose the BUILD_TIMESTAMP for jenkins pre-1.597 so that this plugin can be applied, jobs can be updated to use the BUILD_TIMESTAMP variable, and then Jenkins can be updated separately and at a later time, with no changes needed.

            Show
            tobeychris Chris Tobey added a comment - This should also expose the BUILD_TIMESTAMP for jenkins pre-1.597 so that this plugin can be applied, jobs can be updated to use the BUILD_TIMESTAMP variable, and then Jenkins can be updated separately and at a later time, with no changes needed.
            Hide
            gbois Gregory Boissinot added a comment -

            From 4.x, the zentimestamp plugin uses the BUILD_TIMESTAMP variable.

            Show
            gbois Gregory Boissinot added a comment - From 4.x, the zentimestamp plugin uses the BUILD_TIMESTAMP variable.
            gbois Gregory Boissinot made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            Hide
            gbois Gregory Boissinot added a comment -

            For populate a BUILD_TIMESTAMP in any case, please make another issue.

            Show
            gbois Gregory Boissinot added a comment - For populate a BUILD_TIMESTAMP in any case, please make another issue.
            mre_mchp Michael Rentschler made changes -
            Link This issue is blocking JENKINS-29873 [ JENKINS-29873 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160699 ] JNJira + In-Review [ 196533 ]

              People

              Assignee:
              schristou Steven Christou
              Reporter:
              mre_mchp Michael Rentschler
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: