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
518338ea
Commit
518338ea
authored
Sep 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
296e93a4
d645196c
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
43 additions
and
12 deletions
+43
-12
app/presenters/blob_presenter.rb
app/presenters/blob_presenter.rb
+16
-2
app/presenters/blobs/unfold_presenter.rb
app/presenters/blobs/unfold_presenter.rb
+3
-5
changelogs/unreleased/65152-unfolded-lines-perf-improvement.yml
...logs/unreleased/65152-unfolded-lines-perf-improvement.yml
+5
-0
doc/user/application_security/index.md
doc/user/application_security/index.md
+1
-1
doc/user/application_security/license_compliance/img/license_compliance_add_license.png
...license_compliance/img/license_compliance_add_license.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png
...e_compliance/img/license_compliance_add_license_v12_3.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png
...icense_compliance/img/license_compliance_pipeline_tab.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png
..._compliance/img/license_compliance_pipeline_tab_v12_3.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_search.png
...rity/license_compliance/img/license_compliance_search.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png
...icense_compliance/img/license_compliance_search_v12_3.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_settings.png
...ty/license_compliance/img/license_compliance_settings.png
+0
-0
doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png
...ense_compliance/img/license_compliance_settings_v12_3.png
+0
-0
doc/user/application_security/license_compliance/index.md
doc/user/application_security/license_compliance/index.md
+4
-4
spec/presenters/blob_presenter_spec.rb
spec/presenters/blob_presenter_spec.rb
+14
-0
No files found.
app/presenters/blob_presenter.rb
View file @
518338ea
...
...
@@ -3,12 +3,12 @@
class
BlobPresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
presents
:blob
def
highlight
(
plain:
nil
)
def
highlight
(
to:
nil
,
plain:
nil
)
load_all_blob_data
Gitlab
::
Highlight
.
highlight
(
blob
.
path
,
blob
.
data
,
limited_blob_data
(
to:
to
)
,
language:
blob
.
language_from_gitattributes
,
plain:
plain
)
...
...
@@ -23,4 +23,18 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
def
load_all_blob_data
blob
.
load_all_data!
if
blob
.
respond_to?
(
:load_all_data!
)
end
def
limited_blob_data
(
to:
nil
)
return
blob
.
data
if
to
.
blank?
# Even though we don't need all the lines at the start of the file (e.g
# viewing the middle part of a file), they still need to be highlighted
# to ensure that the succeeding lines can be formatted correctly (e.g.
# multi-line comments).
all_lines
[
0
..
to
-
1
].
join
end
def
all_lines
@all_lines
||=
blob
.
data
.
lines
end
end
app/presenters/blobs/unfold_presenter.rb
View file @
518338ea
...
...
@@ -26,8 +26,6 @@ module Blobs
# so we can accurately show the rest of the diff when unfolding.
load_all_blob_data
@all_lines
=
blob
.
data
.
lines
handle_full_or_end!
end
...
...
@@ -46,7 +44,7 @@ module Blobs
def
lines
strong_memoize
(
:lines
)
do
limit
(
highlight
.
lines
).
map
(
&
:html_safe
)
limit
(
highlight
(
to:
to
)
.
lines
).
map
(
&
:html_safe
)
end
end
...
...
@@ -76,7 +74,7 @@ module Blobs
def
all_lines_size
strong_memoize
(
:all_lines_size
)
do
@
all_lines
.
size
all_lines
.
size
end
end
...
...
@@ -101,7 +99,7 @@ module Blobs
def
limited_blob_lines
strong_memoize
(
:limited_blob_lines
)
do
limit
(
@
all_lines
)
limit
(
all_lines
)
end
end
...
...
changelogs/unreleased/65152-unfolded-lines-perf-improvement.yml
0 → 100644
View file @
518338ea
---
title
:
Support selective highlighting of lines
merge_request
:
32514
author
:
type
:
performance
doc/user/application_security/index.md
View file @
518338ea
...
...
@@ -28,7 +28,7 @@ GitLab can scan and report any vulnerabilities found in your project.
|
[
Dependency List
](
dependency_list/index.md
)
**(ULTIMATE)**
| View your project's dependencies and their known vulnerabilities. |
|
[
Dependency Scanning
](
dependency_scanning/index.md
)
**(ULTIMATE)**
| Analyze your dependencies for known vulnerabilities. |
|
[
Dynamic Application Security Testing (DAST)
](
dast/index.md
)
**(ULTIMATE)**
| Analyze running web applications for known vulnerabilities. |
|
[
License Compliance
](
license_
management
/index.md
)
**(ULTIMATE)**
| Search your project's dependencies for their licenses. |
|
[
License Compliance
](
license_
compliance
/index.md
)
**(ULTIMATE)**
| Search your project's dependencies for their licenses. |
|
[
Security Dashboard
](
security_dashboard/index.md
)
**(ULTIMATE)**
| View vulnerabilities in all your projects and groups. |
|
[
Static Application Security Testing (SAST)
](
sast/index.md
)
**(ULTIMATE)**
| Analyze source code for known vulnerabilities. |
...
...
doc/user/application_security/license_compliance/img/license_compliance_add_license.png
deleted
100644 → 0
View file @
296e93a4
23.7 KB
doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png
0 → 100644
View file @
518338ea
13.7 KB
doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png
deleted
100644 → 0
View file @
296e93a4
11.8 KB
doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png
0 → 100644
View file @
518338ea
16 KB
doc/user/application_security/license_compliance/img/license_compliance_search.png
deleted
100644 → 0
View file @
296e93a4
27.6 KB
doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png
0 → 100644
View file @
518338ea
25.5 KB
doc/user/application_security/license_compliance/img/license_compliance_settings.png
deleted
100644 → 0
View file @
296e93a4
43.7 KB
doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png
0 → 100644
View file @
518338ea
14.4 KB
doc/user/application_security/license_compliance/index.md
View file @
518338ea
...
...
@@ -198,7 +198,7 @@ To approve or blacklist a license:
**License Compliance**
section.
1.
Click the
**Add a license**
button.
!
[
License Compliance Add License
](
img/license_compliance_add_license.png
)
!
[
License Compliance Add License
](
img/license_compliance_add_license
_v12_3
.png
)
1.
In the
**License name**
dropdown, either:
-
Select one of the available licenses. You can search for licenses in the field
...
...
@@ -212,13 +212,13 @@ To modify an existing license:
1.
In the
**License Compliance**
list, click the
**Approved/Declined**
dropdown to change it to the desired status.
!
[
License Compliance Settings
](
img/license_compliance_settings.png
)
!
[
License Compliance Settings
](
img/license_compliance_settings
_v12_3
.png
)
Searching for Licenses:
1.
Use the
**Search**
box to search for a specific license.
!
[
License Compliance Search
](
img/license_compliance_search.png
)
!
[
License Compliance Search
](
img/license_compliance_search
_v12_3
.png
)
## License Compliance report under pipelines
...
...
@@ -228,7 +228,7 @@ From your project's left sidebar, navigate to **CI/CD > Pipelines** and click on
pipeline ID that has a
`license_management`
job to see the Licenses tab with the listed
licenses (if any).
![
License Compliance Pipeline Tab
](
img/license_compliance_pipeline_tab.png
)
![
License Compliance Pipeline Tab
](
img/license_compliance_pipeline_tab
_v12_3
.png
)
<!-- ## Troubleshooting
...
...
spec/presenters/blob_presenter_spec.rb
View file @
518338ea
...
...
@@ -39,6 +39,20 @@ describe BlobPresenter, :seed_helper do
subject
.
highlight
(
plain:
true
)
end
context
'"to" param is present'
do
before
do
allow
(
git_blob
)
.
to
receive
(
:data
)
.
and_return
(
"line one
\n
line two
\n
line 3"
)
end
it
'returns limited highlighted content'
do
expect
(
Gitlab
::
Highlight
).
to
receive
(
:highlight
).
with
(
'files/ruby/regex.rb'
,
"line one
\n
"
,
plain:
nil
,
language:
nil
)
subject
.
highlight
(
to:
1
)
end
end
context
'gitlab-language contains a match'
do
before
do
allow
(
blob
).
to
receive
(
:language_from_gitattributes
).
and_return
(
'ruby'
)
...
...
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