Dev48
Language
  • About
  • Services
  • Industries
  • Technologies
  • Articles
  • Contacts
Book a call
    Home/Articles/How we cleared our backlog with sonarqube remediation agent
Dev48
info@dev48.org+375 29 320-40-96WhatsApp@isky_by

© 2026 · All rights reserved.

How we cleared our backlog with SonarQube Remediation Agent

Source: SonarSource•November 23, 2026 at 11:30 PM

How we cleared our backlog with SonarQube Remediation Agent

We used SonarQube Remediation Agent to fix 2,447 backlog issues in two weeks. Every fix was verified with SonarQube, and 64% of merges happened automatically.

Every engineering team has a backlog of known issues, and most have carried it for years. Fixing it has always meant a tradeoff: time spent on old issues is time not spent on new work, and the fixes usually lose.

You no longer have to accept that tradeoff, and the timing matters. AI is making it easier to find and exploit weaknesses in code, which makes a backlog of known issues a bigger risk than it used to be. Teams need a zero-tolerance approach to the issues they already know about. Guided reasoning agents make that possible, because they don’t just write fixes. They verify them.

Here’s how that worked when we pointed two agents at our own backlog.

In two weeks, SonarQube Remediation Agent and Gitar, Sonar’s code review agent, helped us fix 2,447 issues across three core repositories at Sonar. Every fix was verified with SonarQube analysis before a pull request (PR) was opened. Of the PRs that merged, 64% went through without human intervention, under approval rules our engineers set in advance. Before we turned on automatic merging, we tested Gitar’s judgment in one repository. Engineers merged every PR Gitar approved and closed a couple it flagged for human review. That gave the team the confidence to let low-risk fixes merge on their own. None of the auto-merged PRs has been reverted.

Below, we walk through how each fix gets verified, how we built confidence in automatic merging, and how you can start with one repository.

The setup: one agent writes, the other reviews

Our workflow is built around SonarQube Remediation Agent and Gitar. Remediation Agent groups backlog issues by the kind of fix they need. If the same issue appears in several files, the agent can fix those occurrences together in one PR. Unrelated fixes go in separate PRs, so each PR contains one kind of change. A PR changes either test code or production code, never both.

We set Remediation Agent internally to run once an hour in each repository and open at most one PR per run. Each team also sets a limit on how many agent PRs can be open at once. Once a team reaches its limit, the agent waits until an existing PR is merged or closed. That keeps teams from being flooded with PRs and gives them time to investigate if something goes wrong.

Fix, verify, fix again

Why not just ask a coding assistant to fix the backlog? It can write a fix. The hard part is proving the fix is right: that it clears the issue, doesn’t create new ones, keeps the build and tests passing, and holds up under review. Without that proof, an engineer still has to check every change by hand, and that’s the work that kept the backlog growing. Our workflow checks each fix at every step and sends it back for another round when it falls short.

Verification starts before a PR exists. Remediation Agent applies each fix in a sandbox and verifies it with SonarQube analysis. It rejects any fix that doesn’t clear the issue or that adds new ones. That gives every fix two independent checks before it can merge: SonarQube confirms the issue is gone and no new ones were added, and Gitar judges whether the change is safe in the context of the code around it.

Remediation Agent then opens a PR and starts monitoring its CI checks. If a check fails, the agent reads its output. If the code needs a change, the agent can make it and run the checks again. If the failure points to a flaky test or an infrastructure problem, it can retry the job without changing the code. The PR is ready only when the build, automated tests and all other required CI checks pass.

Once the checks pass, Gitar reviews the changes. Gitar can approve the PR, ask for a revision, or leave the decision to an engineer. If Gitar asks for a revision, Remediation Agent updates the code and replies on the PR. Gitar then reviews the new version and the process repeats. No engineer has to steer that exchange, and the agent that writes the code never approves its own work.

By the time a fix reaches the merge step, it has cleared SonarQube analysis, every required CI check, and an independent review. If a later commit changes the PR, the checks run again.

Remediation Agent writes the fix. SonarQube verifies it, and Gitar reviews it. Even with Gitar’s approval, the PR stays open until every required check passes and every review thread is resolved. An engineer reviews medium- and high-risk changes.

How we put PR approval and merge in the agents’ hands

We let Gitar approve changes based on the risk of the fix, not the severity of the issue it addresses. To assess that risk, Gitar looks at how the changed code is used and whether the fix could alter behavior elsewhere. We wrote approval criteria so that only PRs opened by Remediation Agent qualify. Gitar reviews the latest version of the PR, including any revisions it requested:

  • Low risk: Gitar can approve the PR without asking an engineer to review it.
  • Medium or high risk: an engineer decides whether to approve it.

Teams can keep merging PRs themselves after Gitar approves them. We chose to let the agents merge eligible PRs automatically. But approval alone isn't enough. Our branch protection rules still require the build, unit tests, integration tests, and every other required CI/CD check to pass, and every review thread to be resolved. The conditions are checked again on every push: if a new commit raises the risk, the earlier approval no longer counts.

Our criteria also stop Gitar from approving changes to GitHub Actions workflows or build scripts, even if it rates the PR as low risk. The agents can work on the code, but they can't approve changes that weaken or bypass the checks that code has to pass.

