Courseiva
SDLC AutomationmediumMultiple ChoiceObjective-mapped

DOP-C02 SDLC Automation Practice Question

A company uses AWS CodePipeline with a multi-branch strategy. Developers push to feature branches, which should trigger a pipeline that runs unit tests and then deploys to a staging environment. However, the pipeline only triggers on the main branch. What should be done to enable pipeline execution for feature branches?

⚠ Common exam trap

A common mix-up: candidates assume polling or changing the source provider will automatically detect new branches, but AWS CodePipeline's polling only monitors the configured branch reference (e.g., 'refs/heads/main'), not all branches, and changing the source provider does not alter this behavior.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Update the source stage to use 'Webhook' as the change detection method and specify a branch pattern.

AWS CodePipeline can use a webhook (e.g., from GitHub or CodeCommit) to detect changes on any branch. By configuring the source stage with 'Webhook' as the change detection method and specifying a branch pattern (e.g., 'feature/*'), the pipeline will automatically trigger on pushes to matching feature branches, not just the main branch.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Change the source provider from Amazon S3 to AWS CodeCommit.

    Why it's wrong here

    Switching the source provider to AWS CodeCommit alone does not enable branch-aware triggering. CodePipeline still requires explicit configuration, such as a webhook or polling rule, to detect changes on a specific branch. Since the current pipeline likely points to a single branch, merely changing the repository type will not create per-branch triggers, and no branch pattern would be applied automatically.

  • Increase the polling frequency in the source stage to detect new branches.

    Why it's wrong here

    Increasing polling frequency only checks the existing source configuration at shorter intervals; it does not teach the pipeline about new branches. Polling queries the specific branch defined in the source stage, so feature branches that are not configured remain invisible. Moreover, polling is resource-intensive and adds latency compared to event-driven webhooks, making this approach both inefficient and ineffective for multi-branch discovery.

  • Create a separate pipeline for each feature branch.

    Why it's wrong here

    Creating a separate pipeline for each feature branch multiplies infrastructure and maintenance overhead without adding intelligence. Every new branch would require manual pipeline creation, and the approach does not provide a single unified view of branch status. It also fails to leverage CodePipeline's built-in filtering capabilities, making it a brittle and non-scalable solution compared to a single pipeline with branch-pattern webhooks.

  • Update the source stage to use 'Webhook' as the change detection method and specify a branch pattern.

    Why this is correct

    Configuring the source stage to use Webhook change detection with a branch pattern, such as refs/heads/feature/*, makes the pipeline automatically respond to pushes on matching feature branches. This allows a single pipeline to serve multiple branches by filtering events based on the branch reference, without manual per-branch pipelines. The webhook sends an event to CodePipeline only when the push matches the pattern, enabling efficient and dynamic multi-branch execution.

About these practice questions

This DOP-C02 question is part of Courseiva's 251-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.