Keeping version events in sync with github releases

Template for a good new topic, formatted with Markdown:

  • ALM used: GitHub
  • CI system used: GitHub

General questions on SonarQube project version events. I have a GitHub repository that follows a regular release cadence and creates releases in GitHub. The SQ New Code Definition is set to Previous Version as recommended for projects doing releases. We are seeing quality gate failures on PRs due to inadequate code coverage on files not modified in the PR. In reviewing the project activity the last version event is quite outdated (1/31/25).

What triggers the creation of a version event? Is there some integration that needs to be built to keep this in sync with GitHub releases? Any docs or best practices on this topic?

Hi,

This is likely about the SCM metadata available to analysis. Check the end of your analysis log for WARNings about that.

Changing the sonar.projectVersion value passed into analysis. You want to make sure you update the value when you release in GitHub.

But it’s not going to have much impact on PR analysis, since that’s about the difference between the changes in the PR branch and the target branch (which BTW needs to have a current analysis on file in SonarQube Cloud for accurate issue detection.)

 
HTH,
Ann