What is the primary purpose of the Branch Discovery trait in Jenkins Multibranch Pipeline jobs?
Think about how Jenkins finds branches to build automatically.
The Branch Discovery trait tells Jenkins to scan the source repository and create jobs for each branch it finds. This enables automatic building of new branches without manual job creation.
Given a Jenkins Multibranch Pipeline configured with Branch Discovery trait set to Discover branches that are also filed as PRs, what will Jenkins do when scanning the repository?
Focus on the meaning of 'also filed as PRs'.
This setting tells Jenkins to create jobs only for branches that have an associated open pull request, ignoring other branches.
Which configuration snippet correctly excludes branches named feature/temp-* from being discovered in Jenkins Multibranch Pipeline?
Think about how to exclude branches by name using traits.
The Filter by name (with wildcards) trait allows excluding branches matching a pattern by setting the exclude option. This prevents Jenkins from discovering those branches.
You notice that some branches are not appearing as jobs in your Jenkins Multibranch Pipeline scan. Which of the following is the most likely cause?
Consider how Branch Discovery settings affect which branches are found.
If Branch Discovery is set to discover only branches with open pull requests, branches without PRs will not be created as jobs, causing them to be missing.
You manage a Jenkins Multibranch Pipeline for a large repository with hundreds of branches. To reduce load, you want Jenkins to discover only branches that have been updated in the last 7 days. Which approach best achieves this?
Think about how to control build execution based on branch update time.
Jenkins Branch Discovery does not support filtering branches by last update date. Using a script in the Jenkinsfile to skip builds for old branches is the best way to reduce load while still discovering all branches.