Skip to content

ci: fail on the Sonar quality gate only for pull requests - #13053

Merged
alumni merged 2 commits into
masterfrom
ci/sonar-gate-pr-only
Nov 12, 2026
Merged

alumni merged 2 commits into
masterfrom
ci/sonar-gate-pr-only

Conversation

@michaelbromley

Copy link
Copy Markdown
Member

Problem

The coverage job (and the codemod and legacy-naming-strategies scans) set sonar.qualitygate.wait=true, so they fail whenever the SonarCloud quality gate fails. On master, the gate judged all code since 6 March 2026 as new code, because the project's new-code setting was "previous version" and no version was ever sent. As a result, coverage hasn't passed on master since at least 20 April, and every master commit shows red.

The new-code setting has now been changed to the last 30 days in SonarCloud.

Change

  • Removed sonar.qualitygate.wait=true from the three sonar-project.properties files.
  • Each scan step now passes -Dsonar.qualitygate.wait=${{ github.event_name == 'pull_request' }}.

On pull requests, the job still fails if the PR's own changes fail the gate. On master (push and merge queue), the scan still uploads to SonarCloud and the SonarCloud check still reports, but the CI job no longer fails on the gate.

Merging this also triggers the first master scan under the new 30-day setting.

The coverage job waited for the SonarCloud quality gate on every run,
so master commits went red whenever the gate failed for the branch as a
whole. Wait for the gate only on pull requests, where it judges the PR's
own changes. Scans on master still upload results to SonarCloud.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review
  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

Grey Divider

Tip of the day
💡 Did you know, you can import rules and skills only from the repositories your team follows

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 142c034 ⚖️ Balanced

Results up to commit 76d290a


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying typeorm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 142c034
Status: ✅  Deploy successful!
Preview URL: https://e2eccd92.typeorm.pages.dev
Branch Preview URL: https://ci-sonar-gate-pr-only.typeorm.pages.dev

View logs

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'typeorm-legacy-naming-strategies'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@sonarqubecloud

Copy link
Copy Markdown

@gioboa gioboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alumni
alumni merged commit 8b8eb1e into master Nov 12, 2026
48 checks passed
@alumni
alumni deleted the ci/sonar-gate-pr-only branch November 12, 2026 10:55
@github-actions github-actions Bot added this to the 2.0.next milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

Couldn't load assignees.