Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-13223

jenkins nightly release generated bogus date - d_2018_12_31

    Details

    • Templates:
    • Story Points:
      0.375
    • Epic Link:
    • Team:
      SQuaRE

      Description

      As reported on #dm-square, an eups distrib tag of d_2018_12_31 has appeared and d_2017_12_31 is missing:

      https://eups.lsst.codes/stack/src/tags/d_2018_12_31.list

      The build from that day, #154, has this snippet in the console output:

      https://ci.lsst.codes/job/release/job/nightly-release-cron/154/console

      generated year: 2018
      [Pipeline] echo
      generated month: 12
      [Pipeline] echo
      generated day: 31
      

      The build timestamp, https://ci.lsst.codes/job/release/job/nightly-release-cron/154/api/json?tree=timestamp , is 1514707200982. Feeding that epoch (ms resolution) into the relavent code from https://github.com/lsst-sqre/jenkins-dm-jobs/blob/master/pipelines/release/nightly_release_cron.groovy reproduces the bogus date.

      $ cat time.groovy 
      #!/usr/bin/groovy
       
      def tz = TimeZone.getTimeZone('America/Los_Angeles')
      def date = new java.util.Date(1514707200982)
       
      def yearFormat = new java.text.SimpleDateFormat('YYYY')
      yearFormat.setTimeZone(tz)
      def monthFormat = new java.text.SimpleDateFormat('MM')
      monthFormat.setTimeZone(tz)
      def dayFormat = new java.text.SimpleDateFormat('dd')
      dayFormat.setTimeZone(tz)
       
      year = yearFormat.format(date)
      month = monthFormat.format(date)
      day = dayFormat.format(date)
       
      println year
      println month
      println day
      $ ./time.groovy 
      2018
      12
      31
      

      Per Kian-Tat Lim:

       
      YYYY is not yyyy
       
       
      [9:23] 
      YYYY is the "week year"
       
       
      [9:23] 
      yyyy is the calendar year.
       
       
      [9:23] 
      A week year is in sync with a WEEK_OF_YEAR cycle. All weeks between the first and last weeks (inclusive) have the same week year value. Therefore, the first and last days of a week year may have different calendar year values.
      

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  jhoblitt Joshua Hoblitt
                  Reporter:
                  jhoblitt Joshua Hoblitt
                  Reviewers:
                  Kian-Tat Lim, Tim Jenness
                  Watchers:
                  Joshua Hoblitt, Kian-Tat Lim, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel