jenkinsci / jenkinsci/branch-api-plugin

[JENKINS-64970] It's not possible to prevent cron triggers via BranchProperty

Open
#757 0 comments 0 reactions 0 assignees View on GitHub
component:branch-api-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
39
Forks
154
PR merge metrics
No merged PRs in 30d

Description

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

---
Originally reported by danielbeck, imported from: It's not possible to prevent cron triggers via BranchProperty


  • status: Open
  • priority: Minor
  • component(s): branch-api-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 20251211-141027

Raw content of original issue

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.