Commit e8dae231 authored by Patrick Bajao's avatar Patrick Bajao

Merge branch 'gy-artifact-download-multiple-types' into 'master'

Adjust job report artifacts downloads to handle multiple possible types

See merge request gitlab-org/gitlab!53141
parents fb45e290 f86783d5
......@@ -786,7 +786,9 @@ module Ci
end
def artifacts_file_for_type(type)
job_artifacts.find_by(file_type: Ci::JobArtifact.file_types[type])&.file
file_types = Ci::JobArtifact.associated_file_types_for(type)
file_types_ids = file_types&.map { |file_type| Ci::JobArtifact.file_types[file_type] }
job_artifacts.find_by(file_type: file_types_ids)&.file
end
def coverage_regex
......
---
title: Adjust job report artifacts downloads to handle multiple types
merge_request: 53141
author:
type: fixed
......@@ -1860,7 +1860,7 @@ RSpec.describe Ci::Build do
subject { build.artifacts_file_for_type(file_type) }
it 'queries artifacts for type' do
expect(build).to receive_message_chain(:job_artifacts, :find_by).with(file_type: Ci::JobArtifact.file_types[file_type])
expect(build).to receive_message_chain(:job_artifacts, :find_by).with(file_type: [Ci::JobArtifact.file_types[file_type]])
subject
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment