• Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • branch-api-plugin
    • None

      Right now it seems not possible tho delete a pipeline project that is part of a multibranch pipeline project. There is no UI element to do it and appending /delete to the project url results in missing userrights for "Job/Delete".

          [JENKINS-35143] Delete Pipeline Multibranch sub projects

          Oleg Nenashev added a comment -

          It's not related to the core

          Oleg Nenashev added a comment - It's not related to the core

          Jesse Glick added a comment -

          As designed. This is a computed folder, so the contents are inferred from an external source of truth.

          It has been suggested that if your orphaned item strategy is configured to leave orphaned children undeleted for some time, you should have the option to delete a particular orphan eagerly.

          Deleting a non-orphaned child makes no sense, as it would simply be recreated with the next branch indexing.

          Jesse Glick added a comment - As designed. This is a computed folder, so the contents are inferred from an external source of truth. It has been suggested that if your orphaned item strategy is configured to leave orphaned children undeleted for some time, you should have the option to delete a particular orphan eagerly. Deleting a non-orphaned child makes no sense, as it would simply be recreated with the next branch indexing.

          Martin Heinzerling added a comment - - edited

          Maybe we also need a more sophisticated orphaned item strategy, just thinking of small feature branches vs. release branches which might have a different live time as a Jenkins project. An integrated feature branch might be dropped after 7-14 days, but a release branch after 3 releases which might be 6-8 weeks etc.

          Deleting a non-orphaned child makes no sense, as it would simply be recreated with the next branch indexing.

          It might make sense, if you are experimenting with the build/pipeline setup and want to drop the first 30 failing builds in your project to get nicer plots etc.

          Martin Heinzerling added a comment - - edited Maybe we also need a more sophisticated orphaned item strategy, just thinking of small feature branches vs. release branches which might have a different live time as a Jenkins project. An integrated feature branch might be dropped after 7-14 days, but a release branch after 3 releases which might be 6-8 weeks etc. Deleting a non-orphaned child makes no sense, as it would simply be recreated with the next branch indexing. It might make sense, if you are experimenting with the build/pipeline setup and want to drop the first 30 failing builds in your project to get nicer plots etc.

          Jesse Glick added a comment -

          want to drop the first 30 failing builds in your project

          You can already delete builds.

          Jesse Glick added a comment - want to drop the first 30 failing builds in your project You can already delete builds .

          Jesse Glick added a comment -

          Maybe we also need a more sophisticated orphaned item strategy

          Unrelated to this issue, but anyway note that more exotic strategies can be defined in separate plugins.

          Jesse Glick added a comment - Maybe we also need a more sophisticated orphaned item strategy Unrelated to this issue, but anyway note that more exotic strategies can be defined in separate plugins.

          By design, the only children you are allowed to delete are ones that have been orphaned by the backing SCM - otherwise they will just get recreated automatically on next scan.

          There was a bug in Pipeline Multibranch where the branch jobs that were orphaned would not expose the delete permission but that should have been fixed by https://github.com/jenkinsci/workflow-multibranch-plugin/commit/b2a46915ad0eea00ddd8c11c36ff3d29dfc0c524#diff-70d4cb71c24ac78397a2cae536830bf0

          Stephen Connolly added a comment - By design, the only children you are allowed to delete are ones that have been orphaned by the backing SCM - otherwise they will just get recreated automatically on next scan. There was a bug in Pipeline Multibranch where the branch jobs that were orphaned would not expose the delete permission but that should have been fixed by https://github.com/jenkinsci/workflow-multibranch-plugin/commit/b2a46915ad0eea00ddd8c11c36ff3d29dfc0c524#diff-70d4cb71c24ac78397a2cae536830bf0

          Andrew Hill added a comment - - edited

          What about when I update the Multibranch Pipeline configuration to exclude branches that have previously been found and included in the project, but which I now no longer want - but for which the branch is not yet ready to be deleted in SCM?

          It seems that the exclusion of the branch does not allow me to now have the branch removed from the project?

          Andrew Hill added a comment - - edited What about when I update the Multibranch Pipeline configuration to exclude branches that have previously been found and included in the project, but which I now no longer want - but for which the branch is not yet ready to be deleted in SCM? It seems that the exclusion of the branch does not allow me to now have the branch removed from the project?

          andrewatfornax When the branch is excluded it is then eligible for the Orphaned Item Strategy, e.g. for this screenshot

          I started off with the source configured for all branches, with a retention strategy of keep up to 1 branch.

          Then after all branches had been indexed I reconfigured the source to exclude the throw-away branch, on the subsequent index the branch becomes a "dead branch" and is now disabled. Once the orphaned item strategy is able to remove it, it will be automatically removed. Or I can preemptively delete it manually:

          Stephen Connolly added a comment - andrewatfornax When the branch is excluded it is then eligible for the Orphaned Item Strategy, e.g. for this screenshot I started off with the source configured for all branches, with a retention strategy of keep up to 1 branch. Then after all branches had been indexed I reconfigured the source to exclude the throw-away branch, on the subsequent index the branch becomes a "dead branch" and is now disabled. Once the orphaned item strategy is able to remove it, it will be automatically removed. Or I can preemptively delete it manually:

          Andrew Hill added a comment -

          Thanks - in which case, I was clearly not actually excluding the branch! That was where I was looking, but there was no option to delete the branch.

          Andrew Hill added a comment - Thanks - in which case, I was clearly not actually excluding the branch! That was where I was looking, but there was no option to delete the branch.

            recena Manuel Recena Soto
            mheinzerling Martin Heinzerling
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: