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

Tag filtering is not working as expected

    Details

    • Similar Issues:

      Description

      I am trying to use the TagBuildStrategyImpl to build my project tags. But I noticed that the "atMostDays" is not working as expected, I have to either don't pass the parameter or set it as a really high value such as "20000" in order to build a tag that it's only 1 day old.

      My guess is that time comparison is not working on my system. I am using a dockerized Jenkins setup based on Alpine

        Attachments

          Activity

          Hide
          jknurek J Knurek added a comment -

          I was looking into a similar issue and found some info that may help you.

          The value entered in the UI, for example `2 days` gets converted to a timestamp in the backend by:

          VALUE * 60 * 60 * 24 * 1000

          for example 2 days would be: 172800000

           

          Then here:

          https://github.com/jenkinsci/basic-branch-build-strategies-plugin/blob/master/src/main/java/jenkins/branch/buildstrategies/basic/TagBuildStrategyImpl.java#L127

          the value of the timestamp for the tag is obtained and compared against the system time.

          So based on your workaround, I would think either the current time is not coming back in milliseconds OR your SCM is not passing the time of the tag in milliseconds. 

           


          I expect that the SCM is not providing the data correct, so that leaves the question of which SCM source are you using?

          Show
          jknurek J Knurek added a comment - I was looking into a similar issue and found some info that may help you. The value entered in the UI, for example `2 days` gets converted to a timestamp in the backend by: VALUE * 60 * 60 * 24 * 1000 for example 2 days would be: 172800000   Then here: https://github.com/jenkinsci/basic-branch-build-strategies-plugin/blob/master/src/main/java/jenkins/branch/buildstrategies/basic/TagBuildStrategyImpl.java#L127 the value of the timestamp for the tag is obtained and compared against the system time. So based on your workaround, I would think either the current time is not coming back in milliseconds OR your SCM is not passing the time of the tag in milliseconds.    I expect that the SCM is not providing the data correct, so that leaves the question of which SCM source are you using?

            People

            • Assignee:
              Unassigned
              Reporter:
              canassa Cesar Canassa
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: