Fix client-side mutation for updating DAST site profiles
- Related issue: #235745 (closed)
What does this MR do?
This addresses a few mismatches between the frontend and the backend GraphQL implementations for updating DAST site profiles. Specifically:
- The client-side mutation's schema was malformed, with an extra
project
field that didn't resolve to anything. - The type for the
$id
parameter wasID!
when it should have beenDastSiteProfileID!
. - Finally, we were passing a plain ID via the
$id
parameter, when it should actually have been a global ID.
This also adds some specs for the ee/app/views/projects/dast_site_profiles/edit.html.haml
view.
How to test this?
- Enable the feature flag.
echo "Feature.enable(:security_on_demand_scans_feature_flag)" | spring rails c
- Visit a project's DAST profiles library:
/:group/:project/-/on_demand_scans/profiles
. - Create a profile, then edit it.
Screenshots
Previously, any attempt to update a site profile would fail, with a generic error message showing up:
With these changes, editing a site profile now works properly, and you're properly redirected to the profiles library as expected.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry A changelog entry is not required as those changes are feature flagged
- [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Paul Gascou-Vaillancourt