Skip to content

Improve error handling in DAST site profile form

What does this MR do?

This improves the error handling in the DAST site profile form. Previously, if GraphQL returned errors-as-data, they would be completely ignored by the frontend and the user would be redirected to the site profiles library, as if the request had succeeded.

This MR addresses this by aborting the redirection when errors are returned as data, and by presenting those errors to the user so they can recover from them by changing the form.

Screenshots

Here's the error that appears if the user tries to create a new profile with a name that is already used in another profile:

Screen_Shot_2020-07-30_at_12.35.58_PM

How to test this?

  1. Enable the feature flag.
echo "Feature.enable(:security_on_demand_scans_feature_flag)" | spring rails c
  1. Sign-in as the root user.
  2. Navigate to a project's DAST Site Profile form (/:group/:project/-/on_demand_scans/profiles/dast_site_profiles/new)
  3. Create a profile.
  4. Repeat steps 3 and 4, make sure to reuse the same profile name.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Paul Gascou-Vaillancourt

Merge request reports