summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-07-20 15:46:56 +0900
committerShinya Maeda <shinya@gitlab.com>2018-07-20 15:46:56 +0900
commit402ae97ecf7f9e3fe541f2d6abef6e47ab740452 (patch)
treec8437dbc871ab272e441426201868bb7ed9a1649
parent75f75b3f5988398fff0660ca5f04aec756ab03bb (diff)
downloadgitlab-ce-402ae97ecf7f9e3fe541f2d6abef6e47ab740452.tar.gz
Make GENERAL_ARCHIVE_FILE_TYPE as a single entry
-rw-r--r--app/models/ci/job_artifact.rb6
-rw-r--r--lib/gitlab/ci/config/entry/artifacts.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb
index c4f1e900615..6fc2d9e8282 100644
--- a/app/models/ci/job_artifact.rb
+++ b/app/models/ci/job_artifact.rb
@@ -19,7 +19,7 @@ module Ci
scope :with_files_stored_locally, -> { where(file_store: [nil, ::JobArtifactUploader::Store::LOCAL]) }
scope :test_reports, -> do
- types = self.file_types.select { |k, v| TEST_REPORTS_FILE_TYPES.include?(k) }.values
+ types = self.file_types.select { |k, _| TEST_REPORT_FILE_TYPES.include?(k) }.values
where(file_type: types)
end
@@ -33,8 +33,8 @@ module Ci
junit: 4
}
- GENERAL_FILE_TYPES = %w[archive].freeze
- TEST_REPORTS_FILE_TYPES = %w[junit].freeze
+ GENERAL_ARCHIVE_FILE_TYPE = 'archive'.freeze
+ TEST_REPORT_FILE_TYPES = %w[junit].freeze
DEFAULT_FILE_NAMES = { junit: 'junit.xml' }.freeze
enum file_format: {
diff --git a/lib/gitlab/ci/config/entry/artifacts.rb b/lib/gitlab/ci/config/entry/artifacts.rb
index bc5013dba6a..b276f7ec8d1 100644
--- a/lib/gitlab/ci/config/entry/artifacts.rb
+++ b/lib/gitlab/ci/config/entry/artifacts.rb
@@ -80,11 +80,11 @@ module Gitlab
end
def general_artifact?
- ::Ci::JobArtifact::GENERAL_FILE_TYPES.include?(@config[:artifact_type])
+ ::Ci::JobArtifact::GENERAL_ARCHIVE_FILE_TYPE == @config[:artifact_type]
end
def report_artifact?
- ::Ci::JobArtifact::TEST_REPORTS_FILE_TYPES.include?(@config[:artifact_type])
+ ::Ci::JobArtifact::TEST_REPORT_FILE_TYPES.include?(@config[:artifact_type])
end
end
end