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
c27f388e
Commit
c27f388e
authored
Jul 23, 2018
by
Lukas Eipert
Committed by
Rémy Coutable
Jul 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pipeline security dashboard: Move EE specific code to EE folder
parent
b4bf56fc
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
35 deletions
+59
-35
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+2
-7
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+2
-28
ee/app/models/ee/ci/pipeline.rb
ee/app/models/ee/ci/pipeline.rb
+8
-0
ee/app/views/projects/pipelines/_info_extension.html.haml
ee/app/views/projects/pipelines/_info_extension.html.haml
+3
-0
ee/app/views/projects/pipelines/_tabs_content.html.haml
ee/app/views/projects/pipelines/_tabs_content.html.haml
+26
-0
ee/app/views/projects/pipelines/_tabs_holder.html.haml
ee/app/views/projects/pipelines/_tabs_holder.html.haml
+9
-0
ee/spec/serializers/merge_request_widget_entity_spec.rb
ee/spec/serializers/merge_request_widget_entity_spec.rb
+9
-0
No files found.
app/views/projects/pipelines/_info.html.haml
View file @
c27f388e
#js-pipeline-header-vue
.pipeline-header-container
#js-pipeline-header-vue
.pipeline-header-container
-
sast_artifact
=
@pipeline
.
sast_artifact
-
dependency_artifact
=
@pipeline
.
dependency_scanning_artifact
-
dast_artifact
=
@pipeline
.
dast_artifact
-
sast_container_artifact
=
@pipeline
.
sast_container_artifact
-
if
@commit
.
present?
-
if
@commit
.
present?
.commit-box
.commit-box
...
@@ -17,7 +13,7 @@
...
@@ -17,7 +13,7 @@
.well-segment.pipeline-info
.well-segment.pipeline-info
.icon-container
.icon-container
=
icon
(
'clock-o'
)
=
icon
(
'clock-o'
)
=
pluralize
@pipeline
.
statuses
.
count
(
:id
)
,
"job"
=
pluralize
@pipeline
.
total_size
,
"job"
-
if
@pipeline
.
ref
-
if
@pipeline
.
ref
from
from
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
...
@@ -38,5 +34,4 @@
...
@@ -38,5 +34,4 @@
=
link_to
@pipeline
.
sha
,
project_commit_path
(
@project
,
@pipeline
.
sha
),
class:
"commit-sha commit-hash-full"
=
link_to
@pipeline
.
sha
,
project_commit_path
(
@project
,
@pipeline
.
sha
),
class:
"commit-sha commit-hash-full"
=
clipboard_button
(
text:
@pipeline
.
sha
,
title:
"Copy commit SHA to clipboard"
)
=
clipboard_button
(
text:
@pipeline
.
sha
,
title:
"Copy commit SHA to clipboard"
)
-
if
sast_artifact
||
dependency_artifact
||
dast_artifact
||
sast_container_artifact
=
render_if_exists
"projects/pipelines/info_extension"
,
pipeline:
@pipeline
.js-sast-summary
app/views/projects/pipelines/_with_tabs.html.haml
View file @
c27f388e
-
expose_sast_data
=
@pipeline
.
expose_sast_data?
-
expose_dependency_data
=
@pipeline
.
expose_dependency_scanning_data?
-
expose_dast_data
=
@pipeline
.
expose_dast_data?
-
expose_sast_container_data
=
@pipeline
.
expose_sast_container_data?
-
expose_container_scanning_data
=
@pipeline
.
expose_container_scanning_data?
-
blob_path
=
project_blob_path
(
@project
,
@pipeline
.
sha
)
.tabs-holder
.tabs-holder
%ul
.pipelines-tabs.nav-links.no-top.no-bottom.mobile-separator.nav.nav-tabs
%ul
.pipelines-tabs.nav-links.no-top.no-bottom.mobile-separator.nav.nav-tabs
%li
.js-pipeline-tab-link
%li
.js-pipeline-tab-link
...
@@ -19,11 +12,7 @@
...
@@ -19,11 +12,7 @@
=
link_to
failures_project_pipeline_path
(
@project
,
@pipeline
),
data:
{
target:
'#js-tab-failures'
,
action:
'failures'
,
toggle:
'tab'
},
class:
'failures-tab'
do
=
link_to
failures_project_pipeline_path
(
@project
,
@pipeline
),
data:
{
target:
'#js-tab-failures'
,
action:
'failures'
,
toggle:
'tab'
},
class:
'failures-tab'
do
=
_
(
"Failed Jobs"
)
=
_
(
"Failed Jobs"
)
%span
.badge.badge-pill.js-failures-counter
=
@pipeline
.
failed_builds
.
count
%span
.badge.badge-pill.js-failures-counter
=
@pipeline
.
failed_builds
.
count
-
if
expose_sast_data
||
expose_dependency_data
=
render_if_exists
"projects/pipelines/tabs_holder"
,
pipeline:
@pipeline
,
project:
@project
%li
.js-security-tab-link
=
link_to
security_project_pipeline_path
(
@project
,
@pipeline
),
data:
{
target:
'#js-tab-security'
,
action:
'security'
,
toggle:
'tab'
},
class:
'security-tab'
do
=
_
(
"Security report"
)
%span
.badge.badge-pill.js-sast-counter.hidden
.tab-content
.tab-content
#js-tab-pipeline
.tab-pane
#js-tab-pipeline
.tab-pane
...
@@ -87,19 +76,4 @@
...
@@ -87,19 +76,4 @@
%pre
.build-trace.build-trace-rounded
%pre
.build-trace.build-trace-rounded
%code
.bash.js-build-output
%code
.bash.js-build-output
=
build_summary
(
build
)
=
build_summary
(
build
)
-
if
expose_sast_data
||
expose_dependency_data
||
expose_dast_data
||
expose_sast_container_data
||
expose_container_scanning_data
=
render_if_exists
"projects/pipelines/tabs_content"
,
pipeline:
@pipeline
,
project:
@project
#js-tab-security
.build-security.tab-pane
#js-security-report-app
{
data:
{
endpoint:
expose_sast_data
?
sast_artifact_url
(
@pipeline
)
:
nil
,
blob_path:
blob_path
,
dependency_scanning_endpoint:
expose_dependency_data
?
dependency_scanning_artifact_url
(
@pipeline
)
:
nil
,
dast_endpoint:
expose_dast_data
?
dast_artifact_url
(
@pipeline
)
:
nil
,
sast_container_endpoint:
expose_sast_container_data
?
sast_container_artifact_url
(
@pipeline
)
:
(
expose_container_scanning_data
?
container_scanning_artifact_url
(
@pipeline
)
:
nil
),
pipeline_id:
@pipeline
.
id
,
vulnerability_feedback_path:
project_vulnerability_feedback_index_path
(
@project
),
vulnerability_feedback_help_path:
help_page_path
(
"user/project/merge_requests/index"
,
anchor:
"interacting-with-security-reports-ultimate"
),
sast_help_path:
help_page_path
(
'user/project/merge_requests/sast'
),
dependency_scanning_help_path:
help_page_path
(
'user/project/merge_requests/dependency_scanning'
),
dast_help_path:
help_page_path
(
'user/project/merge_requests/dast'
),
sast_container_help_path:
help_page_path
(
'user/project/merge_requests/sast_container'
),
can_create_feedback:
can?
(
current_user
,
:admin_vulnerability_feedback
,
@project
),
can_create_issue:
show_new_issue_link?
(
@project
)}
}
ee/app/models/ee/ci/pipeline.rb
View file @
c27f388e
...
@@ -132,6 +132,14 @@ module EE
...
@@ -132,6 +132,14 @@ module EE
has_performance_data?
has_performance_data?
end
end
def
expose_security_dashboard?
expose_sast_data?
||
expose_dependency_scanning_data?
||
expose_dast_data?
||
expose_sast_container_data?
||
expose_container_scanning_data?
end
# expose_codeclimate_data? is deprecated and replaced with expose_code_quality_data? (#5779)
# expose_codeclimate_data? is deprecated and replaced with expose_code_quality_data? (#5779)
def
expose_codeclimate_data?
def
expose_codeclimate_data?
has_codeclimate_data?
has_codeclimate_data?
...
...
ee/app/views/projects/pipelines/_info_extension.html.haml
0 → 100644
View file @
c27f388e
-
return
unless
local_assigns
.
fetch
(
:pipeline
).
expose_security_dashboard?
.js-sast-summary
ee/app/views/projects/pipelines/_tabs_content.html.haml
0 → 100644
View file @
c27f388e
-
pipeline
=
local_assigns
.
fetch
(
:pipeline
)
-
project
=
local_assigns
.
fetch
(
:project
)
-
return
unless
pipeline
.
expose_security_dashboard?
-
sast_endpoint
=
pipeline
.
expose_sast_data?
?
sast_artifact_url
(
pipeline
)
:
nil
-
dependency_scanning_endpoint
=
pipeline
.
expose_dependency_scanning_data?
?
dependency_scanning_artifact_url
(
pipeline
)
:
nil
-
dast_endpoint
=
pipeline
.
expose_dast_data?
?
dast_artifact_url
(
pipeline
)
:
nil
-
sast_container_endpoint
=
pipeline
.
expose_sast_container_data?
?
sast_container_artifact_url
(
pipeline
)
:
pipeline
.
expose_container_scanning_data?
?
container_scanning_artifact_url
(
pipeline
)
:
nil
-
blob_path
=
project_blob_path
(
project
,
pipeline
.
sha
)
#js-tab-security
.build-security.tab-pane
#js-security-report-app
{
data:
{
endpoint:
sast_endpoint
,
blob_path:
blob_path
,
dependency_scanning_endpoint:
dependency_scanning_endpoint
,
dast_endpoint:
dast_endpoint
,
sast_container_endpoint:
sast_container_endpoint
,
pipeline_id:
pipeline
.
id
,
vulnerability_feedback_path:
project_vulnerability_feedback_index_path
(
project
),
vulnerability_feedback_help_path:
help_page_path
(
"user/project/merge_requests/index"
,
anchor:
"interacting-with-security-reports-ultimate"
),
sast_help_path:
help_page_path
(
'user/project/merge_requests/sast'
),
dependency_scanning_help_path:
help_page_path
(
'user/project/merge_requests/dependency_scanning'
),
dast_help_path:
help_page_path
(
'user/project/merge_requests/dast'
),
sast_container_help_path:
help_page_path
(
'user/project/merge_requests/sast_container'
),
can_create_feedback:
can?
(
current_user
,
:admin_vulnerability_feedback
,
project
),
can_create_issue:
show_new_issue_link?
(
project
)}
}
ee/app/views/projects/pipelines/_tabs_holder.html.haml
0 → 100644
View file @
c27f388e
-
pipeline
=
local_assigns
.
fetch
(
:pipeline
)
-
project
=
local_assigns
.
fetch
(
:project
)
-
return
unless
pipeline
.
expose_security_dashboard?
%li
.js-security-tab-link
=
link_to
security_project_pipeline_path
(
project
,
pipeline
),
data:
{
target:
'#js-tab-security'
,
action:
'security'
,
toggle:
'tab'
},
class:
'security-tab'
do
=
_
(
"Security report"
)
%span
.badge.badge-pill.js-sast-counter.hidden
ee/spec/serializers/merge_request_widget_entity_spec.rb
View file @
c27f388e
...
@@ -32,6 +32,7 @@ describe MergeRequestWidgetEntity do
...
@@ -32,6 +32,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_codeclimate_data?:
true
,
expose_codeclimate_data?:
true
,
expose_security_dashboard?:
false
,
base_codeclimate_artifact:
build
,
base_codeclimate_artifact:
build
,
head_codeclimate_artifact:
build
head_codeclimate_artifact:
build
)
)
...
@@ -44,6 +45,7 @@ describe MergeRequestWidgetEntity do
...
@@ -44,6 +45,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_code_quality_data?:
true
,
expose_code_quality_data?:
true
,
expose_security_dashboard?:
false
,
base_code_quality_artifact:
build
,
base_code_quality_artifact:
build
,
head_code_quality_artifact:
build
head_code_quality_artifact:
build
)
)
...
@@ -60,6 +62,7 @@ describe MergeRequestWidgetEntity do
...
@@ -60,6 +62,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_performance_data?:
true
,
expose_performance_data?:
true
,
expose_security_dashboard?:
false
,
base_performance_artifact:
build
,
base_performance_artifact:
build
,
head_performance_artifact:
build
head_performance_artifact:
build
)
)
...
@@ -72,6 +75,7 @@ describe MergeRequestWidgetEntity do
...
@@ -72,6 +75,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_sast_data?:
true
,
expose_sast_data?:
true
,
expose_security_dashboard?:
true
,
base_has_sast_data?:
true
,
base_has_sast_data?:
true
,
base_sast_artifact:
build
,
base_sast_artifact:
build
,
head_sast_artifact:
build
head_sast_artifact:
build
...
@@ -87,6 +91,7 @@ describe MergeRequestWidgetEntity do
...
@@ -87,6 +91,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_dependency_scanning_data?:
true
,
expose_dependency_scanning_data?:
true
,
expose_security_dashboard?:
true
,
base_has_dependency_scanning_data?:
true
,
base_has_dependency_scanning_data?:
true
,
base_dependency_scanning_artifact:
build
,
base_dependency_scanning_artifact:
build
,
head_dependency_scanning_artifact:
build
head_dependency_scanning_artifact:
build
...
@@ -102,6 +107,7 @@ describe MergeRequestWidgetEntity do
...
@@ -102,6 +107,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_license_management_data?:
true
,
expose_license_management_data?:
true
,
expose_security_dashboard?:
false
,
base_has_license_management_data?:
true
,
base_has_license_management_data?:
true
,
base_license_management_artifact:
build
,
base_license_management_artifact:
build
,
head_license_management_artifact:
build
head_license_management_artifact:
build
...
@@ -118,6 +124,7 @@ describe MergeRequestWidgetEntity do
...
@@ -118,6 +124,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_sast_container_data?:
true
,
expose_sast_container_data?:
true
,
expose_security_dashboard?:
true
,
base_has_sast_container_data?:
true
,
base_has_sast_container_data?:
true
,
base_sast_container_artifact:
build
,
base_sast_container_artifact:
build
,
head_sast_container_artifact:
build
head_sast_container_artifact:
build
...
@@ -133,6 +140,7 @@ describe MergeRequestWidgetEntity do
...
@@ -133,6 +140,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_container_scanning_data?:
true
,
expose_container_scanning_data?:
true
,
expose_security_dashboard?:
true
,
base_has_container_scanning_data?:
true
,
base_has_container_scanning_data?:
true
,
base_container_scanning_artifact:
build
,
base_container_scanning_artifact:
build
,
head_container_scanning_artifact:
build
head_container_scanning_artifact:
build
...
@@ -148,6 +156,7 @@ describe MergeRequestWidgetEntity do
...
@@ -148,6 +156,7 @@ describe MergeRequestWidgetEntity do
allow
(
merge_request
).
to
receive_messages
(
allow
(
merge_request
).
to
receive_messages
(
expose_dast_data?:
true
,
expose_dast_data?:
true
,
expose_security_dashboard?:
true
,
base_has_dast_data?:
true
,
base_has_dast_data?:
true
,
base_dast_artifact:
build
,
base_dast_artifact:
build
,
head_dast_artifact:
build
head_dast_artifact:
build
...
...
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