SonarLint synchronizing on incorrect branch

  • Operating system: Windows 10
  • SonarLint plugin version: 3.9.0
  • Language you’re coding in: English
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube 9.6

We are using SonarLint in Connected Mode but issues do not appear in VSCode. From investigating the SonarLint output it appears the plugin attempts to synchronize issues on the master branch, which does not exist so a 404 error is thrown.

[SYNC] Synchronizing issues for project 'xxx' on branch 'master'

If I manually visit the API URL being used, /api/issues/pull?projectKey=xxx&branchName=master&languages=apex,c,cpp,web,java,js,php,plsql,py,secrets,ts,xml,yaml and swap branchName=main I can see the issues listed correctly.

main is configured as the main branch for this project on SonarQube.

Is there a way to ensure the main branch is used by SonarLint?

1 Like

Hello, welcome to the community! And thanks for reporting this behavior.

We released earlier today version 3.10 that should fix this issue (see ticket on JIRA for the details).

2 Likes

Great thanks Jean-Baptiste, that seems to have fixed it :+1:

1 Like

2 posts were split to a new topic: Connected mode analysis always synchronizes with master