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

wrong timezone reported in changes

    XMLWordPrintable

Details

    Description

      jenkins do report git commit date based on master timezone, not using committer timezone.

      For sample, Committer date is reported by raw changelog as `1424725127 -0500`
      This is parsed by git-plugin ChangelogParser as `iso.format(1424725127) + remaining string`

      If jenkins master run as UTC+1 (Fr) this will result into : `2015-02-23T21:58:47+0100 -0500` which is wrong

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Nicolas De Loof
            Path:
            src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
            src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java
            http://jenkins-ci.org/commit/git-client-plugin/de49c9bf21f560ac3851c4f7ea3a3597a114ac8e
            Log:
            [FIXED JENKINS-27097] use ISO-8601 in changelog
            Use an explicit format string (to mimic raw format)
            to enforce ISO-8601 date format.
            Side benefit is this format string should not be
            impacted if a future/exotic git CLI do introduce
            some subtle changes in format=raw output.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/de49c9bf21f560ac3851c4f7ea3a3597a114ac8e Log: [FIXED JENKINS-27097] use ISO-8601 in changelog Use an explicit format string (to mimic raw format) to enforce ISO-8601 date format. Side benefit is this format string should not be impacted if a future/exotic git CLI do introduce some subtle changes in format=raw output.

            Code changed in jenkins
            User: Nicolas De Loof
            Path:
            src/main/java/hudson/plugins/git/GitChangeSet.java
            src/test/java/hudson/plugins/git/GitChangeSetTest.java
            http://jenkins-ci.org/commit/git-plugin/ea22613b2e9ae3d5ce7b6cc46d79d886f3cb62fc
            Log:
            JENKINS-27097 better date/timestamp handling

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/hudson/plugins/git/GitChangeSet.java src/test/java/hudson/plugins/git/GitChangeSetTest.java http://jenkins-ci.org/commit/git-plugin/ea22613b2e9ae3d5ce7b6cc46d79d886f3cb62fc Log: JENKINS-27097 better date/timestamp handling

            Code changed in jenkins
            User: Nicolas De Loof
            Path:
            src/test/java/hudson/plugins/git/GitChangeSetEuroTest.java
            src/test/java/hudson/plugins/git/GitChangeSetSimpleTest.java
            http://jenkins-ci.org/commit/git-plugin/6d605973a848938c690609b5bb875ec55579dac1
            Log:
            JENKINS-27097 remove legacy (and wrong) timestamp tests

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/test/java/hudson/plugins/git/GitChangeSetEuroTest.java src/test/java/hudson/plugins/git/GitChangeSetSimpleTest.java http://jenkins-ci.org/commit/git-plugin/6d605973a848938c690609b5bb875ec55579dac1 Log: JENKINS-27097 remove legacy (and wrong) timestamp tests

            What is the minimum JDK compatibility level for Jenkins?

            One of the tests breaks with JDK 1.6 for me. With 1.7 it works. (OSX 10.10.2)

            Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.444 sec <<< FAILURE! - in hudson.plugins.git.GitChangeSetTest
            testIsoDate(hudson.plugins.git.GitChangeSetTest)  Time elapsed: 1.01 sec  <<< ERROR!
            java.lang.IllegalArgumentException: Illegal pattern character 'X'
                    at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
                    at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
                    at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
                    at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:475)
                    at hudson.plugins.git.GitChangeSet.getTimestamp(GitChangeSet.java:209)
                    at hudson.plugins.git.GitChangeSetTest.testIsoDate(GitChangeSetTest.java:154)
            
            $ java -version
            java version "1.6.0_65"
            Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
            Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
            
            $ java -version
            java version "1.7.0_21"
            Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
            Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
            
            toypoodle Vasili Kvockin added a comment - What is the minimum JDK compatibility level for Jenkins? One of the tests breaks with JDK 1.6 for me. With 1.7 it works. (OSX 10.10.2) Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.444 sec <<< FAILURE! - in hudson.plugins.git.GitChangeSetTest testIsoDate(hudson.plugins.git.GitChangeSetTest) Time elapsed: 1.01 sec <<< ERROR! java.lang.IllegalArgumentException: Illegal pattern character 'X' at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768) at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:475) at hudson.plugins.git.GitChangeSet.getTimestamp(GitChangeSet.java:209) at hudson.plugins.git.GitChangeSetTest.testIsoDate(GitChangeSetTest.java:154) $ java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode) $ java -version java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b12) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
            markewaite Mark Waite added a comment - - edited

            The Jenkins git plugin is developed, compiled, and tested with JDK 1.7. The building Jenkins wiki page says that JDK 1.6 is required for Jenkins as a whole, but the git plugin is no longer being checked that it compiles with JDK 1.6, or that it runs with JDK 1.6.

            Since April 2015 is the official end of publicly available patches for JDK 1.7, and since Oracle's last publicly available patch for JDK 1.6 was 1.6.0_45 in April 2013, I hope the community sees that as a reasonable approach.

            Do you think that JDK 1.6 support is critical for the community of users of the git plugin?

            We recently had to refine a change so that users of the git plugin running on Red Hat 5 and Red Hat 6 (git versions prior to 1.7.10) would not be disrupted by the assumption of credentials support in command line git. After that, I included Red Hat 5 and Red Hat 6 machines in my test setup. Maybe we'll need to do something similar here, with some form of conditional for JDK 1.6. If so, then I'll adapt the test automation setup I have to include more testing of JDK 1.6 before new plugin versions are released.

            markewaite Mark Waite added a comment - - edited The Jenkins git plugin is developed, compiled, and tested with JDK 1.7. The building Jenkins wiki page says that JDK 1.6 is required for Jenkins as a whole, but the git plugin is no longer being checked that it compiles with JDK 1.6, or that it runs with JDK 1.6. Since April 2015 is the official end of publicly available patches for JDK 1.7, and since Oracle's last publicly available patch for JDK 1.6 was 1.6.0_45 in April 2013, I hope the community sees that as a reasonable approach. Do you think that JDK 1.6 support is critical for the community of users of the git plugin? We recently had to refine a change so that users of the git plugin running on Red Hat 5 and Red Hat 6 (git versions prior to 1.7.10) would not be disrupted by the assumption of credentials support in command line git. After that, I included Red Hat 5 and Red Hat 6 machines in my test setup. Maybe we'll need to do something similar here, with some form of conditional for JDK 1.6. If so, then I'll adapt the test automation setup I have to include more testing of JDK 1.6 before new plugin versions are released.

            Thank you for the clarification. No, I see no need to retain 1.6 compatibility.

            It would probably help the users if the git-plugin page would mention the minimum required java version. It already mentions minimum requirements for dependencies and git runtime. Additionally, it would help developers if there would be some kind of check for minimum version. At least they wouldn't then ask the same question I did.

            toypoodle Vasili Kvockin added a comment - Thank you for the clarification. No, I see no need to retain 1.6 compatibility. It would probably help the users if the git-plugin page would mention the minimum required java version. It already mentions minimum requirements for dependencies and git runtime. Additionally, it would help developers if there would be some kind of check for minimum version. At least they wouldn't then ask the same question I did.
            markewaite Mark Waite added a comment - - edited

            Git client plugin 1.17.0 released 25 Apr 2015 and includes this fix.

            I've also compiled and run the git client plugin automated tests with JDK 6 and do not see any failure with JDK 6. Unfortunately, when I run the git plugin automated tests with JDK 6, it shows that there is a problem. The stack trace is:

            testIsoDate(hudson.plugins.git.GitChangeSetTest)  Time elapsed: 2.798 sec  <<< ERROR!
            java.lang.IllegalArgumentException: Illegal pattern character 'X'
            	at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
            	at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
            	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
            	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:475)
            	at hudson.plugins.git.GitChangeSet.getTimestamp(GitChangeSet.java:209)
            	at hudson.plugins.git.GitChangeSetTest.testIsoDate(GitChangeSetTest.java:154)
            

            I'd prefer to not have to fix that problem, since the Jenkins project is saying goodbye to Java 6

            markewaite Mark Waite added a comment - - edited Git client plugin 1.17.0 released 25 Apr 2015 and includes this fix. I've also compiled and run the git client plugin automated tests with JDK 6 and do not see any failure with JDK 6. Unfortunately, when I run the git plugin automated tests with JDK 6, it shows that there is a problem. The stack trace is: testIsoDate(hudson.plugins.git.GitChangeSetTest) Time elapsed: 2.798 sec <<< ERROR! java.lang.IllegalArgumentException: Illegal pattern character 'X' at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768) at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:475) at hudson.plugins.git.GitChangeSet.getTimestamp(GitChangeSet.java:209) at hudson.plugins.git.GitChangeSetTest.testIsoDate(GitChangeSetTest.java:154) I'd prefer to not have to fix that problem, since the Jenkins project is saying goodbye to Java 6

            Code changed in jenkins
            User: Mark Waite
            Path:
            pom.xml
            http://jenkins-ci.org/commit/git-client-plugin/3bd20ddf480daf6794ba2a8de54007a8894c65a1
            Log:
            Base 1.17.1 off 1.16.1: allow more study of git 2.3.6-SNAPSHOT issues

            The release of git client plugin 1.17.0 delivered a fix for
            [ISO date parsing](https://issues.jenkins-ci.org/browse/JENKINS-27097).
            Unfortunately, that fix exposes a long-standing bug in git plugin versions
            2.3.5 and earlier. The bug is fixed in git plugin 2.3.6-SNAPSHOT.
            However, tests of git plugin 2.3.6-SNAPSHOT show that it is not yet
            ready for production use.

            Rather than rush to deliver git plugin 2.3.6, this change will restore the
            git client plugin to the code base which was delivered with git client
            plugin 1.16.1. That will hide the ISO date parsing bug that is in git
            plugin 2.3.5 and earlier and allow more time to prepare 2.3.6 for release.

            The 1.17.0 changes are not included in this build, including:

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: pom.xml http://jenkins-ci.org/commit/git-client-plugin/3bd20ddf480daf6794ba2a8de54007a8894c65a1 Log: Base 1.17.1 off 1.16.1: allow more study of git 2.3.6-SNAPSHOT issues The release of git client plugin 1.17.0 delivered a fix for [ISO date parsing] ( https://issues.jenkins-ci.org/browse/JENKINS-27097 ). Unfortunately, that fix exposes a long-standing bug in git plugin versions 2.3.5 and earlier. The bug is fixed in git plugin 2.3.6-SNAPSHOT. However, tests of git plugin 2.3.6-SNAPSHOT show that it is not yet ready for production use. Rather than rush to deliver git plugin 2.3.6, this change will restore the git client plugin to the code base which was delivered with git client plugin 1.16.1. That will hide the ISO date parsing bug that is in git plugin 2.3.5 and earlier and allow more time to prepare 2.3.6 for release. The 1.17.0 changes are not included in this build, including: Update minimum Jenkins version from 1.509 to 1.532.2 Update JGit to 3.7.0 [Allow prune with JGit JENKINS-26197] ( https://issues.jenkins-ci.org/browse/JENKINS-26197 ) [Use ISO-8601 date format in changelog JENKINS-27097] ( https://issues.jenkins-ci.org/browse/JENKINS-27097 ) [Improve checkout failure message JENKINS-26748] ( https://issues.jenkins-ci.org/browse/JENKINS-26748 ) Guard against null pointer exception in several API calls Update other dependencies
            markewaite Mark Waite added a comment -

            The git plugin and git client plugin are being tested in hopes of releasing new versions before the end of June. If you're willing to assist with the testing, please download and install a pre-release build of the git client plugin and the git plugin. Problems detected in the pre-release should be e-mailed to MarkEWaite and ndeloof.

            I wrote some test ideas if you would like suggestions of areas that need testing. The git plugin supports many different use cases and its automated tests only evaluate a very few of those use cases.

            markewaite Mark Waite added a comment - The git plugin and git client plugin are being tested in hopes of releasing new versions before the end of June. If you're willing to assist with the testing, please download and install a pre-release build of the git client plugin and the git plugin . Problems detected in the pre-release should be e-mailed to MarkEWaite and ndeloof . I wrote some test ideas if you would like suggestions of areas that need testing. The git plugin supports many different use cases and its automated tests only evaluate a very few of those use cases.
            markewaite Mark Waite added a comment -

            Fix included in git-client-plugin 1.18.0 and git plugin 2.4.0 released 18 July 2015

            markewaite Mark Waite added a comment - Fix included in git-client-plugin 1.18.0 and git plugin 2.4.0 released 18 July 2015

            People

              ndeloof Nicolas De Loof
              ndeloof Nicolas De Loof
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: