Quality Gate ignoring PR < 20 LoC is painful - making sonarcloud not trustworthy

Template for a good new topic, formatted with Markdown:

  • ALM used : GitHub
  • CI system used : Github action
  • Scanner command used when applicable : SonarSource/sonarcloud-github-action@v2.0.0
  • Languages of the repository : javascript/typescript
  • Only if the SonarCloud project is public : private
  • Error observed
  1. with a PR than with 1 line of code change (some other files are in sonar.coverage.exclusions) and some dependencies updated, such that the generate coverage/lcov.info is broken, thus the code coverage is 0%. The PR is merged and the problem undetected. Later we realized that subsequent PR do not have coverage (80% threshold), in the meantime a few small PRs have passed (green water melon with 0%) under the carpet.

  2. We have microservices, with distributed repositories, so having small PR is something normal. How can we use sonarcloud with such a feature (ignoring PR under 20 LoC) being active and having certain PRs going thru the gate?

  3. How can we claim to do “Clean as You Code”, with such a feature in place?

  • Steps to reproduce : create a PR with less than 20 lines of code changed
  • Potential workaround : no
1 Like

Hello @newlight77 ,

Adding an option to make this configurable is already planned and should be released in the coming weeks. You can follow this card on our roadmap to get an update once the feature is live.

1 Like