SonarQube Server v2025.5 (113872) / Developer Edition
Docker
what are you trying to achieve
Enable Autodetect AI-Generated Code feature
Hello
i’m trying to enable Autodetect AI-Generated Code feature of SQ, on an already existing and working integration between our SQ instance and our GitHub.com organization.
On GitHub side, user accounts are manually created, and are configured with public email address matching user company email (usually in lowercase)
On SonarQube side, user accounts are automatically created at first logging, populating data from internal LDAP. Email associated to account are not in lowercase (Firstnam.Lastname@domain.com).
On SQ web.log side, i can see it properly fetches the Copilot seats, but it is not able to associate properly with SQ users (only 1 found)
2025.12.06 10:11:38 INFO web[com.sonar.x.j.j.x] [Copilot] Fetching Copilot seats information for 1 Github App configurations
2025.12.06 10:11:39 INFO web[com.sonar.x.j.j.j.h] [Copilot] Fetched 76 Copilot seats for organization ... and installation 30548568
2025.12.06 10:11:39 INFO web[com.sonar.x.j.j.x] [Copilot] Successfully fetched 76 Copilot seats information
2025.12.06 10:11:39 INFO web[com.sonar.x.j.j.x] [Copilot] Found 1 users matching Copilot seat assignment
2025.12.06 10:11:39 INFO web[com.sonar.x.j.j.x] [Copilot] Updated Copilot AI tool usage for 1 users
How can we “debug” this issue? Is there a documentation page describing how users are mapped between those 2 platforms?
I suspect you’ve already come pretty close to identifying the issue (case) but can you enable debug logging (Administration → System → Logs level) and re-run this? Note that debug-level logging gets big, fast, so you’ll want to return to INFO level quickly.
If you are using SonarQube Server with the GitHub Enterprise Server (the self-hosted version of the GitHub platform) or SSO, a SonarQube administrator must set up an SCM account for each Copilot Business subscription user so that the users’ Copilot login matches their GitHub Enterprise Server login.
So for the non-syncing users, I think it’s worth creating an additional SCM Account in lower case. Can you give that a try on at least one user and see if that works?
Note that each user must have used Copilot to be eligible for matching. I.e., if the 2 users you have on SQ have not both used Copilot actively, they will be ignored (being assigned a seat is not enough). Are you sure both users actually used Copilot?
For how it works, the users are matched the same way we match SCM data. We get the user ID, username, and email from Copilot (which should be your GitHub Account data), and then try to match them to the SonarQube user’s external_id (this will match if you use GitHub OAuth as your IdP, which is not your case), username, and email. If none match then it will cycle through the SCM accounts and try to match the GitHub username and email to each SCM account.
I’m sure about the Copilot usage, but good to know
What makes this issue complicated to investigate is:
no detail in log about the matched user (could also list in DEBUG the fetched Copilot users). I am not able to identify who is our only matched user ^^
no simple way to trigger a Copilot user fetch
Currently, for a user named John Doe, we have this setup: