Was detected as changed but without having changed lines

Hi,
SonarScanner 4.8.0.2856
Our short-lived branch is failing by showing some warnings:

[2023-05-23T05:41:50.251Z] WARN: File '/opt/workDir/*service.spec.ts' was detected as changed but without having changed lines

[2023-05-23T05:41:50.251Z] WARN: File '/opt/workDir/*.spec.ts' was detected as changed but without having changed lines

[2023-05-23T05:41:50.251Z] WARN: File '/opt/workDir/*component.ts' was detected as changed but without having changed lines

[2023-05-23T05:41:57.456Z] INFO: Time spent writing ucfgs 0ms

[2023-05-23T05:41:57.456Z] INFO: ------------------------------------------------------------------------

[2023-05-23T05:41:57.456Z] INFO: EXECUTION FAILURE

[2023-05-23T05:41:57.456Z] INFO: ------------------------------------------------------------------------

[2023-05-23T05:41:57.456Z] INFO: Total time: 4:11.506s

[2023-05-23T05:41:57.456Z] INFO: Final Memory: 55M/220M

[2023-05-23T05:41:57.456Z] INFO: ------------------------------------------------------------------------

[2023-05-23T05:41:57.456Z] ERROR: Error during SonarScanner execution

[2023-05-23T05:41:57.456Z] java.lang.UnsupportedOperationException

[2023-05-23T05:41:57.456Z] 	at java.base/java.util.AbstractCollection.add(AbstractCollection.java:267)

[2023-05-23T05:41:57.456Z] 	at org.sonar.scanner.report.ChangedLinesPublisher.writeChangedLines(ChangedLinesPublisher.java:93)

[2023-05-23T05:41:57.456Z] 	at org.sonar.scanner.report.ChangedLinesPublisher.publish(ChangedLinesPublisher.java:65)

Hey there.

What environment is your analysis running in (locally? A specific CI tool like GitHub Actions, Azure DevOps, Bitbucket Pipelines…)?

Hi @Colin
Jenkins and we run analysis on docker container with sonar-scanner cli installed in it.

Thanks.

Can you describe the git clone behavior being used in your pipeline? Is a full clone (as opposed to a shallow clone) being performed?

Hi @Colin
Its a submodule way
git submodule update --init

Hi @Colin
One more point is, i see dev excluded some files patterns using sonar.exclusions
And in the warning message i can see same pattern of suffix.
Example: *.spec.ts is excluded and some file with the name example.spec.ts is showing as detected as changed but without having changed lines

Lot of confusions @Colin
Scenario:1
If i create branch with the name 1234-builds, getting above warnings and build failing
If i change it to -1234-build build got success.

Scenario:2
If My Branch name contains ‘_’ like ABC_12-Test_Build failing with same issues.
If I remove uderscore from branch names like ABC-12-Test-Build build success.

Can you Please explain me what is this behaviors?

I’ve flagged this behavior for some experts.

Thanks @Colin

Any Update on this issue?

Hi @js-techie ,

We are currently trying to reproduce your issue locally to see if we can find where the error is occurring.

Scenario:1
If i create branch with the name 1234-builds, getting above warnings and build failing
If i change it to -1234-build build got success.

Scenario:2
If My Branch name contains ‘_’ like ABC_12-Test_Build failing with same issues.
If I remove uderscore from branch names like ABC-12-Test-Build build success.

You previously mentioned these two scenarios to us. Could you please confirm how Scenario 1 is working? For example is it ‘- 1234-builds’? Or is it related to the build vs. builds name.

Also could I confirm which languages you are running the test with? I see TS files in your above example, however are you also including others?

It is not related to build vs builds name @shane.findley
Scenario:1
If i create branch with the name 1234-build, getting above warnings and build failing
If i change it to <LonglivedBranchPattern>-1234-build build got success.

Thank you for the information @js-techie, I will see if I can recreate this issue here.

Can I confirm that the long-lived branch pattern you are using is the default one or if you have a custom pattern?

(branch|release)-.*

We defined our own pattern for long lived branches @shane.findley