Be informative/Bug description
Before migration [sonarqube_config, cobaltio_config] to api_scan_configuration, it was possible to run reimport without sonarqube_config definition (it automatically detected sonarqube_config from last run).
Now, reimport is failing.
Steps to reproduce
Run /api/v2/reimport-scan/ on SonarQube Test without api_scan_configuration
Expected behavior
I don't need to define api_scan_configuration for reimport
Test coverage
Deployment method(select with an X)
[ ] Docker Compose
[x] Kubernetes
[ ] GoDojo
Environment information
Commit: b7bbc8c895de92fa7e25eb37d3250dc98eb31603
Logs
[12/Nov/2021 16:24:53] ERROR [dojo.api_v2.exception_handler:26] 'NoneType' object has no attribute 'tool_configuration'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rest_framework/mixins.py", line 18, in create
serializer.is_valid(raise_exception=True)
File "/usr/local/lib/python3.8/site-packages/rest_framework/serializers.py", line 220, in is_valid
self._validated_data = self.run_validation(self.initial_data)
File "/usr/local/lib/python3.8/site-packages/rest_framework/serializers.py", line 422, in run_validation
value = self.validate(value)
File "/app/./dojo/api_v2/serializers.py", line 1376, in validate
if tool_type != api_scan_configuration.tool_configuration.tool_type.name:
AttributeError: 'NoneType' object has no attribute 'tool_configuration'
[12/Nov/2021 16:24:53] ERROR [django.request:224] Internal Server Error: /api/v2/reimport-scan/
Internal Server Error: /api/v2/reimport-scan/
ERROR:django.request:Internal Server Error: /api/v2/reimport-scan/
[pid: 27|app: 0|req: 102388/182277] 192.168.172.210 () {56 vars in 973 bytes} [Fri Nov 12 16:24:53 2021] POST /api/v2/reimport-scan/ => generated 59 bytes in 20 msecs (HTTP/1.1 500) 7 headers in 212 bytes (1 switches on core 1)
Be informative/Bug description Before migration
[sonarqube_config, cobaltio_config]
toapi_scan_configuration
, it was possible to run reimport withoutsonarqube_config
definition (it automatically detectedsonarqube_config
from last run). Now, reimport is failing.Steps to reproduce Run
/api/v2/reimport-scan/
on SonarQube Test withoutapi_scan_configuration
Expected behavior
api_scan_configuration
for reimportDeployment method (select with an
X
)Environment information
b7bbc8c895de92fa7e25eb37d3250dc98eb31603
Logs