Configure Qodana Baseline to Ignore Existing Issues in CI
Learn how to set up Qodana’s baseline feature so that only new code issues break your build, with a step‑by‑step guide, verification tips and recovery options.
08 Jan 2026, 17:40 UTC

Desired outcome
Configure Qodana to treat the current set of issues as a baseline, so that subsequent analyses only fail the build when new issues are introduced. This lets you adopt Qodana in an existing codebase without being blocked by pre‑existing findings.
Prerequisites
- A repository with a
qodana.yamlfile (or willingness to add one). - Access to a Qodana Docker image (e.g.,
jetbrains/qodana‑jvm) or JetBrains Qodana Cloud. - If using Qodana Cloud, a valid
QODANA_TOKENenvironment variable. - Git write permission to commit the baseline file.
- A CI system that can run Docker containers (GitHub Actions, GitLab CI, etc.).
Procedure
1. Add Qodana configuration
Create qodana.yaml in the repository root with the following content:
# qodana.yaml
baseline: true
fail-threshold: none # optional; makes the flag unnecessary in CI
The baseline: true section tells Qodana to generate a baseline XML report on the first run.
2. Generate and commit the baseline
Run Qodana locally (or in a temporary CI job) to create the baseline:
# Replace with the appropriate Qodana image for your language
# Example for JVM:
docker run --rm -v "$(pwd):/project" -e QODANA_TOKEN= \
jetbrains/qodana-jvm qodana --fail-threshold none
After the run finishes, Qodana will have created .idea/qodana/qodana-baseline.xml. Commit this file:
git add .idea/qodana/qodana-baseline.xml
git commit -m "Add Qodana baseline for existing issues"
git push
3. Configure CI to use the baseline
In your CI pipeline, run Qodana without the --fail-threshold flag (if you set it in qodana.yaml) and ensure the QODANA_TOKEN is supplied:
# Example GitHub Actions step
- name: Run Qodana
run: |
docker run --rm -v "${{ github.workspace }}:/project" \
-e QODANA_TOKEN=${{ secrets.QODANA_TOKEN }} \
jetbrains/qodana-jvm qodana
Because the baseline file is present, Qodana will compare the new analysis against it and ignore any issues that were already recorded.
Expected checks
- After the first run with
baseline: true, verify that.idea/qodana/qodana-baseline.xmlexists and contains<issue>elements matching the current inspection output. - Run Qodana a second time without the baseline flag (or with
baseline: false) and check the log for a line similar to: Baseline applied: 124 issues ignored- The command should exit with status
0(or whatever status you configured viafail-threshold). - Introduce a deliberate new violation (e.g., add a TODO comment that triggers an inspection) and confirm that the build fails or the report shows the new issue while the previously ignored issues remain absent.
Recovery / Rollback options
If you need to update the baseline after intentional refactoring:
- Delete the existing baseline file:
rm .idea/qodana/qodana-baseline.xml - Re‑run Qodana with
baseline: trueto generate a fresh baseline. - Commit the new baseline and push.
Note that changing the JDK, language version, or upgrading Qodana may invalidate the baseline; in such cases repeat the steps above to regenerate it.
Limitations and practical verification
Baseline comparison is sensitive to the exact toolchain used. If you change the JDK version or upgrade Qodana, previously ignored issues may resurface. To verify that the baseline is still valid after a toolchain change:
- Run Qodana with
baseline: truein a clean environment. - Compare the newly generated baseline with the committed one (e.g., using
diff). - If differences appear beyond expected new issues, regenerate and commit the updated baseline.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.