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

Multibranch pipeline still showing Git tags older than configured threshold

      I've got some Multibranch pipeline jobs configured to use a Git repository, together with "Build strategies" -> "Any Strategies Match" -> "Any of" -> "Tags" -> "Ignore tags older than" -> 7. But when looking at the "Tags" tab of those jobs, they still show (subjobs for) tags that are way older than 7 days.

      Configuring the same for branches works just fine.

          [JENKINS-64810] Multibranch pipeline still showing Git tags older than configured threshold

          Dirk Heinrichs created issue -
          Mark Waite made changes -
          Component/s New: basic-branch-build-strategies-plugin [ 23425 ]
          Component/s Original: git-plugin [ 15543 ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Mark Waite added a comment -

          I reassigned this to the basic branch build strategies plugin because it provides this capability and describes it in the user documentation.

          Mark Waite added a comment - I reassigned this to the basic branch build strategies plugin because it provides this capability and describes it in the user documentation .
          Austin Orth made changes -
          Attachment New: Screen Shot 2021-04-09 at 10.02.13 AM.png [ 54446 ]

          Austin Orth added a comment -

          I just experienced this issue with child scans of multibranch pipelines in a GitHub organization folder. I had child scans set to run weekly, if not run otherwise, and when run, the scans picked up all tags, regardless of date, causing Jenkins to be flooded with hundreds of builds. Later today, I am going to try an organization scan to see if the issue occurs when scanning at that level, as well as tweaking the number of days of tags to keep.

          I've attached a screenshot with my current settings, so hopefully this helpful for whoever decides to take this on. I will also take a look at the code this afternoon, but it's been a while since I've worked with Java, so I don't know how much I'll be able to help. Thanks in advance!

          cc: rsandell, bitwiseman

          Austin Orth added a comment - I just experienced this issue with child scans of multibranch pipelines in a GitHub organization folder. I had child scans set to run weekly, if not run otherwise, and when run, the scans picked up all tags, regardless of date, causing Jenkins to be flooded with hundreds of builds. Later today, I am going to try an organization scan to see if the issue occurs when scanning at that level, as well as tweaking the number of days of tags to keep. I've attached a screenshot with my current settings, so hopefully this helpful for whoever decides to take this on. I will also take a look at the code this afternoon, but it's been a while since I've worked with Java, so I don't know how much I'll be able to help. Thanks in advance! cc: rsandell , bitwiseman

          BTW: There's also no log retention setting in the generated sub jobs, which results in long living branches, like master, keeping their history forever.

          Dirk Heinrichs added a comment - BTW: There's also no log retention setting in the generated sub jobs, which results in long living branches, like master , keeping their history forever.

          Denys Digtiar added a comment -

          As far as I understand, this works as expected. A Build Strategy is responsible for the decision whether to build a newly discovered Tag Pipeline or not. The default strategy is not to build. The "Tags" build strategy changes the default to build but can be configured to ignore old or new tags.

          For the tags not to be discovered or to be skipped in the first place the "Discover Tags" behavior of the Github Branch Source plugin needs to be extended or an extra plugin developed that adds a tag filter behavior.

          Denys Digtiar added a comment - As far as I understand, this works as expected. A Build Strategy is responsible for the decision whether to build a newly discovered Tag Pipeline or not. The default strategy is not to build. The "Tags" build strategy changes the default to build but can be configured to ignore old or new tags. For the tags not to be discovered or to be skipped in the first place the "Discover Tags" behavior of the Github Branch Source plugin needs to be extended or an extra plugin developed that adds a tag filter behavior.

          OK, maybe I need to clarify further. I'm referring to tags that have actually been built. As opposed to branches, tags will most likely not go away again, so a multibranch pipeline collects subjobs for all the tags it has ever built. My request is that jobs for those tags that would now be ignored because of their age be removed again.

          Dirk Heinrichs added a comment - OK, maybe I need to clarify further. I'm referring to tags that have actually been built. As opposed to branches, tags will most likely not go away again, so a multibranch pipeline collects subjobs for all the tags it has ever built. My request is that jobs for those tags that would now be ignored because of their age be removed again.

          Another two months have passed and we're still collecting endless numbers of tag subjobs per multibranch pipeline. Any news here?

          Dirk Heinrichs added a comment - Another two months have passed and we're still collecting endless numbers of tag subjobs per multibranch pipeline. Any news here?

            Unassigned Unassigned
            dhs Dirk Heinrichs
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: