Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
784eff81
Commit
784eff81
authored
May 04, 2021
by
Fernando
Committed by
Jose Ivan Vargas
May 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename MR to MergeRequest
Apply variable/function renames Remove null
parent
8378a3c6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
54 deletions
+35
-54
app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue
...ipts/vue_shared/security_reports/security_reports_app.vue
+2
-2
app/assets/javascripts/vue_shared/security_reports/utils.js
app/assets/javascripts/vue_shared/security_reports/utils.js
+1
-1
ee/app/assets/javascripts/vue_shared/security_reports/components/artifact_download.vue
..._shared/security_reports/components/artifact_download.vue
+2
-2
ee/app/assets/javascripts/vue_shared/security_reports/components/artifact_downloads/mr_artifact_download.vue
...ts/components/artifact_downloads/mr_artifact_download.vue
+2
-2
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
+5
-4
ee/spec/frontend/vue_shared/security_reports/components/artifact_downloads/mr_artifact_download_spec.js
...omponents/artifact_downloads/mr_artifact_download_spec.js
+5
-6
ee/spec/frontend/vue_shared/security_reports/components/artifact_downloads/pipeline_artifact_download_spec.js
...nts/artifact_downloads/pipeline_artifact_download_spec.js
+1
-2
spec/frontend/vue_shared/security_reports/mock_data.js
spec/frontend/vue_shared/security_reports/mock_data.js
+2
-2
spec/frontend/vue_shared/security_reports/utils_spec.js
spec/frontend/vue_shared/security_reports/utils_spec.js
+15
-33
No files found.
app/assets/javascripts/vue_shared/security_reports/security_reports_app.vue
View file @
784eff81
...
...
@@ -16,7 +16,7 @@ import {
import
securityReportDownloadPathsQuery
from
'
./queries/security_report_download_paths.query.graphql
'
;
import
store
from
'
./store
'
;
import
{
MODULE_SAST
,
MODULE_SECRET_DETECTION
}
from
'
./store/constants
'
;
import
{
extractSecurityReportArtifactsFromM
r
}
from
'
./utils
'
;
import
{
extractSecurityReportArtifactsFromM
ergeRequest
}
from
'
./utils
'
;
export
default
{
store
,
...
...
@@ -97,7 +97,7 @@ export default {
};
},
update
(
data
)
{
return
extractSecurityReportArtifactsFromM
r
(
this
.
$options
.
reportTypes
,
data
);
return
extractSecurityReportArtifactsFromM
ergeRequest
(
this
.
$options
.
reportTypes
,
data
);
},
error
(
error
)
{
this
.
showError
(
error
);
...
...
app/assets/javascripts/vue_shared/security_reports/utils.js
View file @
784eff81
...
...
@@ -45,7 +45,7 @@ export const extractSecurityReportArtifactsFromPipeline = (reportTypes, data) =>
return
extractSecurityReportArtifacts
(
reportTypes
,
jobs
);
};
export
const
extractSecurityReportArtifactsFromM
r
=
(
reportTypes
,
data
)
=>
{
export
const
extractSecurityReportArtifactsFromM
ergeRequest
=
(
reportTypes
,
data
)
=>
{
const
jobs
=
data
.
project
?.
mergeRequest
?.
headPipeline
?.
jobs
?.
nodes
??
[];
return
extractSecurityReportArtifacts
(
reportTypes
,
jobs
);
};
ee/app/assets/javascripts/vue_shared/security_reports/components/artifact_download.vue
View file @
784eff81
...
...
@@ -4,7 +4,7 @@ import createFlash from '~/flash';
import
{
s__
}
from
'
~/locale
'
;
import
SecurityReportDownloadDropdown
from
'
~/vue_shared/security_reports/components/security_report_download_dropdown.vue
'
;
import
securityReportDownloadPathsQuery
from
'
~/vue_shared/security_reports/queries/security_report_download_paths.query.graphql
'
;
import
{
extractSecurityReportArtifactsFromM
r
}
from
'
~/vue_shared/security_reports/utils
'
;
import
{
extractSecurityReportArtifactsFromM
ergeRequest
}
from
'
~/vue_shared/security_reports/utils
'
;
export
default
{
components
:
{
...
...
@@ -45,7 +45,7 @@ export default {
};
},
update
(
data
)
{
return
extractSecurityReportArtifactsFromM
r
(
this
.
reportTypes
,
data
);
return
extractSecurityReportArtifactsFromM
ergeRequest
(
this
.
reportTypes
,
data
);
},
error
(
error
)
{
this
.
showError
(
error
);
...
...
ee/app/assets/javascripts/vue_shared/security_reports/components/artifact_downloads/mr_artifact_download.vue
View file @
784eff81
...
...
@@ -4,7 +4,7 @@ import createFlash from '~/flash';
import
{
s__
}
from
'
~/locale
'
;
import
SecurityReportDownloadDropdown
from
'
~/vue_shared/security_reports/components/security_report_download_dropdown.vue
'
;
import
securityReportDownloadPathsQuery
from
'
~/vue_shared/security_reports/queries/security_report_mr_download_paths.query.graphql
'
;
import
{
extractSecurityReportArtifactsFromM
r
}
from
'
~/vue_shared/security_reports/utils
'
;
import
{
extractSecurityReportArtifactsFromM
ergeRequest
}
from
'
~/vue_shared/security_reports/utils
'
;
export
default
{
components
:
{
...
...
@@ -45,7 +45,7 @@ export default {
};
},
update
(
data
)
{
return
extractSecurityReportArtifactsFromM
r
(
this
.
reportTypes
,
data
);
return
extractSecurityReportArtifactsFromM
ergeRequest
(
this
.
reportTypes
,
data
);
},
error
(
error
)
{
this
.
showError
(
error
);
...
...
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
View file @
784eff81
...
...
@@ -20,7 +20,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
securityReportDownloadPathsQueryResponse
}
from
'
jest/vue_shared/security_reports/mock_data
'
;
import
{
securityReport
MergeRequest
DownloadPathsQueryResponse
}
from
'
jest/vue_shared/security_reports/mock_data
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
...
...
@@ -29,7 +29,7 @@ import { SUCCESS } from '~/vue_merge_request_widget/components/deployment/consta
// Force Jest to transpile and cache
// eslint-disable-next-line no-unused-vars
import
_Deployment
from
'
~/vue_merge_request_widget/components/deployment/deployment.vue
'
;
import
securityReport
DownloadPathsQuery
from
'
~/vue_shared/security_reports/queries/security_report
_download_paths.query.graphql
'
;
import
securityReport
MergeRequestDownloadPathsQuery
from
'
~/vue_shared/security_reports/queries/security_report_mr
_download_paths.query.graphql
'
;
import
mockData
,
{
baseBrowserPerformance
,
...
...
@@ -781,6 +781,7 @@ describe('ee merge request widget options', () => {
beforeEach
(()
=>
{
gl
.
mrWidgetData
=
{
...
mockData
,
target_project_full_path
:
''
,
enabled_reports
:
{
coverage_fuzzing
:
true
,
},
...
...
@@ -1037,8 +1038,8 @@ describe('ee merge request widget options', () => {
propsData
:
{
mrData
:
gl
.
mrWidgetData
},
apolloProvider
:
createMockApollo
([
[
securityReportDownloadPathsQuery
,
async
()
=>
({
data
:
securityReportDownloadPathsQueryResponse
}),
securityReport
MergeRequest
DownloadPathsQuery
,
async
()
=>
({
data
:
securityReport
MergeRequest
DownloadPathsQueryResponse
}),
],
]),
});
...
...
ee/spec/frontend/vue_shared/security_reports/components/artifact_downloads/mr_artifact_download_spec.js
View file @
784eff81
...
...
@@ -9,15 +9,15 @@ import {
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
expectedDownloadDropdownProps
,
securityReportM
r
DownloadPathsQueryResponse
,
securityReportM
ergeRequest
DownloadPathsQueryResponse
,
}
from
'
jest/vue_shared/security_reports/mock_data
'
;
import
createFlash
from
'
~/flash
'
;
import
SecurityReportDownloadDropdown
from
'
~/vue_shared/security_reports/components/security_report_download_dropdown.vue
'
;
import
securityReportM
r
DownloadPathsQuery
from
'
~/vue_shared/security_reports/queries/security_report_mr_download_paths.query.graphql
'
;
import
securityReportM
ergeRequest
DownloadPathsQuery
from
'
~/vue_shared/security_reports/queries/security_report_mr_download_paths.query.graphql
'
;
jest
.
mock
(
'
~/flash
'
);
describe
(
'
M
r A
rtifact Download
'
,
()
=>
{
describe
(
'
M
erge request a
rtifact Download
'
,
()
=>
{
let
wrapper
;
const
defaultProps
=
{
...
...
@@ -41,11 +41,11 @@ describe('Mr Artifact Download', () => {
const
pendingHandler
=
()
=>
new
Promise
(()
=>
{});
const
successHandler
=
()
=>
Promise
.
resolve
({
data
:
securityReportM
r
DownloadPathsQueryResponse
});
Promise
.
resolve
({
data
:
securityReportM
ergeRequest
DownloadPathsQueryResponse
});
const
failureHandler
=
()
=>
Promise
.
resolve
({
errors
:
[{
message
:
'
some error
'
}]
});
const
createMockApolloProvider
=
(
handler
)
=>
{
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
securityReportM
r
DownloadPathsQuery
,
handler
]];
const
requestHandlers
=
[[
securityReportM
ergeRequest
DownloadPathsQuery
,
handler
]];
return
createMockApollo
(
requestHandlers
);
};
...
...
@@ -54,7 +54,6 @@ describe('Mr Artifact Download', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
given the query is loading
'
,
()
=>
{
...
...
ee/spec/frontend/vue_shared/security_reports/components/artifact_downloads/pipeline_artifact_download_spec.js
View file @
784eff81
...
...
@@ -17,7 +17,7 @@ import securityReportPipelineDownloadPathsQuery from '~/vue_shared/security_repo
jest
.
mock
(
'
~/flash
'
);
describe
(
'
Mr A
rtifact Download
'
,
()
=>
{
describe
(
'
Pipeline a
rtifact Download
'
,
()
=>
{
let
wrapper
;
const
defaultProps
=
{
...
...
@@ -54,7 +54,6 @@ describe('Mr Artifact Download', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
given the query is loading
'
,
()
=>
{
...
...
spec/frontend/vue_shared/security_reports/mock_data.js
View file @
784eff81
...
...
@@ -339,7 +339,7 @@ export const securityReportDownloadPathsQueryNoArtifactsResponse = {
},
};
export
const
securityReportM
r
DownloadPathsQueryResponse
=
{
export
const
securityReportM
ergeRequest
DownloadPathsQueryResponse
=
{
project
:
{
mergeRequest
:
{
headPipeline
:
{
...
...
@@ -447,7 +447,7 @@ export const securityReportMrDownloadPathsQueryResponse = {
},
};
export
const
securityReportDownloadPathsQueryResponse
=
securityReportM
r
DownloadPathsQueryResponse
;
export
const
securityReportDownloadPathsQueryResponse
=
securityReportM
ergeRequest
DownloadPathsQueryResponse
;
export
const
securityReportPipelineDownloadPathsQueryResponse
=
{
project
:
{
...
...
spec/frontend/vue_shared/security_reports/utils_spec.js
View file @
784eff81
...
...
@@ -4,11 +4,11 @@ import {
REPORT_FILE_TYPES
,
}
from
'
~/vue_shared/security_reports/constants
'
;
import
{
extractSecurityReportArtifactsFromM
r
,
extractSecurityReportArtifactsFromM
ergeRequest
,
extractSecurityReportArtifactsFromPipeline
,
}
from
'
~/vue_shared/security_reports/utils
'
;
import
{
securityReportM
r
DownloadPathsQueryResponse
,
securityReportM
ergeRequest
DownloadPathsQueryResponse
,
securityReportPipelineDownloadPathsQueryResponse
,
sastArtifacts
,
secretDetectionArtifacts
,
...
...
@@ -17,7 +17,18 @@ import {
metadataArtifacts
,
}
from
'
./mock_data
'
;
describe
(
'
extractSecurityReportArtifactsFromMr
'
,
()
=>
{
describe
.
each
([
[
'
extractSecurityReportArtifactsFromMergeRequest
'
,
extractSecurityReportArtifactsFromMergeRequest
,
securityReportMergeRequestDownloadPathsQueryResponse
,
],
[
'
extractSecurityReportArtifactsFromPipelines
'
,
extractSecurityReportArtifactsFromPipeline
,
securityReportPipelineDownloadPathsQueryResponse
,
],
])(
'
%s
'
,
(
funcName
,
extractFunc
,
response
)
=>
{
it
.
each
`
reportTypes | expectedArtifacts
${[]}
|
${[]}
...
...
@@ -31,36 +42,7 @@ describe('extractSecurityReportArtifactsFromMr', () => {
`
(
'
returns the expected artifacts given report types $reportTypes
'
,
({
reportTypes
,
expectedArtifacts
})
=>
{
expect
(
extractSecurityReportArtifactsFromMr
(
reportTypes
,
securityReportMrDownloadPathsQueryResponse
,
),
).
toEqual
(
expectedArtifacts
);
},
);
});
describe
(
'
extractSecurityReportArtifactsFromPipeline
'
,
()
=>
{
it
.
each
`
reportTypes | expectedArtifacts
${[]}
|
${[]}
${[
'
foo
'
]}
|
${[]}
${[
REPORT_TYPE_SAST
]}
|
${
sastArtifacts
}
${[
REPORT_TYPE_SECRET_DETECTION
]}
|
${
secretDetectionArtifacts
}
${[
REPORT_TYPE_SAST
,
REPORT_TYPE_SECRET_DETECTION
]}
|
${[...
secretDetectionArtifacts
,
...
sastArtifacts
]}
${[
REPORT_FILE_TYPES
.
ARCHIVE
]}
|
${
archiveArtifacts
}
${[
REPORT_FILE_TYPES
.
TRACE
]}
|
${
traceArtifacts
}
${[
REPORT_FILE_TYPES
.
METADATA
]}
|
${
metadataArtifacts
}
`
(
'
returns the expected artifacts given report types $reportTypes
'
,
({
reportTypes
,
expectedArtifacts
})
=>
{
expect
(
extractSecurityReportArtifactsFromPipeline
(
reportTypes
,
securityReportPipelineDownloadPathsQueryResponse
,
),
).
toEqual
(
expectedArtifacts
);
expect
(
extractFunc
(
reportTypes
,
response
)).
toEqual
(
expectedArtifacts
);
},
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment