mediumMultiple Choice
PMLE Practice Question: An ML engineer is using Cloud Build to trigger a…
An ML engineer is using Cloud Build to trigger a Vertex AI Pipeline on every commit to a repository. The pipeline takes 2 hours. The engineer wants to only run the pipeline when changes are made to specific directories. How can this be achieved?
⚠ Common exam trap
Test-takers frequently think a pipeline-level conditional check (Option E) is sufficient, but they overlook that Cloud Build triggers can filter at the trigger level, avoiding any pipeline startup cost for irrelevant changes.
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
✓
Configure Cloud Build trigger with included file globs
Cloud Build triggers support 'included file globs' and 'ignored file globs' to filter which file changes should invoke the trigger. By specifying glob patterns for the directories of interest, the trigger will only fire when commits modify files matching those patterns, avoiding unnecessary pipeline runs for unrelated changes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Cloud Composer to poll the repository periodically
Why it's wrong here
Cloud Composer polling introduces scheduled delay and duplicate state tracking instead of reacting to commit events, so directory-scoped triggering is not achieved. It is tempting because Composer orchestrates workflows well, and it would be correct for time-based batch pipelines rather than event-driven commit triggers.
- ✓
Configure Cloud Build trigger with included file globs
Why this is correct
Cloud Build triggers support included file globs, which restrict invocation to commits touching specified directories. This satisfies the constraint of running the two-hour Vertex AI Pipeline only when changes occur in particular paths, avoiding unnecessary executions.
- ✗
Use a Cloud Function to evaluate changes and invoke the pipeline
Why it's wrong here
A Cloud Function adds an extra invocation layer that must itself be triggered and inspect commits, rather than using Cloud Build's native trigger filtering. It is tempting because serverless glue is flexible, and it would be correct when the trigger source has no built-in path filter and custom logic is unavoidable.
- ✗
Modify the pipeline to ignore unrelated changes
Why it's wrong here
The pipeline itself runs after Cloud Build has already triggered it, so ignoring changes inside the pipeline still incurs the 2-hour execution. It is tempting because pipeline-level filtering feels centralised, and it would be correct if the pipeline were invoked manually and needed to skip irrelevant inputs.
- ✗
Add a conditional step in the pipeline to abort if no relevant changes
Why it's wrong here
A conditional abort step still starts the pipeline and consumes build minutes before evaluating changes, so the 2-hour run is not prevented. It is tempting because conditionals are a familiar pipeline pattern, and it would be correct when the pipeline must run but skip certain stages based on runtime data.
Go deeper
Related to this question
About these practice questions
One of 775 original PMLE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PMLE practice question is part of Courseiva's free Google Cloud 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 PMLE exam.