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
f5fb6d8f
Commit
f5fb6d8f
authored
Jan 29, 2020
by
Can Eldem
Committed by
James Lopez
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use cache_key for invalidating LC report
parent
c01d0411
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
6 deletions
+2
-6
ee/app/models/software_license_policy.rb
ee/app/models/software_license_policy.rb
+0
-4
ee/app/services/ci/compare_license_scanning_reports_service.rb
...p/services/ci/compare_license_scanning_reports_service.rb
+1
-1
ee/spec/models/merge_request_spec.rb
ee/spec/models/merge_request_spec.rb
+1
-1
No files found.
ee/app/models/software_license_policy.rb
View file @
f5fb6d8f
...
...
@@ -53,10 +53,6 @@ class SoftwareLicensePolicy < ApplicationRecord
LEGACY_CLASSIFICATION_STATUS
.
key
(
classification
)
||
classification
end
def
self
.
workaround_cache_key
pluck
(
:id
,
:classification
).
flatten
end
def
self
.
to_classification
(
approval_status
)
LEGACY_CLASSIFICATION_STATUS
.
fetch
(
approval_status
,
approval_status
)
end
...
...
ee/app/services/ci/compare_license_scanning_reports_service.rb
View file @
f5fb6d8f
...
...
@@ -17,7 +17,7 @@ module Ci
private
def
key
(
base_pipeline
,
head_pipeline
)
super
(
base_pipeline
,
head_pipeline
)
+
project
.
software_license_policies
.
workaround_cache_key
super
(
base_pipeline
,
head_pipeline
)
+
[
project
.
software_license_policies
.
cache_key
]
end
end
end
ee/spec/models/merge_request_spec.rb
View file @
f5fb6d8f
...
...
@@ -523,7 +523,7 @@ describe MergeRequest do
expect_any_instance_of
(
Ci
::
CompareLicenseScanningReportsService
)
.
to
receive
(
:execute
).
with
(
base_pipeline
,
head_pipeline
).
and_call_original
expect
(
subject
[
:key
]
).
to
include
(
*
[
license_1
.
id
,
license_1
.
classification
,
license_2
.
id
,
license_2
.
classification
]
)
expect
(
subject
[
:key
]
.
last
).
to
include
(
"software_license_policies/query-"
)
end
end
...
...
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