Issues in new code not detected on branch

I’m not sure what’s going on with your branch and/or checkout, but we’ve got something entirely different this time

Sorry, I do not understand what you mean. I see similar lines in the file I sent you last:

10:22:21  [INFO] Merge base sha1: 61503bfc79587cb35934a3323b3ecb7c5823fbe8
10:22:22  [DEBUG] SCM reported changed lines for 2 files in the branch
10:22:22  [INFO] SCM writing changed lines (done) | time=330ms

I’m guessing you made changes to the pom in the workspace to try to get me a debug log?

Yes, I made a number of changes to POM to not use profile and tried specifying branch explicitly, none of that made any difference. All was suggested by you.

I need to point you to the prerequisites again.

Once again, we have all prerequisites satisfied as stated before. Other than it does not log all unchanged files, do you see any other evidence of pre-requisites not being satisfied? Would logs show some warnings in that case? Also, how would you explain that sonar shows the new lines in UI:

P. S. Please also note that sometimes it correctly detects issues on new code, but not all the time.

Hi,

Here’s your evidence:

This indicates that your reference branch, main hasn’t been

fetched in the CI/CD host’s local repository (This is usually done through the cloning of the remote repository by the CI pipeline).

 
Ann

You were right we were doing sparse checkout. It was not obvious to detect for me. Sorry for confusion, and thanks for your help.

1 Like

Let us change it and I will report if it fixed the problem

We ensured that we have full clone of the repo and fetched both main and sonar-test branches:

17:38:57  + git clone git@bitbucket.org:ketteq/disaggregation.git .
17:38:57  Cloning into '.'...
[Pipeline] sh
17:38:58  + git checkout sonar-test
17:38:58  Switched to a new branch 'sonar-test'
17:38:58  branch 'sonar-test' set up to track 'origin/sonar-test'.
[Pipeline] sh
17:38:59  + git branch
17:38:59    main
17:38:59  * sonar-test

But it did not help. Attached is the full log from sonar analysis.

sonarlog2.txt (184.5 KB)

Hi,

So you’re now doing a full checkout, and the new issues are still

  • detected in the branch
  • not recognized as new

?

If so, could I have a screenshot of the Activity tab of that (not) new issue?

 
Thx,
Ann

Here is what I see in the activity tab:

It shows that issue was introduced long ago, but it does not exist on the main branch. And here is a screenshot from the New code tab that confirms it:

But since there was a lot of changes while investigating the issue, I created a new branch, and it did fail sonar analysis and properly detect the issue:

Since it works properly with a new branch now, I think we can consider this issue closed.

Thank you for your support.

1 Like

Just as feedback, I wish Sonar made identifying this kind of issue easier and more obvious.

1 Like