Skip to content

Fix SonarQube API: raise clear error when project_name is None fixes …#14530

Closed
tejas0077 wants to merge 1 commit intoDefectDojo:bugfixfrom
tejas0077:fix/sonarqube-v3
Closed

Fix SonarQube API: raise clear error when project_name is None fixes …#14530
tejas0077 wants to merge 1 commit intoDefectDojo:bugfixfrom
tejas0077:fix/sonarqube-v3

Conversation

@tejas0077
Copy link
Copy Markdown
Contributor

@tejas0077 tejas0077 commented Mar 15, 2026

Description

When a SonarQube API Scan Configuration is added without a Service Key 1,
the find_project method was called with None as the project name, causing
a confusing 400 error from SonarQube saying the component parameter is missing.

This fix adds a clear ValidationError with a helpful message when project_name
is None, so the user knows exactly what to fix instead of getting a cryptic error.
Also added the missing ValidationError import to api_client.py.

Fixes #13959

Test results

Manually traced the code path. The fix raises a clear ValidationError before
the API call is made when project_name is None.

Documentation

No documentation changes needed.

Copy link
Copy Markdown
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

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

This was fixed here: #14412

@tejas0077
Copy link
Copy Markdown
Contributor Author

Thanks @Maffooch, closing this as a duplicate of #14412!

@tejas0077 tejas0077 closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants