Currently, when the branch is deleted, the job always be deleted automatically.
I added a checkbox option to change this behavior.
If checked, the job will be disabled instead of deleted when the branch is deleted.
Yes, this would affect all manually disabled jobs.
But isn't removing forcing job enabling resolves this BC issue? Deleted jobs will be disabled instead of deleting and all other will be just untouched, right?
Thank you for your comments.
Yes, my PR affects all manually disabled jobs, but the jobs will be originally intended to be deleted when the branch is deleted. So I think this option does not affect. Would you please tell me what you think about it?
you do not understand the problem. jenkins allows to manually disable ''any'' job. it does not matter multibranch project or not. if branch exist and job was manually disabled (i.e. it fails and i do not want it to run this week) your patch will forcibly enable it back (and keep it enabled)
Add disable job option when the branch is deleted
Sorry, I misread your comments.
I added deletedBranches field to AbstractMultiranchProject for tracking deleted branches. It's used to distinguish whether the sub-project was disabled instead of deleted, so It does not affect disabled project manually (keep it disabled).
Also, I rebased my PR-branch against latest master branch.
Could you review my PR?
👍 looks OK, needs testing
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.
Support was added in 0.4 via inheritance of ComputedFolder API in Folders Plugin.