Professional Cloud DevOps Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Last updated
Your DevOps engineering team is configuring an automated continuous integration pipeline using Cloud Build for an application repository hosted on GitLab.
You must configure a Cloud Build trigger that meets the following criteria:
release/v1.0 or release/v2.4./gcbrun comment command before a build executes.How should you configure the Cloud Build trigger?
Set the trigger Event to 'Pull request', specify the branch filter with a PCRE lookahead pattern, configure Comment control to 'Required' for all contributors, and set the trigger region to 'global'.
Set the trigger Event to 'Push to a branch', configure the branch pattern as 'release/v*.*', set Comment control to 'Not required', and set the trigger region to 'global'.
Set the trigger Event to 'Pull request', specify the target branch regex as '^release/v[0-9]+.[0-9]+$' using RE2 syntax, select 'Required except for owners and collaborators' for Comment control, and ensure the trigger region matches the repository connection region.
Set the trigger Event to 'Pull request', specify the target branch regex as '^release/v[0-9]+.[0-9]+$', configure Comment control to 'Not required', and create an Eventarc trigger to route merge request webhooks.
Set the trigger Event to 'Pull request', specify the branch filter with a PCRE lookahead pattern, configure Comment control to 'Required' for all contributors, and set the trigger region to 'global'.
Set the trigger Event to 'Push to a branch', configure the branch pattern as 'release/v*.*', set Comment control to 'Not required', and set the trigger region to 'global'.
Set the trigger Event to 'Pull request', specify the target branch regex as '^release/v[0-9]+.[0-9]+$' using RE2 syntax, select 'Required except for owners and collaborators' for Comment control, and ensure the trigger region matches the repository connection region.
Cloud Build triggers integrated with external version control systems like GitLab and GitHub automate build execution based on repository events such as branch pushes, tag creations, or pull and merge requests. When connected via Developer Connect or 2nd generation repository connections, triggers utilize RE2 regular expression syntax to filter target branches or tags and offer granular comment control settings to safeguard build environments against unverified code execution.
^release/v[0-9]+\.[0-9]+$ accurately matches branches formatted as release/v1.0 or release/v2.4 while preventing accidental invocation from non-matching feature branches.Required except for owners and collaborators allows trusted project members to trigger builds automatically on merge requests while forcing external contributors' merge requests to wait until an authorized collaborator reviews the changes and comments /gcbrun.This configuration directly satisfies all operational, security, and architectural constraints by combining native RE2 branch targeting, regional alignment, and automated collaborator comment gating without introducing third-party webhook middleware.
Set the trigger Event to 'Pull request', specify the target branch regex as '^release/v[0-9]+.[0-9]+$', configure Comment control to 'Not required', and create an Eventarc trigger to route merge request webhooks.