[BE] Security scanning loading indefinitely
Summary
Security scanning displays an indefinite loading state in some merge requests that have security scanners enabled.
Steps to reproduce
It's currently unknown under which circumstances this happens. However you can see the following example MRs which this bug is observed:
- https://gitlab.com/gitlab-org/security-products/analyzers/api-fuzzing-src/-/merge_requests/992
- https://gitlab.com/gitlab-org/security-products/analyzers/api-fuzzing-src/-/merge_requests/990
Current behavior
- The security scanning section displays a loading spinner indefinitely
- The frontend continuously polls the
enabledScansGraphQL query - The
enabledScansquery (located atee/app/assets/javascripts/vue_merge_request_widget/queries/enabled_scans.query.graphql) returnsready: falsefor bothenabledSecurityScansandenabledPartialSecurityScans - Users cannot see the results from other security scanners that are actually running and completing successfully
Expected behavior
- Security scanning should display the results from enabled scanners (e.g., API Fuzzing, Container Scanning, etc.)
- The loading state should resolve once the enabled scanners complete
- The
readyfield should returntrueornullwhen there are completed scans available
Root cause analysis
The issue appears to be in the backend logic that determines when security scans are "ready".
Possible solution
The enabledScans GraphQL query should return ready: true when:
- All enabled security scanners have completed
- OR return
ready: nullto indicate that polling should stop
Impact
- Poor user experience with indefinite loading states
- Unnecessary server load from continuous polling
- Users cannot access security scan results from enabled scanners
Edited by 🤖 GitLab Bot 🤖