Interview Prep/Jenkins/Integrations & delivery

The SonarQube quality gate step waits until timeout on every build, even though analysis completes. Design the correct integration.

IntermediateScenarioIntegrations & delivery
Answer

Situation read → SonarQube is not calling back Jenkins.

What I'd do →

  1. Configure a SonarQube webhook to https://jenkins.example.com/sonarqube-webhook/ (trailing slash), with a secret matching the Jenkins Sonar server config.
  2. Ensure network connectivity from SonarQube to Jenkins.
  3. Keep waitForQualityGate in the same build after withSonarQubeEnv, with timeout(time: 10, unit: 'MINUTES').
  4. Run the gate step outside the agent pod if possible to avoid holding resources.

Why → The step is event-driven; without the webhook it only times out.

Interview tip → Mention report-task.txt linking the analysis to the build.

All Jenkins questions Roadmap: Jenkins

More on Integrations & delivery