A developer with write access pushed a change straight to main, skipping peer review, and it deployed. Which control BEST prevents this from recurring?
Show the answer
Correct answerA. Require pull requests with approvals and passing status checks on main
AWhy this is right: Branch protection blocks direct pushes and forces review and checks before changes reach main.
BWhy not this: A canary limits blast radius after release but does not prevent unreviewed code reaching main.
CWhy not this: A linter checks style and rule violations but does not stop a direct push that skips review.
DWhy not this: Nightly regression tests detect broken behavior later and do not enforce review of changes.
Branch protection rules on main block direct pushes and require reviewed pull requests with passing checks before merging. A linter or tests inspect code but do not stop someone bypassing review, and a canary only limits exposure after deployment.