Use GraphQL endpoint for sec training mutation
What does this MR do and why?
This change moves from a client-side mutation to a server-side mutation for the security training mutation.
It also does a slight refactor due to a small GraphQL schema difference between the client-side resolver and the backend.
Screenshots or screen recordings
Loading state
before | after |
---|---|
How to set up and validate locally
Enable the feature flag:
echo "Feature.enable(:secure_vulnerability_training)" | rails c
Create two training providers:
echo "Security::TrainingProvider.create!(name: 'Foo', description: 'Foo provider', url: 'http://foo.com', logo_url: 'http://foo.com/logo')" | rails c
echo "Security::TrainingProvider.create!(name: 'Bar', description: 'Bar provider', url: 'http://bar.com', logo_url: 'http://bar.com/logo')" | rails c
- Go to a project's "Security & Compliance" -> "Configuration"
- Click on "Vulnerability Management"
- Enable / Disable either provider and make sure that it persists after a page reload
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 #350563 (closed)
Edited by Samantha Ming