A 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?
IntermediateScenarioShared libraries & multibranch
Answer
Situation read → Organization folder use case.
What I'd do →
- Create a GitHub Organization folder with a GitHub App credential, defined in JCasC/Job DSL (
organizationFolder('acme') { organizations { github { repoOwner('acme') ... } } }). - Discover repos with a
Jenkinsfile, branches excluding PR branches, PRs merged with target, forks trusted only from collaborators. - Configure an org-level webhook to
/github-webhook/. - Apply folder-level credentials and permissions for the org.
- Set orphaned item strategy and a periodic scan (1 day) as backup.
Why → New repos are picked up automatically and builds start on the first push.
Interview tip → Mention GitHub App rate limits as the reason not to use a personal token at this scale.
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?BeginnerPRs from forks must be built, but the security team is worried about secrets. How do you configure it?Advanced