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 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)

          Manuel Recena Soto added a comment - - edited

          Well, a proposal is underway....

          Manuel Recena Soto added a comment - - edited Well, a proposal is underway....

          Jesse Glick added a comment -

          amuniz possible of course, but see last sentence in description.

          Jesse Glick added a comment - amuniz possible of course, but see last sentence in description.

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/b4f2bffd2659a6004bf932553f0b3059ce5ff1c0
          Log:
          JENKINS-33819 Setter method for orphanedItemStrategy field

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/b4f2bffd2659a6004bf932553f0b3059ce5ff1c0 Log: JENKINS-33819 Setter method for orphanedItemStrategy field

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/47b0815db904ba7a0530a483267598247179b1a8
          Log:
          Merge pull request #61 from recena/JENKINS-33819

          JENKINS-33819 New API to set the OrphanedItemStrategy field

          Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/adf523e258b2...47b0815db904

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/com/cloudbees/hudson/plugins/folder/computed/ComputedFolder.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/47b0815db904ba7a0530a483267598247179b1a8 Log: Merge pull request #61 from recena/ JENKINS-33819 JENKINS-33819 New API to set the OrphanedItemStrategy field Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/adf523e258b2...47b0815db904

          Code changed in jenkins
          User: Manuel Recena
          Path:
          pom.xml
          src/main/java/jenkins/branch/OrganizationFolder.java
          http://jenkins-ci.org/commit/branch-api-plugin/69c71324cc76beba244b7b7691c5ab6a1eacd9fc
          Log:
          JENKINS-33819 OrphanedItemStrategy is propagated to the Multibranch projects

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: pom.xml src/main/java/jenkins/branch/OrganizationFolder.java http://jenkins-ci.org/commit/branch-api-plugin/69c71324cc76beba244b7b7691c5ab6a1eacd9fc Log: JENKINS-33819 OrphanedItemStrategy is propagated to the Multibranch projects

          Code changed in jenkins
          User: Manuel Recena
          Path:
          pom.xml
          http://jenkins-ci.org/commit/branch-api-plugin/645e311514627b6236b1ba37e28d4ccc70001f0e
          Log:
          JENKINS-33819 Updated dependency. Downstream of this PR

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: pom.xml http://jenkins-ci.org/commit/branch-api-plugin/645e311514627b6236b1ba37e28d4ccc70001f0e Log: JENKINS-33819 Updated dependency. Downstream of this PR

          Code changed in jenkins
          User: Manuel Recena
          Path:
          pom.xml
          src/main/java/jenkins/branch/OrganizationFolder.java
          http://jenkins-ci.org/commit/branch-api-plugin/a8f94df35aa6969994903474941b0dd6057dfdd4
          Log:
          Merge pull request #41 from recena/JENKINS-33819

          JENKINS-33819 OrphanedItemStrategy is propagated to the Multibranch projects

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/063015e37bdb...a8f94df35aa6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: pom.xml src/main/java/jenkins/branch/OrganizationFolder.java http://jenkins-ci.org/commit/branch-api-plugin/a8f94df35aa6969994903474941b0dd6057dfdd4 Log: Merge pull request #41 from recena/ JENKINS-33819 JENKINS-33819 OrphanedItemStrategy is propagated to the Multibranch projects Compare: https://github.com/jenkinsci/branch-api-plugin/compare/063015e37bdb...a8f94df35aa6

          Both plugins involved in this fix have been release:

          1. branch-api 1.8
          2. cloudbees-folder 5.10

          If you upgrade to the newest version of branch-api, the bug will be fixed.

          Manuel Recena Soto added a comment - Both plugins involved in this fix have been release: branch-api 1.8 cloudbees-folder 5.10 If you upgrade to the newest version of branch-api, the bug will be fixed.

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

              Created:
              Updated:
              Resolved: