Skip to main content

Overview

Gitar automatically fixes code on your pull requests and merge requests — whether the issue comes from a CI failure, a code review finding, or a direct instruction in a comment. Instead of manually debugging build logs or addressing review feedback line by line, you get an immediate analysis and an automated fix, all within your PR/MR interface.

Root Cause Analysis

Instant breakdown of why CI failed, posted as a comment on your PR/MR

Automated Fixes

Gitar pushes code changes that resolve failures, review findings, and requested changes

Multi-Iteration

If a fix introduces a new failure, Gitar re-analyzes and attempts another fix automatically

Developer Control

Choose to auto-apply fixes, apply them selectively, or use the analysis as context for your own fix

What Gitar Can Fix

Gitar handles a wide range of issues on your PRs/MRs:
  • CI failures — Build errors, test failures, linting violations, and flaky tests
  • Code review findings — Security vulnerabilities, bugs, performance issues, and code quality problems identified during review
  • Requested changes — Instructions given via Gitar <instruction> comments on your PR/MR
  • Repository rule actions — Automated changes triggered by your configured repository rules

CI Failure Analysis

When CI fails on a PR/MR, Gitar automatically:
1

Analyze the failure

Gitar reads the CI logs, identifies the failing step, and determines the root cause of the failure.
2

Post an analysis comment

A detailed explanation of the failure is posted to the dashboard comment on your PR/MR, including which files and lines are involved.
3

Suggest or apply a fix

Depending on your auto-apply setting, Gitar either waits for your approval or pushes a fix commit directly to the branch.
The analysis appears in the Gitar dashboard comment on your PR/MR: The analysis covers your full CI pipeline output, so Gitar can diagnose failures across multiple jobs and steps in a single run.
Failure TypeExamples
Build errorsCompilation failures, missing imports, type errors
Test failuresBroken assertions, missing setup, incorrect expected values
Linting errorsCode style violations, formatting issues, static analysis warnings
Flaky testsRace conditions, timing issues, non-deterministic behavior

Fixes

Gitar can push fixes to your branch in several ways:
  • Auto-apply — When enabled, Gitar pushes fixes automatically without waiting for approval. Toggle with gitar auto-apply:on / gitar auto-apply:off.
  • Comment instructions — Comment Gitar <instruction> on your PR/MR to tell Gitar exactly what to fix. For example: Gitar fix the auth test by adding the missing Bearer token.
  • Code review findings — When auto-apply is enabled, Gitar also fixes issues identified during code review, not just CI failures.
See Dashboard & Commands for the full list of available commands.

Reviewing and Accepting Fixes

After Gitar posts its analysis, you have three options for how to proceed:
OptionHow
Let Gitar auto-fixCheck the [ ] Automatically accept suggestions checkbox in the Gitar dashboard comment. Gitar will push a fix commit to your branch.
Fix it yourselfUse the root cause analysis as context and push your own fix. Gitar updates its analysis when new commits arrive.
Request a targeted fixComment Gitar <specific instruction> on the PR/MR to tell Gitar exactly how you want the issue resolved.
Only users with write access to the repository can trigger Gitar to push fixes. This ensures that unauthorized users cannot modify your code through Gitar.

Controlling Auto-Apply

You can toggle automatic fix application at any time using commands in a PR/MR comment:
CommandDescription
gitar auto-apply:onEnable automatic fix application. Gitar will push fixes without waiting for approval.
gitar auto-apply:offDisable automatic fixes. Gitar will only post analysis and wait for your input.
The current auto-apply status is displayed in the Gitar dashboard comment:

Multi-Iteration Fixing

CI failures are not always resolved in a single pass. Gitar supports multi-iteration fixing:
  1. Gitar pushes a fix for the original CI failure.
  2. CI re-runs on the updated branch.
  3. If CI fails again (whether from the same issue or a newly introduced one), Gitar re-analyzes the new failure.
  4. Gitar attempts another fix, taking into account the full history of previous attempts.
This loop continues automatically until CI passes or Gitar determines it cannot make further progress. Each iteration builds on the context of previous attempts, so Gitar avoids repeating the same fix.
If Gitar is unable to resolve a failure after multiple iterations, it will post a summary of what was attempted so you have full context to debug manually.

Example Workflow

Here is an end-to-end example of Gitar fixing a CI failure on a pull request.
1

CI fails on the PR

A test failure is detected after pushing new commits. Gitar begins analyzing the CI logs.
2

Analysis is posted

Gitar posts a root cause analysis to the dashboard comment, identifying the failing test and the code change that caused it.
3

User enables auto-apply or comments

The developer either checks the auto-apply checkbox or comments with a specific instruction like Gitar fix the auth test by adding the missing Bearer token.
4

Fix is pushed

Gitar pushes a commit to the branch that addresses the failure.
5

CI re-runs and passes

CI runs again on the updated branch. The tests pass and the PR is ready to merge.
A user posts a request and CI has also failed: After a few minutes, Gitar resolves the issues, pushes commits, and CI goes green: