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

Orphaned Item Strategy is not working properly in multibranch job

XMLWordPrintable

      In this issue I will describe several misbehaviors:

       

      1. Default config is not working a expected

      When just enabling the feature as described in docs:

      The config part in job config.xml

        <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@6.16">
          <pruneDeadBranches>true</pruneDeadBranches>
          <daysToKeep>-1</daysToKeep>
          <numToKeep>-1</numToKeep>
        </orphanedItemStrategy>
      

      No pruning is happening ever and deleted branches are accumulated for ever. 

       

       

      2. Setting config options to 0 is showing errors

      I tried to make things work and got some experimentations. Trying to set days to keep and max # of old items to keep to 0, UI produces errors of not a positive integer.

      The config part in job config.xml:

       

        <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@6.16">
          <pruneDeadBranches>true</pruneDeadBranches>
          <daysToKeep>0</daysToKeep>
          <numToKeep>0</numToKeep>
        </orphanedItemStrategy>
      

       

      Saving this configuration make orphaned items to get deleted:

       

      Evaluating orphaned items in XX » YY
      Will not remove zz as XX » YY » zz #2 is marked to not be removed: This record is explicitly marked to be kept.
      Will not remove zzz as XX » YY » zzz #71 is marked to not be removed: This record is explicitly marked to be kept.
      Will not remove zzzz as XX » YY » zzzz #1 is marked to not be removed: This record is explicitly marked to be kept.
      Will not remove zzzzz as XX » YY » zzzzz #28 is marked to not be removed: This record is explicitly marked to be kept.
      Will remove z as it is #1 in the list
      

       

       

      3. Jenkins don't respect the 0,0 config above after restart of the jenkins service

       

      Even if the config is set to 0,0 I get in the UI the default config options and still get accumulating deleted branches.

       

       

      Probably all those are related to https://github.com/jenkinsci/cloudbees-folder-plugin/pull/106/commits/6c9061bd71f5a48f4131d54300957744d7f824d8 that should make things work with -1, -1 but this is not true 

       

       

            Unassigned Unassigned
            strimpak George Strimpakos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: