Commit c7bb8070 authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch '343314-remove-full-path-arg' into 'master'

Remove deprecated fullPath arguments from frontend DAST mutations

See merge request gitlab-org/gitlab!72690
parents c7c927c6 8046d377
...@@ -247,14 +247,13 @@ export default { ...@@ -247,14 +247,13 @@ export default {
const mutation = this.isEdit ? dastProfileUpdateMutation : dastProfileCreateMutation; const mutation = this.isEdit ? dastProfileUpdateMutation : dastProfileCreateMutation;
const responseType = this.isEdit ? 'dastProfileUpdate' : 'dastProfileCreate'; const responseType = this.isEdit ? 'dastProfileUpdate' : 'dastProfileCreate';
const input = { const input = {
fullPath: this.projectPath,
dastScannerProfileId: this.selectedScannerProfile.id, dastScannerProfileId: this.selectedScannerProfile.id,
dastSiteProfileId: this.selectedSiteProfile.id, dastSiteProfileId: this.selectedSiteProfile.id,
branchName: this.selectedBranch, branchName: this.selectedBranch,
...(this.glFeatures.dastOnDemandScansScheduler ...(this.glFeatures.dastOnDemandScansScheduler
? { dastProfileSchedule: this.profileSchedule } ? { dastProfileSchedule: this.profileSchedule }
: {}), : {}),
...(this.isEdit ? { id: this.dastScan.id } : {}), ...(this.isEdit ? { id: this.dastScan.id } : { fullPath: this.projectPath }),
...serializeFormObject(this.form.fields), ...serializeFormObject(this.form.fields),
[this.isEdit ? 'runAfterUpdate' : 'runAfterCreate']: runAfter, [this.isEdit ? 'runAfterUpdate' : 'runAfterCreate']: runAfter,
}; };
......
...@@ -152,7 +152,6 @@ export default { ...@@ -152,7 +152,6 @@ export default {
}, },
deleteProfile(profileType, profileId) { deleteProfile(profileType, profileId) {
const { const {
projectFullPath,
handleError, handleError,
profileSettings: { profileSettings: {
[profileType]: { [profileType]: {
...@@ -174,7 +173,6 @@ export default { ...@@ -174,7 +173,6 @@ export default {
mutation: deletion.mutation, mutation: deletion.mutation,
variables: { variables: {
input: { input: {
...(profileType !== 'dastProfiles' ? { fullPath: projectFullPath } : {}),
id: profileId, id: profileId,
}, },
}, },
......
...@@ -20,10 +20,6 @@ export default { ...@@ -20,10 +20,6 @@ export default {
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
props: { props: {
fullPath: {
type: String,
required: true,
},
errorMessage: { errorMessage: {
type: String, type: String,
required: false, required: false,
...@@ -72,7 +68,6 @@ export default { ...@@ -72,7 +68,6 @@ export default {
mutation: dastProfileRunMutation, mutation: dastProfileRunMutation,
variables: { variables: {
input: { input: {
fullPath: this.fullPath,
id, id,
}, },
}, },
...@@ -101,7 +96,6 @@ export default { ...@@ -101,7 +96,6 @@ export default {
<template> <template>
<profiles-list <profiles-list
:full-path="fullPath"
:error-message="error.errorMessage" :error-message="error.errorMessage"
:error-details="error.errorDetails" :error-details="error.errorDetails"
v-bind="$attrs" v-bind="$attrs"
......
...@@ -118,8 +118,7 @@ export default { ...@@ -118,8 +118,7 @@ export default {
}, },
mutationVariables() { mutationVariables() {
return { return {
fullPath: this.projectFullPath, ...(this.isEdit ? { id: this.profile.id } : { fullPath: this.projectFullPath }),
...(this.isEdit ? { id: this.profile.id } : {}),
...serializeFormObject(this.form.fields), ...serializeFormObject(this.form.fields),
}; };
}, },
......
...@@ -141,8 +141,7 @@ export default { ...@@ -141,8 +141,7 @@ export default {
} = serializeFormObject(this.form.fields); } = serializeFormObject(this.form.fields);
return { return {
fullPath: this.projectFullPath, ...(this.isEdit ? { id: this.profile.id } : { fullPath: this.projectFullPath }),
...(this.isEdit ? { id: this.profile.id } : {}),
profileName, profileName,
targetUrl, targetUrl,
targetType, targetType,
......
...@@ -428,7 +428,6 @@ describe('OnDemandScansForm', () => { ...@@ -428,7 +428,6 @@ describe('OnDemandScansForm', () => {
description: 'Tests for SQL injections', description: 'Tests for SQL injections',
dastScannerProfileId: passiveScannerProfile.id, dastScannerProfileId: passiveScannerProfile.id,
dastSiteProfileId: nonValidatedSiteProfile.id, dastSiteProfileId: nonValidatedSiteProfile.id,
fullPath: projectPath,
runAfterUpdate: runAfter, runAfterUpdate: runAfter,
}, },
}, },
......
...@@ -121,7 +121,7 @@ describe('DastScannerProfileForm', () => { ...@@ -121,7 +121,7 @@ describe('DastScannerProfileForm', () => {
describe.each` describe.each`
title | profile | mutation | mutationVars | mutationKind title | profile | mutation | mutationVars | mutationKind
${'New scanner profile'} | ${{}} | ${dastScannerProfileCreateMutation} | ${{}} | ${'dastScannerProfileCreate'} ${'New scanner profile'} | ${{}} | ${dastScannerProfileCreateMutation} | ${{ fullPath: projectFullPath }} | ${'dastScannerProfileCreate'}
${'Edit scanner profile'} | ${defaultProfile} | ${dastScannerProfileUpdateMutation} | ${{ id: defaultProfile.id }} | ${'dastScannerProfileUpdate'} ${'Edit scanner profile'} | ${defaultProfile} | ${dastScannerProfileUpdateMutation} | ${{ id: defaultProfile.id }} | ${'dastScannerProfileUpdate'}
`('$title', ({ profile, title, mutation, mutationVars, mutationKind }) => { `('$title', ({ profile, title, mutation, mutationVars, mutationKind }) => {
beforeEach(() => { beforeEach(() => {
...@@ -155,7 +155,6 @@ describe('DastScannerProfileForm', () => { ...@@ -155,7 +155,6 @@ describe('DastScannerProfileForm', () => {
profileName, profileName,
spiderTimeout, spiderTimeout,
targetTimeout, targetTimeout,
fullPath: projectFullPath,
scanType, scanType,
useAjaxSpider, useAjaxSpider,
showDebugMessages, showDebugMessages,
......
...@@ -187,7 +187,7 @@ describe('DastSiteProfileForm', () => { ...@@ -187,7 +187,7 @@ describe('DastSiteProfileForm', () => {
describe.each` describe.each`
title | profile | mutationVars | mutation | mutationKind title | profile | mutationVars | mutation | mutationKind
${'New site profile'} | ${{}} | ${{}} | ${dastSiteProfileCreateMutation} | ${'dastSiteProfileCreate'} ${'New site profile'} | ${{}} | ${{ fullPath: projectFullPath }} | ${dastSiteProfileCreateMutation} | ${'dastSiteProfileCreate'}
${'Edit site profile'} | ${siteProfileOne} | ${{ id: siteProfileOne.id }} | ${dastSiteProfileUpdateMutation} | ${'dastSiteProfileUpdate'} ${'Edit site profile'} | ${siteProfileOne} | ${{ id: siteProfileOne.id }} | ${dastSiteProfileUpdateMutation} | ${'dastSiteProfileUpdate'}
`('$title', ({ profile, mutationVars, mutation, mutationKind }) => { `('$title', ({ profile, mutationVars, mutation, mutationKind }) => {
beforeEach(() => { beforeEach(() => {
...@@ -208,7 +208,6 @@ describe('DastSiteProfileForm', () => { ...@@ -208,7 +208,6 @@ describe('DastSiteProfileForm', () => {
expect(baseDastProfileForm.props('mutationVariables')).toEqual({ expect(baseDastProfileForm.props('mutationVariables')).toEqual({
profileName, profileName,
targetUrl, targetUrl,
fullPath: projectFullPath,
excludedUrls: siteProfileOne.excludedUrls, excludedUrls: siteProfileOne.excludedUrls,
requestHeaders, requestHeaders,
targetType: 'API', targetType: 'API',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment