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 ...@@ -786,7 +786,9 @@ module Ci
end end
def artifacts_file_for_type(type) 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 end
def coverage_regex 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 ...@@ -1860,7 +1860,7 @@ RSpec.describe Ci::Build do
subject { build.artifacts_file_for_type(file_type) } subject { build.artifacts_file_for_type(file_type) }
it 'queries artifacts for type' do 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 subject
end 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