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

Inability to control orphaned item strategy on multibranch children of an organization folder

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • branch-api-plugin
    • None

      If you create an organization folder, you can define an orphaned item strategy in its configuration screen, but this applies to the organization folder itself—in other words, whether and when its direct children (multibranch projects) may be deleted. All of the multibranch projects, which are unconfigurable, have a predefined new DefaultOrphanedItemStrategy(true, "0", "0"): delete obsolete branch projects immediately.

      It would be useful to be able to define the policy to be applied at this lower level. Could for example be an additional selector for the children's policy.

      Or at a minimum, the policy defined at the organization level should be assumed to carry over: disable deletion entirely if requested; if requested but using a nonzero daysToKeep, use the same value. (Not sure it makes sense to interpret organization-level numToKeep as that would be counting repositories, not branches, which might have entirely different typical values.)

          [JENKINS-33819] Inability to control orphaned item strategy on multibranch children of an organization folder

          Jesse Glick created issue -

          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-33637 [ JENKINS-33637 ]

          Tim Gourley added a comment -

          I think the analysis is incorrect in that the code in question "new DefaultOrphanedItemStrategy(..)" does not appear to be located in the branch-api-plugin.
          I suspect that code is in the cloudbees-folder-plugin.

          For background - this issue was reported against "Jenkins ver. 1.642.3.2 (CloudBees Jenkins Enterprise 15.11)" which uses "Branch API Pulugin" 1.5, and "CloudBees Folders Plus Plugin" 3.0. "CloudBees Folders Plus Plugin" version 3.0 appears to be pre-open source so I cannot analyze further.

          Tim Gourley added a comment - I think the analysis is incorrect in that the code in question "new DefaultOrphanedItemStrategy(..)" does not appear to be located in the branch-api-plugin. I suspect that code is in the cloudbees-folder-plugin. For background - this issue was reported against "Jenkins ver. 1.642.3.2 (CloudBees Jenkins Enterprise 15.11)" which uses "Branch API Pulugin" 1.5, and "CloudBees Folders Plus Plugin" 3.0. "CloudBees Folders Plus Plugin" version 3.0 appears to be pre-open source so I cannot analyze further.
          Manuel Recena Soto made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ] New: Manuel Recena Soto [ recena ]
          Manuel Recena Soto made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          James Brown made changes -
          Priority Original: Major [ 3 ] New: Blocker [ 1 ]

          Jesse Glick added a comment -

          OSS cloudbees-folder is involved here, not proprietary cloudbees-folders-plus.

          Jesse Glick added a comment - OSS cloudbees-folder is involved here, not proprietary cloudbees-folders-plus .

          Jesse Glick added a comment -

          Fix should be simple: an extra OrphanedItemStrategy in the OrganizationFolder config, with compatibility for existing folders of course.

          Jesse Glick added a comment - Fix should be simple: an extra OrphanedItemStrategy in the OrganizationFolder config, with compatibility for existing folders of course.

          jglick why not use the same OrphanedItemStrategy in ComputedFolder and pass it to MultiBranchProjectFactory.createProject? (like it is done with any other configuration option in SCMSource, like includes/excludes, credentials, etc)

          Antonio Muñiz added a comment - jglick why not use the same OrphanedItemStrategy in ComputedFolder and pass it to MultiBranchProjectFactory.createProject ? (like it is done with any other configuration option in SCMSource , like includes/excludes, credentials, etc)

            recena Manuel Recena Soto
            jglick Jesse Glick
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: