0
0
Jenkinsdevops~20 mins

Branch indexing and scanning in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Branch Indexing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens during branch indexing in Jenkins Multibranch Pipeline?

In Jenkins Multibranch Pipeline, what is the main purpose of branch indexing?

AIt runs all the builds for every branch found in the repository.
BIt deletes old build artifacts from all branches to save disk space.
CIt scans the source repository to discover branches and creates jobs for each branch.
DIt merges all branches into the main branch automatically.
Attempts:
2 left
💡 Hint

Think about what Jenkins needs to do before it can build branches.

💻 Command Output
intermediate
2:00remaining
Output of branch indexing scan log in Jenkins

What output would you expect to see in Jenkins logs after a successful branch indexing scan?

Jenkins
Started branch indexing
Found branches: feature1, bugfix2
Created jobs for branches
Finished branch indexing
ADeleted old branches\nCleaned workspace
BError: No branches found\nBranch indexing aborted
CStarted build for branch feature1\nBuild successful
DStarted branch indexing\nFound branches: feature1, bugfix2\nCreated jobs for branches\nFinished branch indexing
Attempts:
2 left
💡 Hint

Look for messages about scanning and job creation, not building or errors.

Configuration
advanced
2:00remaining
Configuring branch indexing frequency in Jenkins Multibranch Pipeline

Which configuration snippet correctly sets branch indexing to run every 15 minutes in a Jenkinsfile?

Aproperties([pipelineTriggers([cron('H/15 * * * *')])])
Btriggers { cron('*/15 * * * *') }
Coptions { timeout(time: 15, unit: 'MINUTES') }
Dpipeline { triggers { pollSCM('H/15 * * * *') } }
Attempts:
2 left
💡 Hint

Branch indexing frequency is set via pipeline triggers with cron syntax.

Troubleshoot
advanced
2:00remaining
Why does Jenkins fail to detect new branches during indexing?

After adding new branches to the repository, Jenkins Multibranch Pipeline does not detect them during branch indexing. What is a likely cause?

AThe Jenkinsfile in the new branches contains syntax errors.
BThe repository credentials used by Jenkins lack read permission for the new branches.
CThe build triggers are set to manual only.
DThe Jenkins server is running out of disk space.
Attempts:
2 left
💡 Hint

Think about access rights Jenkins needs to see branches.

🔀 Workflow
expert
3:00remaining
Order the steps Jenkins performs during branch indexing and scanning

Put the following Jenkins branch indexing steps in the correct order.

A1,2,3,4
B1,3,2,4
C2,1,3,4
D3,1,2,4
Attempts:
2 left
💡 Hint

Think about discovery first, then job creation, then triggers, then finishing.