Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/v3/builds.rb')
-rw-r--r--lib/api/v3/builds.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/api/v3/builds.rb b/lib/api/v3/builds.rb
index 33f9cfa6927..f467fabe8e1 100644
--- a/lib/api/v3/builds.rb
+++ b/lib/api/v3/builds.rb
@@ -12,21 +12,21 @@ module API
helpers do
params :optional_scope do
optional :scope, types: [String, Array[String]], desc: 'The scope of builds to show',
- values: ['pending', 'running', 'failed', 'success', 'canceled'],
- coerce_with: ->(scope) {
- if scope.is_a?(String)
- [scope]
- elsif scope.is_a?(Hashie::Mash)
- scope.values
- else
- ['unknown']
- end
- }
+ values: ['pending', 'running', 'failed', 'success', 'canceled'],
+ coerce_with: ->(scope) {
+ if scope.is_a?(String)
+ [scope]
+ elsif scope.is_a?(Hashie::Mash)
+ scope.values
+ else
+ ['unknown']
+ end
+ }
end
end
desc 'Get a project builds' do
- success V3::Entities::Build
+ success ::API::V3::Entities::Build
end
params do
use :optional_scope
@@ -36,8 +36,8 @@ module API
builds = user_project.builds.order('id DESC')
builds = filter_builds(builds, params[:scope])
- present paginate(builds), with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ present paginate(builds), with: ::API::V3::Entities::Build,
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
desc 'Get builds for a specific commit of a project' do
@@ -58,7 +58,7 @@ module API
builds = filter_builds(builds, params[:scope])
present paginate(builds), with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
desc 'Get a specific build of a project' do
@@ -73,7 +73,7 @@ module API
build = get_build!(params[:build_id])
present build, with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
desc 'Download the artifacts file from build' do
@@ -141,7 +141,7 @@ module API
build.cancel
present build, with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
desc 'Retry a specific build of a project' do
@@ -159,7 +159,7 @@ module API
build = Ci::Build.retry(build, current_user)
present build, with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
desc 'Erase build (remove artifacts and build trace)' do
@@ -176,7 +176,7 @@ module API
build.erase(erased_by: current_user)
present build, with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :download_build_artifacts, user_project)
+ user_can_download_artifacts: can?(current_user, :download_build_artifacts, user_project)
end
desc 'Keep the artifacts to prevent them from being deleted' do
@@ -195,7 +195,7 @@ module API
status 200
present build, with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
desc 'Trigger a manual build' do
@@ -216,7 +216,7 @@ module API
status 200
present build, with: Entities::Build,
- user_can_download_artifacts: can?(current_user, :read_build, user_project)
+ user_can_download_artifacts: can?(current_user, :read_build, user_project)
end
end