Interview Prep/Jenkins/Shared libraries & multibranch

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 →

  1. Set branch discovery to "Exclude branches that are also filed as PRs".
  2. Keep PR discovery with "merge with target".
  3. 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.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries & multibranch