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
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/ci/helpers/runner.rb4
-rw-r--r--lib/api/ci/job_artifacts.rb6
-rw-r--r--lib/api/ci/runner.rb1
3 files changed, 9 insertions, 2 deletions
diff --git a/lib/api/ci/helpers/runner.rb b/lib/api/ci/helpers/runner.rb
index 382528c814c..02a0e6bd722 100644
--- a/lib/api/ci/helpers/runner.rb
+++ b/lib/api/ci/helpers/runner.rb
@@ -140,6 +140,10 @@ module API
# noop: overridden in EE
end
+ def audit_download(build, filename)
+ # noop: overridden in EE
+ end
+
def check_if_backoff_required!
return unless Gitlab::Database::Migrations::RunnerBackoff::Communicator.backoff_runner?
diff --git a/lib/api/ci/job_artifacts.rb b/lib/api/ci/job_artifacts.rb
index 3788f5bec41..cdc31889408 100644
--- a/lib/api/ci/job_artifacts.rb
+++ b/lib/api/ci/job_artifacts.rb
@@ -14,6 +14,8 @@ module API
def authorize_download_artifacts!
authorize_read_builds!
end
+
+ def audit_download(build, filename); end
end
params do
@@ -44,7 +46,7 @@ module API
latest_build = user_project.latest_successful_build_for_ref!(params[:job], params[:ref_name])
authorize_read_job_artifacts!(latest_build)
-
+ audit_download(latest_build, latest_build.artifacts_file.filename)
present_artifacts_file!(latest_build.artifacts_file)
end
@@ -104,7 +106,7 @@ module API
build = find_build!(params[:job_id])
authorize_read_job_artifacts!(build)
-
+ audit_download(build, build.artifacts_file&.filename) if build.artifacts_file
present_artifacts_file!(build.artifacts_file)
end
diff --git a/lib/api/ci/runner.rb b/lib/api/ci/runner.rb
index 585e9f962a3..1ea62e03fba 100644
--- a/lib/api/ci/runner.rb
+++ b/lib/api/ci/runner.rb
@@ -386,6 +386,7 @@ module API
get '/:id/artifacts', feature_category: :build_artifacts do
authenticate_job_via_dependent_job!
+ audit_download(current_job, current_job.artifacts_file&.filename) if current_job.artifacts_file
present_artifacts_file!(current_job.artifacts_file, supports_direct_download: params[:direct_download])
end
end