Show an error when the API fuzzing configuration fails to load

Why

The API fuzzing configuration page logged five browser console errors in ee/spec/features/user_sees_active_nav_items_spec.rb, which !256639 (merged) had to allowlist. The spec stubs the scan profiles YAML with an empty 200 response. That exposed two defects:

  • AppSec::Fuzzing::API::CiConfiguration#scan_profiles raised Gitlab::Config::Loader::FormatError on YAML that is not a hash, so the apiFuzzingCiConfiguration GraphQL field returned 500.
  • The page rendered ConfigurationForm with an undefined configuration when the query failed. Under Vue 2 the form threw in data() (reading 'scanModes', reading 'value', targetUrl not defined). Under Vue 3 it threw in the component update.

What

  • ee/app/models/app_sec/fuzzing/api/ci_configuration.rb: invalid YAML is treated like a failed request and yields no profiles.
  • ee/app/assets/javascripts/security_configuration/api_fuzzing/components/app.vue: on a query error, or when the field is null because the user lacks read_security_resource, the page shows an error alert instead of the form.

How to verify

  1. bin/rspec ee/spec/models/app_sec/fuzzing/api/ci_configuration_spec.rb
  2. yarn jest ee/spec/frontend/security_configuration/api_fuzzing/components/app_spec.js
  3. With the console check of !256639 (merged) and its five entries for ee/spec/features/user_sees_active_nav_items_spec.rb removed, bin/rspec ee/spec/features/user_sees_active_nav_items_spec.rb:14 passes with no console output. Verified locally on 2026-09-22.

Screenshots

Taken from commit bbd9d285 with a temporary feature spec. Success path: the profiles YAML returns two profiles and the form renders as before. Error path: scan_profiles raises, the query returns an error, and the page shows an alert where the form was.

Success path (unchanged) Error path (new)
API fuzzing configuration form API fuzzing configuration error alert

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

References

🤖 Generated with Claude Code

Edited by Miguel Rincon

Merge request reports

Loading
Loading