diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2017-11-16 19:44:14 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2017-11-28 00:36:48 +0100 |
commit | 8d3e80692cbeea06dd28a052554f0c262004e18d (patch) | |
tree | 7a685f0a443feaba39f777b372aa423c3656b673 /lib/api | |
parent | 83607a4daf497c73ddeb599194c36ff8ef491ed2 (diff) | |
download | gitlab-ce-8d3e80692cbeea06dd28a052554f0c262004e18d.tar.gz |
Add information about project
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 17 | ||||
-rw-r--r-- | lib/api/runners.rb | 6 |
2 files changed, 17 insertions, 6 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 7d5d68c8f14..cea9e9a8028 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -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 diff --git a/lib/api/runners.rb b/lib/api/runners.rb index 56b70681852..b92a2c36cf3 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -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::JobWithProject end end |