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
a665ef1c
Commit
a665ef1c
authored
Jan 17, 2020
by
Tetiana Chupryna
Committed by
Heinrich Lee Yu
Jan 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with new license_scanning artifact
parent
1ae92eb0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
ee/app/models/ee/ci/build.rb
ee/app/models/ee/ci/build.rb
+1
-1
ee/spec/models/ci/build_spec.rb
ee/spec/models/ci/build_spec.rb
+17
-0
No files found.
ee/app/models/ee/ci/build.rb
View file @
a665ef1c
...
...
@@ -24,7 +24,7 @@ module EE
after_save
:stick_build_if_status_changed
delegate
:service_specification
,
to: :runner_session
,
allow_nil:
true
scope
:license_scan
,
->
{
joins
(
:job_artifacts
).
merge
(
::
Ci
::
JobArtifact
.
license_
management
)
}
scope
:license_scan
,
->
{
joins
(
:job_artifacts
).
merge
(
::
Ci
::
JobArtifact
.
license_
scanning_reports
)
}
scope
:max_build_id_by
,
->
(
build_name
,
ref
,
project_path
)
do
select
(
'max(ci_builds.id) as id'
)
.
by_name
(
build_name
)
...
...
ee/spec/models/ci/build_spec.rb
View file @
a665ef1c
...
...
@@ -16,6 +16,23 @@ describe Ci::Build do
let
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:artifact
)
{
create
(
:ee_ci_job_artifact
,
:sast
,
job:
job
,
project:
job
.
project
)
}
describe
'.license_scan'
do
subject
(
:build
)
{
described_class
.
license_scan
.
first
}
let
(
:artifact
)
{
build
.
job_artifacts
.
first
}
context
'with old license_management artifact'
do
let!
(
:license_artifact
)
{
create
(
:ee_ci_job_artifact
,
:license_management
,
job:
job
,
project:
job
.
project
)
}
it
{
expect
(
artifact
.
file_type
).
to
eq
'license_management'
}
end
context
'with new license_scanning artifact'
do
let!
(
:license_artifact
)
{
create
(
:ee_ci_job_artifact
,
:license_scanning
,
job:
job
,
project:
job
.
project
)
}
it
{
expect
(
artifact
.
file_type
).
to
eq
'license_scanning'
}
end
end
describe
'#shared_runners_minutes_limit_enabled?'
do
subject
{
job
.
shared_runners_minutes_limit_enabled?
}
...
...
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