The develop branch is declared as long-lived branch, but as the setting windows says “This applies only during first analysis, the type of a branch cannot be changed later”, maybe it as been declared after the first analysis.
So I tried with the main branch, which is by default a long-lived branch, but the log still says it is a short-lived branch:
09:04:20.983 INFO Branch name: refs/heads/main, type: short-lived
Long-lived branches
develop [main branch] 12 days ago
main 3 days ago
Short-lived branch
refs/head/develop 3 days
refs/heads/some_branch 3 days ago
some_branch 14 days ago
Well, something happend in our CI some days ago. I’m going to investigate.
But is it normal Sonar consider develop and refs/head/develop as different branches ?
Anyway, the main branch hasn’t this duplication,and the problem is there.
As the MAIN branch was on develop instead of main, I renamed develop to master, and I intend to rename later main to master (they’re all on the same commit).
For long-lived branches setting, I just put develop as regular expression, but I don’t have (re)created yet this branch.
I created a branch from master, called Debug_Sonar; and modified a line of code by removing a const to a local variable. Sonar in VS raises a S994, so it should do the same thing with CI.
I updated the Sonar wrapper.
I put the log level to verbove (D-sonar.verbose=true)
Here are the branches:
Long-lived branches
master [main branch] 13 days ago
main 4 days ago
Short-lived branch
Debug_Sonar 3 hours ago
The changed code has been seen by the scanner, but SonarCloud still reports no error, although it does see the changes (Code tab).
That’s a bug to resolve: I had three previous commits, each one removing a const. That means one can introduce problems on existing lines without SonarClour raises errors.
Next issue: finding all errors on main branch (“main” in the Sonar way)…