Add ability to edit existing on-demand DAST scans
What does this MR do?
This adds the ability to edit saved DAST scans.
How to test this?
- Enable the feature flag:
echo "Feature.enable(:dast_saved_scans)" | rails c
- Mock the API by applying the following patch:
diff --git a/ee/app/assets/javascripts/on_demand_scans/graphql/provider.js b/ee/app/assets/javascripts/on_demand_scans/graphql/provider.js
index ef96b443da8..dc39a1bf237 100644
--- a/ee/app/assets/javascripts/on_demand_scans/graphql/provider.js
+++ b/ee/app/assets/javascripts/on_demand_scans/graphql/provider.js
@@ -4,6 +4,20 @@ import createDefaultClient from '~/lib/graphql';
Vue.use(VueApollo);
+const resolvers = {
+ Mutation: {
+ dastScanUpdate: () => {
+ return {
+ dastScan: {
+ editPath: '/your/scan/edit/page',
+ },
+ pipelineUrl: '/your/dast/pipeline',
+ errors: [],
+ };
+ },
+ },
+};
+
export default new VueApollo({
- defaultClient: createDefaultClient(),
+ defaultClient: createDefaultClient(resolvers),
});
- Browse to the edit DAST scan page at
/:namespace/:project/-/on_demand_scans/1/edit
. - Fill-in the form and click on
Save and run scan
, you should be redirected to/your/dast/pipeline
(path mocked in the patch above). - Go back to the form, fill it again and click on
Save scan
, you should be redirected to/your/scan/edit/page
(also mocked in the patch).
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry (behind a feature flag)
- [-] 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
Related to #295242 (closed)
Edited by Paul Gascou-Vaillancourt