Add error handling to security training config
What does this MR do and why?
It adds error handling for both a GraphQL query and mutation on the security training configuration page.
Note: The related feature is currently behind a feature flag, so no changelog entry is needed.
Screenshots or screen recordings
query error | mutation error |
---|---|
![]() |
![]() |
How to set up and validate locally
Setup
This feature is behind a feature flag, to enable:
echo "Feature.enable(:secure_vulnerability_training)" | rails c
Apply the following patch to simulate errors:
curl https://gitlab.com/gitlab-org/gitlab/-/snippets/2226423/raw/main/error_handling.patch | git apply
Testing steps
- Navigate to Security & Compliance > Configuration
- Click on the "Vulnerability Management" tab
- You should see the query error message
- Once the query error has confirmed edit
app/assets/javascripts/security_configuration/resolver.js
line 11 to not throw the error but return the commented data - Reload the page and change one of the security provider's toggles
- Confirm mutation error message
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #348711 (closed)
Edited by David Pisek