Here’s how that played out on one PR. Remediation Agent refactored three methods to fix three critical cognitive-complexity issues. Gitar rated the change low risk and merged it 35 minutes after it was opened, with no engineer involved.

Remediation Agent refactored three methods to fix three critical cognitive-complexity issues. SonarQube analysis confirmed all three issues were gone, Gitar rated the change low risk and merged it 35 minutes after it was opened, with no engineer involved.

Building confidence in autonomous merges

Before asking engineers to allow the agents to merge on their own, we made sure the PRs were easy to review. Remediation Agent handled CI failures and addressed Gitar’s feedback before handing a PR to an engineer. By then, the checks were green and the engineer could read Gitar’s review alongside the diff. Because each PR contained one kind of change, the engineer could understand the fix once, then scan for a place where it didn’t fit. Only 4% of the agent’s PRs that reached a decision were closed without being merged.

Easy reviews were only the first step. Engineers don’t hand merge decisions to an agent because someone asks them to. They do it once they’ve seen the agent make the same call they would make. So we built confidence in stages and let the results decide when to move to the next one:

  • Engineers approve and merge. Remediation Agent fixes and SonarQube verifies. People make every decision.
  • Gitar approves, engineers merge. Gitar approves low-risk PRs, and engineers compare its judgment with their own before they merge.
  • Gitar approves, the PR merges automatically. Low-risk PRs merge once every required check passes. Medium- and high-risk PRs still go to an engineer.

Teams can stay at any stage for as long as they need.

We ran the second stage first in one repository, the same way we suggest you start. Gitar automatically approved low-risk PRs, but engineers still decided whether to merge. They compared Gitar’s judgment with their own and merged every PR it had approved. They also closed a couple of the PRs Gitar flagged for human review. Every time Gitar approved a PR, the engineers agreed. After that dry run, the team turned on automatic merging for eligible PRs. None of the PRs that merged automatically has been reverted.

PRs that engineers merged stayed open for a median of about 42 hours. Almost all of that time was spent waiting for someone to pick them up. For PRs that Gitar merged, the median time from open to merge was 30 minutes.

Across the three repositories, 64% of merged PRs went through automatically without human involvement, and engineers merged another 32% that Gitar had approved as low risk.

Issues fixed by the agents over two weeks. What stands out is the difference in how quickly the backlog came down once automatic merging was switched on.

What slowed us down

Some PRs still needed an engineer’s attention. One reason was a CI failure unrelated to the fix. The agent could rerun a flaky test. It couldn’t fix an integration test that another change in the repository had broken. That code was outside its task, so the PR stayed open until an engineer could investigate.

Other PRs had green CI and Gitar’s approval but still needed reviews from several teams because they touched code with different owners. We’ve since changed how the agent groups fixes: files with different code owners now go into separate PRs. Each team can review and merge fixes to its own code without waiting for another team’s approval.

What’s next for us

Next, we’re extending this to higher-risk changes. We’re testing how much of that work the agents can do before asking for approval, and what evidence would justify automatic merging for some of those changes.

What you can try today

You can set up a similar workflow today with SonarQube Remediation Agent and Gitar. You'll need a Remediation Agent subscription on SonarQube Cloud or SonarQube Server 2026.5, plus a Gitar Pro or Enterprise plan for auto-approve and auto-merge. On SonarQube Cloud, Remediation Agent also fixes CI failures and answers review comments on GitHub. Start with one repository: schedule backlog fixes in SonarQube Cloud, set a limit on open agent PRs and use Gitar to review the changes. Compare its reviews with your own before deciding which PRs you’d let merge automatically. Tell us what you learn in the Sonar Community.

← All articles

What this article says

More in Software Development

All →
Beyond the UI: Architecting for intent-based orchestration
MuleSoft

Beyond the UI: Architecting for intent-based orchestration

Best LMS for Customer Education in 2026: Docebo vs. Absorb vs. Thinkific
Thinkific

Best LMS for Customer Education in 2026: Docebo vs. Absorb vs. Thinkific

Introducing Supabase Knowledge Base
Supabase

Introducing Supabase Knowledge Base

Cloud video helps schools scale safety and security
Milestone Systems

Cloud video helps schools scale safety and security

WooCommerce Shipping and Fulfillment: Setup, Your Options, and How ShipBob Plugs In
Shipbob

WooCommerce Shipping and Fulfillment: Setup, Your Options, and How ShipBob Plugs In

HTI-5 cut less than expected, but EHR data is about to become less uniform
Redox

HTI-5 cut less than expected, but EHR data is about to become less uniform

More from SonarSource

OAuth comes to the SonarQube Cloud-hosted MCP server
SonarSource

OAuth comes to the SonarQube Cloud-hosted MCP server

Automatic analysis for Bitbucket Cloud is now available
SonarSource

Automatic analysis for Bitbucket Cloud is now available

Delphi language support is now built into SonarQube
SonarSource

Delphi language support is now built into SonarQube

Inside Secretless Analysis: from CI identity to project-scoped access
SonarSource

Inside Secretless Analysis: from CI identity to project-scoped access

Java4Shell (CVE-2026-114938): Find affected Java in your container images
SonarSource

Java4Shell (CVE-2026-114938): Find affected Java in your container images

Why your software needs a CBOM
SonarSource

Why your software needs a CBOM