summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-03-06 11:50:32 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-03-06 14:34:47 +0100
commit75123fa9f706a6ab7cdd5dba4393ad9d8bac0947 (patch)
tree39beb2ae628d37005d3be7d09957ea4616421a77 /lib/api
parent194223476b8df57a56ba096c7a300d51d2e3e750 (diff)
downloadgitlab-ce-75123fa9f706a6ab7cdd5dba4393ad9d8bac0947.tar.gz
Incorporate review, drop old endpoint
The endpoint dropped, get ':id/repository/commits/:sha/jobs', should be replace by a new endpoint.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/jobs.rb21
-rw-r--r--lib/api/v3/deployments.rb8
2 files changed, 4 insertions, 25 deletions
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index b48574e173f..33c05e8aa63 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -40,27 +40,6 @@ module API
user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
- desc 'Get jobs for a specific commit of a project' do
- success Entities::Job
- end
- params do
- requires :sha, type: String, desc: 'The SHA id of a commit'
- use :optional_scope
- use :pagination
- end
- get ':id/repository/commits/:sha/jobs' do
- authorize_read_builds!
-
- return not_found! unless user_project.commit(params[:sha])
-
- pipelines = user_project.pipelines.where(sha: params[:sha])
- builds = user_project.builds.where(pipeline: pipelines).order('id DESC')
- builds = filter_builds(builds, params[:scope])
-
- present paginate(builds), with: Entities::Job,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
- end
-
desc 'Get a specific job of a project' do
success Entities::Job
end
diff --git a/lib/api/v3/deployments.rb b/lib/api/v3/deployments.rb
index c5feb49b22f..545485fac0a 100644
--- a/lib/api/v3/deployments.rb
+++ b/lib/api/v3/deployments.rb
@@ -11,7 +11,7 @@ module API
resource :projects do
desc 'Get all deployments of the project' do
detail 'This feature was introduced in GitLab 8.11.'
- success Entities::Deployment
+ success ::API::V3::Deployments
end
params do
use :pagination
@@ -19,12 +19,12 @@ module API
get ':id/deployments' do
authorize! :read_deployment, user_project
- present paginate(user_project.deployments), with: Entities::Deployment
+ present paginate(user_project.deployments), with: ::API::V3::Deployments
end
desc 'Gets a specific deployment' do
detail 'This feature was introduced in GitLab 8.11.'
- success Entities::Deployment
+ success ::API::V3::Deployments
end
params do
requires :deployment_id, type: Integer, desc: 'The deployment ID'
@@ -34,7 +34,7 @@ module API
deployment = user_project.deployments.find(params[:deployment_id])
- present deployment, with: Entities::Deployment
+ present deployment, with: ::API::V3::Deployments
end
end
end