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
66e8b9af
Commit
66e8b9af
authored
Feb 05, 2020
by
Michał Zając
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set related fields when setting different states
parent
b005d318
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
ee/db/fixtures/development/20_vulnerabilities.rb
ee/db/fixtures/development/20_vulnerabilities.rb
+18
-6
No files found.
ee/db/fixtures/development/20_vulnerabilities.rb
View file @
66e8b9af
...
...
@@ -36,14 +36,30 @@ class Gitlab::Seeder::Vulnerabilities
private
def
create_vulnerability
project
.
vulnerabilities
.
create!
(
state:
random_state
,
vulnerability
=
project
.
vulnerabilities
.
build
(
author:
author
,
title:
'Cypher with no integrity'
,
severity:
random_severity_level
,
confidence:
random_confidence_level
,
report_type:
random_report_type
)
vulnerability
=
set_random_vulnerability_state
(
vulnerability
)
vulnerability
.
save!
vulnerability
end
def
set_random_vulnerability_state
(
vulnerability
)
state
=
::
Vulnerability
.
states
.
keys
.
sample
vulnerability
.
state
=
state
case
state
when
"resolved"
vulnerability
.
resolved_by
=
vulnerability
.
author
vulnerability
.
resolved_at
=
Time
.
now
when
"dismissed"
vulnerability
.
closed_by
=
vulnerability
.
author
vulnerability
.
closed_at
=
Time
.
now
end
vulnerability
end
def
create_occurrence
(
vulnerability
,
rank
,
primary_identifier
)
...
...
@@ -119,10 +135,6 @@ class Gitlab::Seeder::Vulnerabilities
::
Vulnerabilities
::
Occurrence
::
REPORT_TYPES
.
keys
.
sample
end
def
random_state
::
Vulnerability
.
states
.
keys
.
sample
end
def
metadata
(
line
)
{
description:
"The cipher does not provide data integrity update 1"
,
...
...
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