Skip to content

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
Screen_Shot_2022-02-16_at_9.35.07_am Screen_Shot_2022-02-16_at_9.36.45_am

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
  1. Go to a project's "Security & Compliance" -> "Configuration"
  2. Click on "Vulnerability Management"
  3. 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.

Related to #350563 (closed)

Edited by Samantha Ming

Merge request reports

Loading