Skip to main content
Turn SonarQube quality gate failures from blockers into background work. This automation listens for quality-gate-failed events on pull requests, pulls the issue breakdown from SonarQube, fixes the reported code smells and bugs, and pushes a commit to the same branch — so the gate goes green without developer intervention.

Use this template

Open SonarQube Quality Gate Fix in Devin and create the automation with the default configuration. You can customize it before saving.

What this automation does

SonarQube is great at finding issues; acting on them is the slow part. The SonarQube MCP gives Devin full access to the issue report, so it can work through each finding in order — fixing genuine bugs, refactoring code smells, and removing duplicate code — then re-running the scan to confirm the gate is green.

How it works

Trigger: Github eventcheck.run
  • Event: github:check_run
    • Conditions:
      • action eq completed
      • check_run.conclusion eq failure
      • check_run.name contains sonar
      • repository.full_name eq your-org/your-repo
What Devin does: Starts a session with full event context, executes the prompt below, and (optionally) notifies you on failure.

Prerequisites

Example prompt

The template ships with this prompt. You can edit it after clicking Use template, or leave it as-is.

Setting it up

  1. Open Automations → Templates in Devin.
  2. Click SonarQube Quality Gate Fix. The create page opens with this template pre-filled.
  3. Connect any required integrations and install MCP servers if you haven’t already.
  4. Replace any placeholder values in the trigger conditions (for example, swap your-org/your-repo for your actual repo).
  5. Review the prompt and adjust it for your team’s language, conventions, and guardrails.
  6. Click Create automation.
Most automation templates include suggested ACU and invocation limits to bound cost during early rollout. Keep them as-is until you’re confident in the automation’s behavior, then raise them to fit your workload.

When to use this template

  • Enterprises with mandatory SonarQube quality gates in CI
  • Legacy codebases with high debt that need incremental cleanup
  • Teams that want quality discipline without the friction
  • Onboarding new repos onto stricter quality gates gradually

Customization ideas

  • Scope to specific projects, profiles, or rule sets
  • Tune which rule categories trigger the automation
  • Combine with Code Pattern Enforcer for custom team-specific patterns
  • Chain with CI Failure Fixer for full CI coverage

See also