Interview Prep/Jenkins/SCM, multibranch & webhooks

PR builds show the wrong code: a fix pushed to the target branch is missing in PR merge builds

AdvancedTroubleshootingSCM, multibranch & webhooks
Answer

Likely causes → The merge build uses the target revision recorded at indexing time; the PR was not re-indexed after the target changed, or "Discover pull requests" uses the head strategy.

Diagnose → Check build log for Merging remotes/origin/main commit <sha> and compare with the current main head.

Fix → Re-run the PR build after a scan; enable rebuilding PRs when the target branch changes (GitHub Branch Source can trigger on target changes if events are delivered) or rebase the PR.

Prevent → Merge queue or require branches to be up to date in branch protection.

All Jenkins questions Roadmap: Jenkins

More on SCM, multibranch & webhooks