You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][SonarQube] Search in Sonarqube connection seems wrong #8805
I had searched in the issues and found no similar issues.
What happened
The following behavior was found in v1.0.3-beta10 in a sonaqube connection, it might impact other searches too.
The search is not working properly or inuititevely. The maximal number of results returned seems to be limited to 20 without an option to load more results. Also when using the search field, it is unclear how the projects are mapped.
E.g. searching backend returns projects that have no word similiar to backend in the name, so results seems to be random. E.g. I have a project called translation-backend. Searching 'translation' does not show the project, searching 'backend' does. But this is not cohersive. So another time searching 'translation' returns my project amongst the others, but 'backend' not.
If there is a way to confidentially share a screenshot of this, please let me know, as I cannot share the list of projects unfortunately here.
What do you expect to happen
When searching for a pattern, all projects that contains this pattern are displayed.
If the number of results are bigger than a threshold, there should be an option to page next results.
An explanation on how to search for projects and what formats are accepted (like regex or simply word matching)
How to reproduce
Create a sonarqube connection to a repo with more than 20 projects and start search for some projects
Thanks for the detailed report! This aligns with some known issues in the SonarQube integration:
20-result limit: The backend defaults to a page size of 100, but the UI appears to be using pageSize=20 — this has been reported as a bug affecting data scope selection. There's also a known pagination bug where selections on page 1 lose their checkbox state when navigating to page 2.
Inconsistent search results: DevLake passes the search keyword directly to SonarQube's /api/projects/search endpoint — it doesn't implement its own pattern matching. The inconsistent behavior you're seeing (e.g., "translation" vs "backend" returning different results) is likely due to SonarQube's own search behavior, not DevLake.
Related: If you're ever seeing an empty project list, check that your token has system admin rights — the /api/projects/search endpoint requires admin permissions. PR #8707 proposes switching to an endpoint that doesn't require admin rights.
the bug you linked (#8407 (comment)) states it is resolved in a previous version, but yet I do not see any pagination in my search.
I guess the chaotic result from SonarQube could be worked with, if pagination is working in DevLake. Can someone please double check whether the pagination is working ?
Looking into this further, the missing pagination in SonarQube search appears to be a real bug stemming from an architectural mismatch between the frontend and backend:
Root cause: The backend search helper (DsRemoteApiScopeSearchHelper) does not return a nextPageToken in the response — it only returns page and pageSize. Meanwhile, the frontend uses an infinite-scroll mechanism that relies on a loading state signal to decide whether more results exist [1]. Once the first page finishes loading, the UI concludes there's nothing more to fetch, so pagination effectively never kicks in.
This is different from the list endpoint (DsRemoteApiScopeListHelper), which does return nextPageToken properly [2]. So the issue is specific to the search path and affects all plugins, not just SonarQube.
The fix linked in #8407 was about GitHub checkbox state management across pages — it didn't address this SonarQube search pagination problem.
There have been several pagination-related fixes merged more recently (e.g., GitLab pagination fix, SonarQube API endpoint fix), but a fix specifically for the search endpoint not returning nextPageToken doesn't appear to have landed yet. This would likely need changes in both the backend search helper to return proper pagination metadata and the frontend to consume it.
To address the issue, we need a working SonarQube instance for debugging. What version are you using? It would be great if someone who has the same version of SonarQube could collaborate, or if you could provide a functioning SonarQube instance for us to debug. Thank you!
Activity
dosubot commentedon Mar 24, 2026
Thanks for the detailed report! This aligns with some known issues in the SonarQube integration:
20-result limit: The backend defaults to a page size of 100, but the UI appears to be using
pageSize=20— this has been reported as a bug affecting data scope selection. There's also a known pagination bug where selections on page 1 lose their checkbox state when navigating to page 2.Inconsistent search results: DevLake passes the search keyword directly to SonarQube's
/api/projects/searchendpoint — it doesn't implement its own pattern matching. The inconsistent behavior you're seeing (e.g., "translation" vs "backend" returning different results) is likely due to SonarQube's own search behavior, not DevLake.Related: If you're ever seeing an empty project list, check that your token has system admin rights — the
/api/projects/searchendpoint requires admin permissions. PR #8707 proposes switching to an endpoint that doesn't require admin rights.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
ajoecker1 commentedon Mar 25, 2026
the bug you linked (#8407 (comment)) states it is resolved in a previous version, but yet I do not see any pagination in my search.
I guess the chaotic result from SonarQube could be worked with, if pagination is working in DevLake. Can someone please double check whether the pagination is working ?
ajoecker1 commentedon Apr 13, 2026
any input on this ? I do not have any pagination in devlake for Sonarqube, so i cannot scroll to find the right project. (i am using v1.0.3-beta10)
dosubot commentedon Apr 13, 2026
Looking into this further, the missing pagination in SonarQube search appears to be a real bug stemming from an architectural mismatch between the frontend and backend:
Root cause: The backend search helper (
DsRemoteApiScopeSearchHelper) does not return anextPageTokenin the response — it only returnspageandpageSize. Meanwhile, the frontend uses an infinite-scroll mechanism that relies on a loading state signal to decide whether more results exist [1]. Once the first page finishes loading, the UI concludes there's nothing more to fetch, so pagination effectively never kicks in.This is different from the list endpoint (
DsRemoteApiScopeListHelper), which does returnnextPageTokenproperly [2]. So the issue is specific to the search path and affects all plugins, not just SonarQube.The fix linked in #8407 was about GitHub checkbox state management across pages — it didn't address this SonarQube search pagination problem.
There have been several pagination-related fixes merged more recently (e.g., GitLab pagination fix, SonarQube API endpoint fix), but a fix specifically for the search endpoint not returning
nextPageTokendoesn't appear to have landed yet. This would likely need changes in both the backend search helper to return proper pagination metadata and the frontend to consume it.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
klesh commentedon Apr 18, 2026
To address the issue, we need a working SonarQube instance for debugging. What version are you using? It would be great if someone who has the same version of SonarQube could collaborate, or if you could provide a functioning SonarQube instance for us to debug. Thank you!
jbsmith7741 commentedon Apr 24, 2026
I'm running SonarQube Enterprise Edition v2025.4.2 and running into the same issues.
fix(sonarqube): use filter parameter for project search (apache#8849)
Sync upstream Apache DevLake (v1.0.3-beta9 → beta15) (#22)