jenkinsci / jenkinsci/branch-api-plugin

[JENKINS-63817] buildStrategies are not set when using jobDSL,

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

Description

Given this jobDSL definition:

multibranchPipelineJob("${args.jobName}") {

description("Multibranch job")
branchSources{
branchSource {
source {
github {
id("${args.jobName}-gh-branches-1")
scanCredentialsId("####")
checkoutCredentialsId("####")
repoOwner('####')
repository("${args.repositoryName}")

includes("main jira-*")
}
}
buildStrategies {
includeRegionBranchBuildStrategy {
includedRegions("${args.project}/**")
}
}
}
}
factory {
workflowBranchProjectFactory {
scriptPath("${args.project}/Jenkinsfile")
}
}
}


The generated jobs have no build strategy set:

The multibranch-build-strategy-extension plugin is installed (same result using strategies from basic-branch-build-strategies plugin) and I can manually add the strategy.

---
Originally reported by aitorpazos, imported from: buildStrategies are not set when using jobDSL,


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

Raw content of original issue

Given this jobDSL definition:



multibranchPipelineJob("${args.jobName}") {

description("Multibranch job")
branchSources{
branchSource {
source {
github {
id("${args.jobName}-gh-branches-1")
scanCredentialsId("####")
checkoutCredentialsId("####")
repoOwner('####')
repository("${args.repositoryName}")

includes("main jira-*")
}
}
buildStrategies {
includeRegionBranchBuildStrategy {
includedRegions("${args.project}/**")
}
}
}
}
factory {
workflowBranchProjectFactory {
scriptPath("${args.project}/Jenkinsfile")
}
}
}



The generated jobs have no build strategy set:

The multibranch-build-strategy-extension plugin is installed (same result using strategies from basic-branch-build-strategies plugin) and I can manually add the strategy.

1 attachment

- [image-2020-09-30-09-33-41-452.png](https://issues.jenkins.io/secure/attachment/52728/image-2020-09-30-09-33-41-452.png)
> ![image-2020-09-30-09-33-41-452.png](https://issues.jenkins.io/secure/attachment/52728/image-2020-09-30-09-33-41-452.png)

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.