A multibranch project has 600 stale branch jobs and the folder page takes 30 seconds to load. What do you do?
BeginnerScenarioShared libraries & multibranch
Answer
Situation read → Orphaned branches are kept forever, and old builds are not discarded.
What I'd do →
- Set the orphaned item strategy to discard old items: days to keep 7, max 20.
- Add
buildDiscarder(logRotator(numToKeepStr: '10'))in the Jenkinsfile. - Filter discovery to relevant heads (
main,release/*, PRs) with a wildcard filter. - Run Scan Repository Now to apply the cleanup.
Why → Each job and build directory is loaded into memory; fewer items means faster UI and smaller heap.
Interview tip → Mention coordinating with teams before deleting release branch history.
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 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?IntermediatePRs from forks must be built, but the security team is worried about secrets. How do you configure it?Advanced