I have a multibranch pipeline. All branches have the same pipeline definition (via https://plugins.jenkins.io/inline-pipeline/ ) that includes both scm and cron triggers for good reasons.
Branches are obsolete at some point, and all future builds will fail, also for good reasons. There will be no SCM changes anymore, but the cron trigger still fires.
Is there a way to skip builds, or configure the multibranch project (branch properties?) in some way that will stop obsolete branches from building without deleting the corresponding project and all past builds in Jenkins?
I do not want to delete a branch's project, nor do I want that branch's old builds to get deleted, so excluding the branch from branch discovery is not an option.
I do not think this is possible currently. TimerTrigger is defined in core and so could not check jenkins.branch.Branch.Dead. Probably branch-api should define a QueueDecisionHandler.
Filed as requested by jglick