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
0322f8f5
Commit
0322f8f5
authored
Nov 04, 2021
by
Ash McKenzie
Committed by
Andy Soiron
Nov 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't add pipeline to Vulnerabilities::Finding
Related:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73115
parent
e069769f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
ee/db/fixtures/development/20_vulnerabilities.rb
ee/db/fixtures/development/20_vulnerabilities.rb
+1
-4
ee/db/fixtures/development/25_downstream_pipelines.rb
ee/db/fixtures/development/25_downstream_pipelines.rb
+3
-2
No files found.
ee/db/fixtures/development/20_vulnerabilities.rb
View file @
0322f8f5
...
@@ -12,14 +12,10 @@ class Gitlab::Seeder::Vulnerabilities
...
@@ -12,14 +12,10 @@ class Gitlab::Seeder::Vulnerabilities
end
end
def
seed!
def
seed!
return
unless
pipeline
30
.
times
do
|
rank
|
30
.
times
do
|
rank
|
primary_identifier
=
create_identifier
(
rank
)
primary_identifier
=
create_identifier
(
rank
)
vulnerability
=
create_vulnerability
vulnerability
=
create_vulnerability
occurrence
=
create_occurrence
(
vulnerability
,
rank
,
primary_identifier
)
occurrence
=
create_occurrence
(
vulnerability
,
rank
,
primary_identifier
)
# Create finding_pipeline join model
occurrence
.
pipelines
<<
pipeline
# Create occurrence_identifier join models
# Create occurrence_identifier join models
occurrence
.
identifiers
<<
primary_identifier
occurrence
.
identifiers
<<
primary_identifier
occurrence
.
identifiers
<<
create_identifier
(
rank
)
if
rank
%
3
==
0
occurrence
.
identifiers
<<
create_identifier
(
rank
)
if
rank
%
3
==
0
...
@@ -70,6 +66,7 @@ class Gitlab::Seeder::Vulnerabilities
...
@@ -70,6 +66,7 @@ class Gitlab::Seeder::Vulnerabilities
scanner
=
FactoryBot
.
create
(
:vulnerabilities_scanner
,
project:
vulnerability
.
project
)
scanner
=
FactoryBot
.
create
(
:vulnerabilities_scanner
,
project:
vulnerability
.
project
)
FactoryBot
.
create
(
FactoryBot
.
create
(
:vulnerabilities_finding
,
:vulnerabilities_finding
,
:with_pipeline
,
project:
project
,
project:
project
,
vulnerability:
vulnerability
,
vulnerability:
vulnerability
,
scanner:
scanner
,
scanner:
scanner
,
...
...
ee/db/fixtures/development/25_downstream_pipelines.rb
View file @
0322f8f5
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
# EE fixture
# EE fixture
Gitlab
::
Seeder
.
quiet
do
Gitlab
::
Seeder
.
quiet
do
Project
.
not_mass_generated
.
sample
(
5
).
each
do
|
project
|
Project
.
not_mass_generated
.
sample
(
5
).
each
do
|
project
|
project
.
ci_pipelines
.
all
.
sample
(
2
).
each
do
|
pipeline
|
project
.
builds
.
sample
(
2
).
each
do
|
build
|
pipeline
=
build
.
pipeline
next
if
pipeline
.
source_pipeline
next
if
pipeline
.
source_pipeline
target_pipeline
=
Ci
::
Pipeline
target_pipeline
=
Ci
::
Pipeline
...
@@ -15,7 +16,7 @@ Gitlab::Seeder.quiet do
...
@@ -15,7 +16,7 @@ Gitlab::Seeder.quiet do
# link to source pipeline
# link to source pipeline
pipeline
.
sourced_pipelines
.
create!
(
pipeline
.
sourced_pipelines
.
create!
(
source_job:
pipeline
.
builds
.
all
.
sample
,
source_job:
pipeline
.
builds
.
sample
,
source_project:
pipeline
.
project
,
source_project:
pipeline
.
project
,
project:
target_pipeline
.
project
,
project:
target_pipeline
.
project
,
pipeline:
target_pipeline
pipeline:
target_pipeline
...
...
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