Skip to content

fix(sonarqube): use filter parameter for project search#8849

Merged
klesh merged 1 commit into
apache:mainfrom
jbsmith7741:sonarQube-search
Apr 25, 2026
Merged

fix(sonarqube): use filter parameter for project search#8849
klesh merged 1 commit into
apache:mainfrom
jbsmith7741:sonarQube-search

Conversation

@jbsmith7741
Copy link
Copy Markdown
Contributor

Summary
Bug remote project search for SonarQube used the wrong query style for components/search_projects and a fixed small page; this PR uses SonarQube’s filter=query = "…" form, exact key matching where needed, and more reliable loading of additional pages in the data-scope UI. That aligns results with the connection’s projects and makes “load more” behave as users expect when there are many projects.

Does this close any open issues?
Fixes #8805

Screenshots
sonarQube_search

Other Information

SonarQube's components/search_projects endpoint does not accept a bare
q parameter for text search; it is silently ignored. The correct
approach is the filter language: filter=query = "term". Sending q=term
caused DevLake to return the full unfiltered project list regardless of
the search input.

Also fix three related pagination bugs in the remote scope search UI:
- results were replaced instead of accumulated on page 2+
- getHasMore was inverted (tested loading state instead of hasMore)
- onScroll could trigger duplicate requests while one was in flight
- typing a new query did not reset page and hasMore state

Fixes apache#8805

Signed-off-by: Joshua Smith <jbsmith7741@gmail.com>
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. component/config-ui This issue or PR relates to config-ui component/plugins This issue or PR relates to plugins pr-type/bug-fix This PR fixes a bug priority/medium This issue is medium important severity/p1 This bug affects functionality or significantly affect ux labels Apr 24, 2026
Copy link
Copy Markdown
Contributor

@klesh klesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for your contribution.

@klesh klesh merged commit c8a7711 into apache:main Apr 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/config-ui This issue or PR relates to config-ui component/plugins This issue or PR relates to plugins pr-type/bug-fix This PR fixes a bug priority/medium This issue is medium important severity/p1 This bug affects functionality or significantly affect ux size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants