Quality Gate changes to passed after re-analyzing without new code change when amend commit

Hi team,
Now I’m using SonarQube version 9.9.1 with Jenkins and SonarQube deployed by Docker.
I configured SonarScanner to run whenever I create or update a PullRequest.
I set the project’s quality gate to greater than 70% and compared it to the reference branch to define the new code. Each PR needed to be passed the quality to be merged.
But sometimes when the quality gate fails, and then I trigger rebuild (commit --amend then push --force), it passes without any change and I see that all of the measures are 0 or null. (let’s say this is branch A)

Another case is after I merge the branch A to the target branch and then rebase the target branch to my branch to create a new Pull Request, it includes the codes from branch A and thus fails the coverage as well.

So what I want: the quality gate not pass even I trigger the re-build until the issue was fixed.

*Note: I often use the rebase instead of merge commit.

Hi,

On what condition does it fail?

I’m not sure I follow this, but it’s likely about your code checkout.

 
Ann