jenkinsci / jenkinsci/branch-api-plugin

[JENKINS-52683] Allow flexible source definition in WorkflowBranchProjectFactories

Open
#702 1 comment 0 reactions 0 assignees View on GitHub
component:branch-api-plugin component:workflow-multibranch-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'd like to write an extension which allows a different script path to be set for Tag type heads.

My use case is that my Branch type builds build, test and store artifacts ready for release/deploy. Only tag builds perform whatever is needed to release that artifact. Releasing can mean different things for different projects. For smaller projects, it's ok to have the entire pipeline run again with an additional release stage covered by a when directive checking for a tag. With a large project this is an unfortunate inefficiency. I would like to define a separate Jenkinsfile which just handles releasing the artifact previously built in the branch build.

 

I figure this can be possible by defining a new BranchProjectFactory, and using the createDefinition method to pick one Jenkinsfile for branch/pr and one for tags. The method would need to expose information about the head being built though. Perhaps passing through the Branch object would be helpful?

---
Originally reported by stevenfoster, imported from: Allow flexible source definition in WorkflowBranchProjectFactories


  • status: Open
  • priority: Minor
  • component(s): branch-api-plugin, workflow-multibranch-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251211-141027

Raw content of original issue

I'd like to write an extension which allows a different script path to be set for Tag type heads.

My use case is that my Branch type builds build, test and store artifacts ready for release/deploy. Only tag builds perform whatever is needed to release that artifact. Releasing can mean different things for different projects. For smaller projects, it's ok to have the entire pipeline run again with an additional release stage covered by a when directive checking for a tag. With a large project this is an unfortunate inefficiency. I would like to define a separate Jenkinsfile which just handles releasing the artifact previously built in the branch build.

 

I figure this can be possible by defining a new BranchProjectFactory, and using the createDefinition method to pick one Jenkinsfile for branch/pr and one for tags. The method would need to expose information about the head being built though. Perhaps passing through the Branch object would be helpful?

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.