Interview Prep/CI/CD/Builds, Artifacts, Nexus, SonarQube and Testing

The SonarQube quality gate must block merging PRs that add new bugs, vulnerabilities or uncovered code.

IntermediateScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Gate on new code, not the legacy backlog.

What I'd do →

  1. Define the gate on "Clean as You Code" conditions: no new bugs/vulnerabilities, coverage on new code at least 80%, duplications on new code under 3%.
  2. In CI run the scanner with -Dsonar.qualitygate.wait=true so the step fails on a failed gate.
  3. Decorate the PR and make the Sonar check required.

Why → New-code gating prevents debt from growing without demanding a big-bang cleanup.

Interview tip → Mention "Clean as You Code".

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing