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
c86fa0e4
Commit
c86fa0e4
authored
May 21, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename with_all_reports to with_reports
parent
9e6f3774
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
app/models/ci/job_artifact.rb
app/models/ci/job_artifact.rb
+9
-4
app/serializers/build_details_entity.rb
app/serializers/build_details_entity.rb
+1
-1
app/serializers/job_artifact_report_entity.rb
app/serializers/job_artifact_report_entity.rb
+1
-3
spec/models/ci/job_artifact_spec.rb
spec/models/ci/job_artifact_spec.rb
+2
-2
No files found.
app/models/ci/job_artifact.rb
View file @
c86fa0e4
...
...
@@ -26,10 +26,13 @@ module Ci
metrics:
'metrics.txt'
}.
freeze
TYPE_AND_FORMAT_PAIR
S
=
{
INTERNAL_TYPE
S
=
{
archive: :zip
,
metadata: :gzip
,
trace: :raw
,
trace: :raw
}.
freeze
REPORT_TYPES
=
{
junit: :gzip
,
metrics: :gzip
,
...
...
@@ -45,6 +48,8 @@ module Ci
performance: :raw
}.
freeze
TYPE_AND_FORMAT_PAIRS
=
INTERNAL_TYPES
.
merge
(
REPORT_TYPES
).
freeze
belongs_to
:project
belongs_to
:job
,
class_name:
"Ci::Build"
,
foreign_key: :job_id
...
...
@@ -66,8 +71,8 @@ module Ci
where
(
file_type:
types
)
end
scope
:with_
all_
reports
,
->
do
w
here
(
file_type:
self
.
file_types
.
values
.
drop
(
3
))
scope
:with_reports
,
->
do
w
ith_file_types
(
REPORT_TYPES
.
keys
.
map
(
&
:to_s
))
end
scope
:test_reports
,
->
do
...
...
app/serializers/build_details_entity.rb
View file @
c86fa0e4
...
...
@@ -43,7 +43,7 @@ class BuildDetailsEntity < JobEntity
end
expose
:reports
,
if:
->
(
*
)
{
can?
(
current_user
,
:read_build
,
build
)
},
using:
JobArtifactReportEntity
do
|
build
|
build
.
job_artifacts
.
merge
(
Ci
::
JobArtifact
.
with_all_reports
)
build
.
job_artifacts
.
with_reports
end
expose
:erased_by
,
if:
->
(
*
)
{
build
.
erased?
},
using:
UserEntity
...
...
app/serializers/job_artifact_report_entity.rb
View file @
c86fa0e4
...
...
@@ -8,8 +8,6 @@ class JobArtifactReportEntity < Grape::Entity
expose
:size
expose
:download_path
do
|
artifact
|
download_project_job_artifacts_path
(
job
.
project
,
job
,
file_type:
artifact
.
file_format
)
download_project_job_artifacts_path
(
artifact
.
job
.
project
,
artifact
.
job
,
file_type:
artifact
.
file_format
)
end
alias_method
:job
,
:object
end
spec/models/ci/job_artifact_spec.rb
View file @
c86fa0e4
...
...
@@ -23,10 +23,10 @@ describe Ci::JobArtifact do
it_behaves_like
'having unique enum values'
describe
'.with_
all_
reports'
do
describe
'.with_reports'
do
let!
(
:artifact
)
{
create
(
:ci_job_artifact
,
:archive
)
}
subject
{
described_class
.
with_
all_
reports
}
subject
{
described_class
.
with_reports
}
it
{
is_expected
.
to
be_empty
}
...
...
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