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
8d3e8069
Commit
8d3e8069
authored
Nov 16, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add information about project
parent
83607a4d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
10 deletions
+30
-10
doc/api/runners.md
doc/api/runners.md
+9
-0
lib/api/entities.rb
lib/api/entities.rb
+13
-4
lib/api/runners.rb
lib/api/runners.rb
+4
-2
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+4
-4
No files found.
doc/api/runners.md
View file @
8d3e8069
...
...
@@ -261,6 +261,15 @@ Example response:
"sha"
:
"97de212e80737a608d939f648d959671fb0a0142"
,
"ref"
:
"master"
,
"status"
:
"pending"
},
"project"
:
{
"id"
:
1
,
"description"
:
null
,
"name"
:
"project1"
,
"name_with_namespace"
:
"John Doe2 / project1"
,
"path"
:
"project1"
,
"path_with_namespace"
:
"namespace1/project1"
,
"created_at"
:
"2017-11-16T18:38:46.620Z"
}
}
]
...
...
lib/api/entities.rb
View file @
8d3e8069
...
...
@@ -80,16 +80,21 @@ module API
expose
:group_access
,
as: :group_access_level
end
class
BasicProjectDetails
<
Grape
::
Entity
expose
:id
,
:description
,
:default_branch
,
:tag_list
expose
:ssh_url_to_repo
,
:http_url_to_repo
,
:web_url
class
ProjectIdentity
<
Grape
::
Entity
expose
:id
,
:description
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:created_at
end
class
BasicProjectDetails
<
ProjectIdentity
expose
:default_branch
,
:tag_list
expose
:ssh_url_to_repo
,
:http_url_to_repo
,
:web_url
expose
:avatar_url
do
|
project
,
options
|
project
.
avatar_url
(
only_path:
false
)
end
expose
:star_count
,
:forks_count
expose
:
created_at
,
:
last_activity_at
expose
:last_activity_at
end
class
Project
<
BasicProjectDetails
...
...
@@ -838,6 +843,10 @@ module API
expose
:pipeline
,
with:
PipelineBasic
end
class
JobWithProject
<
Job
expose
:project
,
with:
ProjectIdentity
end
class
Trigger
<
Grape
::
Entity
expose
:id
expose
:token
,
:description
...
...
lib/api/runners.rb
View file @
8d3e8069
...
...
@@ -85,7 +85,9 @@ module API
destroy_conditionally!
(
runner
)
end
desc
'List jobs running on a runner'
desc
'List jobs running on a runner'
do
success
Entities
::
JobWithProject
end
params
do
requires
:id
,
type:
Integer
,
desc:
'The ID of the runner'
use
:pagination
...
...
@@ -94,7 +96,7 @@ module API
runner
=
get_runner
(
params
[
:id
])
authenticate_list_runners_jobs!
(
runner
)
present
paginate
(
runner
.
builds
.
running
),
with:
Entities
::
Job
present
paginate
(
runner
.
builds
.
running
),
with:
Entities
::
Job
WithProject
end
end
...
...
spec/requests/api/runners_spec.rb
View file @
8d3e8069
...
...
@@ -356,10 +356,10 @@ describe API::Runners do
describe
'GET /runners/:id/jobs'
do
let!
(
:job_1
)
{
create
(
:ci_build
)
}
let!
(
:job_2
)
{
create
(
:ci_build
,
:running
,
runner:
shared_runner
)
}
let!
(
:job_3
)
{
create
(
:ci_build
,
:failed
,
runner:
shared_runner
)
}
let!
(
:job_4
)
{
create
(
:ci_build
,
:running
,
runner:
specific_runner
)
}
let!
(
:job_5
)
{
create
(
:ci_build
,
:failed
,
runner:
specific_runner
)
}
let!
(
:job_2
)
{
create
(
:ci_build
,
:running
,
runner:
shared_runner
,
project:
project
)
}
let!
(
:job_3
)
{
create
(
:ci_build
,
:failed
,
runner:
shared_runner
,
project:
project
)
}
let!
(
:job_4
)
{
create
(
:ci_build
,
:running
,
runner:
specific_runner
,
project:
project
)
}
let!
(
:job_5
)
{
create
(
:ci_build
,
:failed
,
runner:
specific_runner
,
project:
project
)
}
context
'admin user'
do
context
'when runner exists'
do
...
...
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