-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
bughelp_wantedWe would welcome a community contribution on thisWe would welcome a community contribution on this
Description
Bug description
"Service key 1" for the SonarQube API Scan Configuration is said to be optional. However, I tested adding a configuration without it and got an error that the component parameter is missing from the API call.
The following section should be handling this:
django-DefectDojo/dojo/tools/api_sonarqube/importer.py
Lines 113 to 125 in f322a04
| if config and config.service_key_1: | |
| component = client.get_project( | |
| config.service_key_1, | |
| organization=organization, | |
| branch=test.branch_tag, | |
| ) | |
| else: | |
| component = client.find_project( | |
| test.engagement.product.name, | |
| organization=organization, | |
| branch=test.branch_tag, | |
| ) | |
| # Get the resource from SonarQube |
Steps to reproduce
Steps to reproduce the behavior:
- Go to Settings > Add API Scan Configuration in the product view
- Choose the SonarQube from the Tool Configuration dropdown and press Submit
- The following error appears:
Unable to find the project None due to 400 - {"errors":[{"msg":"The \u0027component\u0027 parameter is missing"}]}
Expected behavior
If Service key 1 is not provided, the default should be applied (i.e. the product name in DefectDojo)
Deployment method
- Docker Compose
- Kubernetes
- GoDojo
Environment information
- Operating System: Ubuntu 24.04
- Docker Compose version: 2.39.1
- DefectDojo version: 2.51.2
Logs
[22/Dec/2025 17:36:12] INFO [dojo.product.views:1886] Unable to find the project None due to 400 - {"errors":[{"msg":"The \u0027component\u0027 parameter is missing"}]}
Metadata
Metadata
Assignees
Labels
bughelp_wantedWe would welcome a community contribution on thisWe would welcome a community contribution on this
