Pull Request scan takes files that are not part of that pull request

Hi team,

I’d like to ask help for this situation. We are analyzing Pull request new code. The thing is that something it brings more files that the ones changed in that pull request and report Github low coverage than actually the changed files have.
I have the suspect it is related to the way how the New code for new pull request is configured. It currently have 1 day as “window”. Don’t sure that I understand this 100%.

Anyway, so, it happen that this repo is in constant change some many pull request are open periodically and not closed in order. Could that be the reason? What is the recommended Sonar configuration to avoid these mismatching of coverage?
It’s also no easy to reproduce, we’ve tried a couple of scenarios but in those seemed to worked fine. Cannot get the specific sequence of event that produce this situation.

I’ve already read the documentation but not luck.

Thanks in advance

Version 9.9.2 (build 77730)

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

9.9.2 → 2025.1

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, this sounds like a problem with the SCM data available to analysis. You’ll need to make sure the prerequisites are in place.

 
HTH,
Ann

Hi G Ann

I’ve reviewed the prerequisities, and they look fine .

The particular issue comes when:

  1. A new branch A is open
  2. Make changes in branch A
  3. A second new branch B is open for the same repository.
  4. Make changes in branch B
  5. Merge branch B into main branch
  6. REBASE branch A with main branch
  7. Merge branch A in main branch

ISSUE: Files with changes merge in PR of branch B appear is the PR scan of branch A. :frowning:

We could reproduce it a couple of times now. Is there anything i should check?

Hi,

Yeah, we fixed this in the 10-series.

 
HTH,
Ann