Skip to content

[Bug][SonarQube] Search in Sonarqube connection seems wrong #8805

Closed

Description

@ajoecker1

Search before asking

  • 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

Anything else

No response

Version

v1.0.3-beta10

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    component/extThis issue or PR relates to external components, such as Grafana
    priority/highThis issue is very important
    severity/p1This bug affects functionality or significantly affect ux
    on Mar 24, 2026
  2. dosubot commented on Mar 24, 2026

    @dosubot

    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.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about incubator-devlake with Dosu Add Dosu to your team

  3. ajoecker1 commented on Mar 25, 2026

    @ajoecker1
    Author

    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 ?

  4. ajoecker1 commented on Apr 13, 2026

    @ajoecker1
    Author

    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)

  5. dosubot commented on Apr 13, 2026

    @dosubot

    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 reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about incubator-devlake with Dosu Add Dosu to your team

  6. klesh commented on Apr 18, 2026

    @klesh
    Contributor

    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!

  7. jbsmith7741 commented on Apr 24, 2026

    @jbsmith7741
    Contributor

    I'm running SonarQube Enterprise Edition v2025.4.2 and running into the same issues.

  8. added a commit that references this issue on Apr 25, 2026
    c8a7711
  9. added a commit that references this issue on Jul 21, 2026
    c05201d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/extThis issue or PR relates to external components, such as Grafanapriority/highThis issue is very importantseverity/p1This bug affects functionality or significantly affect uxtype/bugThis issue is a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions