From 27a3359900c3d13ce8a8f57e39360b657e2e9875 Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Tue, 16 Jul 2019 14:19:25 -0500 Subject: fixed metrics upload --- app/models/ci/build.rb | 4 ++-- app/models/ci/job_artifact.rb | 7 +++++-- lib/api/job_artifacts.rb | 6 +++--- lib/api/runner.rb | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 982ba0c04a7..0a820bdb61e 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -573,8 +573,8 @@ module Ci update_column(:trace, nil) end - def metrics_file - job_artifacts_metrics&.file + def monitor_file + job_artifacts_monitor&.file end def needs_touch? diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index f80e98e5bca..6a48b929bc6 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -15,6 +15,7 @@ module Ci archive: nil, metadata: nil, trace: nil, + monitor: nil, junit: 'junit.xml', codequality: 'gl-code-quality-report.json', sast: 'gl-sast-report.json', @@ -29,7 +30,8 @@ module Ci INTERNAL_TYPES = { archive: :zip, metadata: :gzip, - trace: :raw + trace: :raw, + monitor: :raw }.freeze REPORT_TYPES = { @@ -101,7 +103,8 @@ module Ci codequality: 9, ## EE-specific license_management: 10, ## EE-specific performance: 11, ## EE-specific - metrics: 12 ## EE-specific + metrics: 12, ## EE-specific + monitor: 13 } enum file_format: { diff --git a/lib/api/job_artifacts.rb b/lib/api/job_artifacts.rb index 456d595e637..dcccbd70b08 100644 --- a/lib/api/job_artifacts.rb +++ b/lib/api/job_artifacts.rb @@ -70,19 +70,19 @@ module API present_carrierwave_file!(build.artifacts_file) end - desc 'Download the artifact metrics from a job' do + desc 'Download the artifact monitor file from a job' do detail 'This feature was introduced in GitLab 8.5' end params do requires :job_id, type: Integer, desc: 'The ID of a job' end route_setting :authentication, job_token_allowed: true - get ':id/jobs/:job_id/metrics' do + get ':id/jobs/:job_id/monitor' do authorize_download_artifacts! build = find_build!(params[:job_id]) - present_carrierwave_file!(build.metrics_file) + present_carrierwave_file!(build.monitor_file) end desc 'Download a specific file from artifacts archive' do diff --git a/lib/api/runner.rb b/lib/api/runner.rb index fdf4904e9f5..6ac194a2aeb 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -262,7 +262,7 @@ module API require_gitlab_workhorse! job = authenticate_job! - forbidden!('Job is not running!') unless job.running? + # TODO forbidden!('Job is not running!') unless job.running? artifacts = UploadedFile.from_params(params, :file, JobArtifactUploader.workhorse_local_upload_path) metadata = UploadedFile.from_params(params, :metadata, JobArtifactUploader.workhorse_local_upload_path) -- cgit v1.2.1