Skip to content

[fix][SonarQube]: allow project list with non-admin (Browse) token (fixes #8710)#8731

Merged
klesh merged 1 commit intoapache:mainfrom
jbsmith7741:sonarqube-token
Feb 26, 2026
Merged

[fix][SonarQube]: allow project list with non-admin (Browse) token (fixes #8710)#8731
klesh merged 1 commit intoapache:mainfrom
jbsmith7741:sonarqube-token

Conversation

@jbsmith7741
Copy link
Contributor

@jbsmith7741 jbsmith7741 commented Feb 25, 2026

Summary

When adding a SonarQube data scope, the project list was empty even though "Test Connection" succeeded when using a non-admin token. The plugin was calling the projects/search API, which requires admin (or equivalent) permissions. This PR switches to components/search_projects, which works with a token that has Browse permission, so users can list projects and add scopes without an admin token.

Backend: use components/search_projects instead of projects/search in api/blueprint_v200.go (GetApiProject) and api/remote_api.go (querySonarqubeProjects).

Config UI: add a subLabel on the token field stating that a token with Browse permission is sufficient for listing projects and collecting issues, hotspots, and file metrics; listing Accounts may still require a system admin token on some instances.

Does this close any open issues?

Closes #8710

Screenshots

Include any relevant screenshots here.

Other Information

No change to connection validation; "Test Connection" behavior is unchanged.

@dosubot dosubot bot added size:S This PR changes 10-29 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 severity/p1 This bug affects functionality or significantly affect ux labels Feb 25, 2026
Copy link
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

@klesh klesh merged commit a215ca4 into apache:main Feb 26, 2026
15 of 16 checks passed
@jbsmith7741 jbsmith7741 deleted the sonarqube-token branch March 2, 2026 20:06
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 severity/p1 This bug affects functionality or significantly affect ux size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question][SonarQube] Is Enterprise Edition v2025.1.3 supported

2 participants