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
d0951b23
Commit
d0951b23
authored
Dec 11, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend Security::Report interface with project methods
parent
28c67a8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
ee/lib/gitlab/ci/reports/security/report.rb
ee/lib/gitlab/ci/reports/security/report.rb
+4
-9
ee/spec/lib/gitlab/ci/reports/security/report_spec.rb
ee/spec/lib/gitlab/ci/reports/security/report_spec.rb
+4
-1
No files found.
ee/lib/gitlab/ci/reports/security/report.rb
View file @
d0951b23
...
...
@@ -5,16 +5,11 @@ module Gitlab
module
Reports
module
Security
class
Report
attr_reader
:created_at
attr_reader
:type
attr_reader
:pipeline
attr_reader
:findings
attr_reader
:scanners
attr_reader
:identifiers
attr_reader
:created_at
,
:type
,
:pipeline
,
:findings
,
:scanners
,
:identifiers
attr_accessor
:scan
,
:scanned_resources
,
:error
attr_accessor
:scan
attr_accessor
:scanned_resources
attr_accessor
:error
delegate
:project
,
to: :pipeline
delegate
:id
,
to: :project
,
prefix:
true
def
initialize
(
type
,
pipeline
,
created_at
)
@type
=
type
...
...
ee/spec/lib/gitlab/ci/reports/security/report_spec.rb
View file @
d0951b23
...
...
@@ -5,10 +5,13 @@ require 'spec_helper'
RSpec
.
describe
Gitlab
::
Ci
::
Reports
::
Security
::
Report
do
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:report
)
{
described_class
.
new
(
'sast'
,
pipeline
,
created_at
)
}
let
(
:created_at
)
{
2
.
weeks
.
ago
}
subject
(
:report
)
{
described_class
.
new
(
'sast'
,
pipeline
,
created_at
)
}
it
{
expect
(
report
.
type
).
to
eq
(
'sast'
)
}
it
{
is_expected
.
to
delegate_method
(
:project
).
to
(
:pipeline
)
}
it
{
is_expected
.
to
delegate_method
(
:id
).
to
(
:project
).
with_prefix
}
describe
'#add_scanner'
do
let
(
:scanner
)
{
create
(
:ci_reports_security_scanner
,
external_id:
'find_sec_bugs'
)
}
...
...
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