A team's multibranch job builds every push to every branch, including `dependabot/*` branches that also have PRs. Builds double. Fix.
BeginnerScenarioShared libraries & multibranch
Answer
Situation read → Branch discovery is set to "All branches".
What I'd do →
- Set branch discovery to "Exclude branches that are also filed as PRs".
- Keep PR discovery with "merge with target".
- Optionally filter out
dependabot/*branch builds with a name filter and rely on their PR builds.
Why → Each change is built once in the form that matters (the PR merge result).
Interview tip → Explain why merge strategy tests what will land on main.
More on Shared libraries & multibranch
A shared library change merged to `main` broke 200 pipelines within minutes. How do you prevent a repeat?IntermediateYou want to test a library branch against a real app pipeline without affecting anyone. How?BeginnerEvery app repo has its own pod YAML for builds, and they all drift. How do you standardize?IntermediateSecurity wants every pipeline to run a secret scan, even if teams forget to add it. How?AdvancedA multibranch project has 600 stale branch jobs and the folder page takes 30 seconds to load. What do you do?BeginnerA new org with 150 repositories wants Jenkins builds for every repo with a Jenkinsfile, without tickets to the platform team. What do you set up?Intermediate