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
0599a25f
Commit
0599a25f
authored
Sep 27, 2018
by
Steve Azzopardi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add has_trace to Projects::JobController#show.json
closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/51925
parent
c052f5a9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
1 deletion
+27
-1
app/serializers/build_details_entity.rb
app/serializers/build_details_entity.rb
+1
-0
changelogs/unreleased/51925-expose-has_trace-in-job-api.yml
changelogs/unreleased/51925-expose-has_trace-in-job-api.yml
+5
-0
spec/controllers/projects/jobs_controller_spec.rb
spec/controllers/projects/jobs_controller_spec.rb
+16
-0
spec/fixtures/api/schemas/job/job_details.json
spec/fixtures/api/schemas/job/job_details.json
+5
-1
No files found.
app/serializers/build_details_entity.rb
View file @
0599a25f
...
...
@@ -7,6 +7,7 @@ class BuildDetailsEntity < JobEntity
expose
:coverage
,
:erased_at
,
:duration
expose
:tag_list
,
as: :tags
expose
:has_trace?
,
as: :has_trace
expose
:user
,
using:
UserEntity
expose
:runner
,
using:
RunnerEntity
expose
:pipeline
,
using:
PipelineEntity
...
...
changelogs/unreleased/51925-expose-has_trace-in-job-api.yml
0 → 100644
View file @
0599a25f
---
title
:
Expose has_trace in job API
merge_request
:
21950
author
:
type
:
other
spec/controllers/projects/jobs_controller_spec.rb
View file @
0599a25f
...
...
@@ -337,6 +337,22 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
end
end
context
'when no trace is available'
do
it
'has_trace is false'
do
expect
(
response
).
to
match_response_schema
(
'job/job_details'
)
expect
(
json_response
[
'has_trace'
]).
to
be
false
end
end
context
'when job has trace'
do
let
(
:job
)
{
create
(
:ci_build
,
:running
,
:trace_live
,
pipeline:
pipeline
)
}
it
"has_trace is true"
do
expect
(
response
).
to
match_response_schema
(
'job/job_details'
)
expect
(
json_response
[
'has_trace'
]).
to
be
true
end
end
end
context
'when requesting JSON job is triggered'
do
...
...
spec/fixtures/api/schemas/job/job_details.json
View file @
0599a25f
...
...
@@ -3,12 +3,16 @@
{
"$ref"
:
"job.json"
}
],
"description"
:
"An extension of job.json with more detailed information"
,
"required"
:
[
"has_trace"
],
"properties"
:
{
"artifact"
:
{
"$ref"
:
"artifact.json"
},
"terminal_path"
:
{
"type"
:
"string"
},
"trigger"
:
{
"$ref"
:
"trigger.json"
},
"deployment_status"
:
{
"$ref"
:
"deployment_status.json"
},
"runner"
:
{
"$ref"
:
"runner.json"
},
"runners"
:
{
"type"
:
"runners.json"
}
"runners"
:
{
"type"
:
"runners.json"
},
"has_trace"
:
{
"type"
:
"boolean"
}
}
}
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