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/ci/jobs.rb')
-rw-r--r--lib/api/ci/jobs.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/api/ci/jobs.rb b/lib/api/ci/jobs.rb
index 04999b5fb44..97471d3c96e 100644
--- a/lib/api/ci/jobs.rb
+++ b/lib/api/ci/jobs.rb
@@ -4,6 +4,9 @@ module API
module Ci
class Jobs < ::API::Base
include PaginationParams
+
+ helpers ::API::Helpers::ProjectStatsRefreshConflictsHelpers
+
before { authenticate! }
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
@@ -137,6 +140,8 @@ module API
authorize!(:erase_build, build)
break forbidden!('Job is not erasable!') unless build.erasable?
+ reject_if_build_artifacts_size_refreshing!(build.project)
+
build.erase(erased_by: current_user)
present build, with: Entities::Ci::Job
end
@@ -204,7 +209,7 @@ module API
.select { |_role, role_access_level| role_access_level <= user_access_level }
.map(&:first)
- environment = if environment_slug = current_authenticated_job.deployment&.environment&.slug
+ environment = if environment_slug = current_authenticated_job.persisted_environment&.slug
{ slug: environment_slug }
end