Repository navigation
ci: fail on the Sonar quality gate only for pull requests - #13053
Merged
Merged
Conversation
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.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require review
Tip of the day💡 Did you know, you can import rules and skills only from the repositories your team follows |
Deploying typeorm with
|
| 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 |
|
|
|
alumni
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
The
coveragejob (and the codemod and legacy-naming-strategies scans) setsonar.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,coveragehasn'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
sonar.qualitygate.wait=truefrom the threesonar-project.propertiesfiles.-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.