gitlab-org--gitlab-foss/app/models/ci/build.rb

744 lines
22 KiB
Ruby
Raw Normal View History

2015-08-26 01:42:46 +00:00
module Ci
2015-10-06 10:01:16 +00:00
class Build < CommitStatus
prepend ArtifactMigratable
include TokenAuthenticatable
include AfterCommitQueue
2018-02-26 19:14:00 +00:00
include ObjectStorage::BackgroundMove
include Presentable
2017-09-01 08:54:07 +00:00
include Importable
include Gitlab::Utils::StrongMemoize
MissingDependenciesError = Class.new(StandardError)
belongs_to :project, inverse_of: :builds
belongs_to :runner
belongs_to :trigger_request
belongs_to :erased_by, class_name: 'User'
2015-08-26 01:42:46 +00:00
has_many :deployments, as: :deployable
has_one :last_deployment, -> { order('deployments.id DESC') }, as: :deployable, class_name: 'Deployment'
2017-09-25 16:54:08 +00:00
has_many :trace_sections, class_name: 'Ci::BuildTraceSection'
has_many :trace_chunks, class_name: 'Ci::BuildTraceChunk', foreign_key: :build_id
has_many :job_artifacts, class_name: 'Ci::JobArtifact', foreign_key: :job_id, dependent: :destroy, inverse_of: :job # rubocop:disable Cop/ActiveRecordDependent
Squashed commit of the following: commit c35ca6594eb1d29cac46362d09036f3d128143ed Merge: 87da74fb98a 13ea4b387dd Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 27 13:25:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 87da74fb98aef1f664553ca2b8406ca154e4c19f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:27:45 2018 +0900 Remove unncessary GENERAL_ARCHIVE_FILE_TYPE commit 5a3cfc1fdc8e81dd5647e275f87c0da2d93235b4 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:19:44 2018 +0900 Expand entities in JobRequest::Artifacts commit 660f885ebb25a19182e601181050683d2b6134f6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:06:14 2018 +0900 Add tests commit 60bca3dcfd055647a9f43523b79d5eebdc4bdc5a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:30:52 2018 +0900 Simplify build runner presenter commit 81d1951d5562bec4086d719748360f3f24df4168 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:18:53 2018 +0900 Simplify `scope :test_reports` in job_artifacts commit 15d1d76ca1cb97501c82471eb1c927290071dcfb Merge: f3327b2912d ffbfd18ce2f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:53 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit f3327b2912d0b169e7a059dca7b4d15e77567075 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:44 2018 +0900 Fix "or string" to "or a string". Use be_valid commit 9aaae6d60f7537f55f862f4d61de7a0d3a3b6bc2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:25:57 2018 +0900 Fix spec file name - build_runner_presenter_spec.rb commit 41c64c190e2e2efa7ab91a0daa0598da2d755f05 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:18:12 2018 +0900 Rename to Ci::BuildRunnerPresenter commit e9762299eb66c8f88734f80d05d38b9616a8fde8 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:14:44 2018 +0900 Split methods into three in Ci::Builds::RunnerPresenter commit 6e73070313a782eb63d4fbcbe324d9acaf67334b Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:23:53 2018 +0900 Remove redandant as: :artifacts commit 063f647e4829d9c71a71d227f9946bb47b93691f Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:04:58 2018 +0900 Fix specs commit a45975afd9b9391390c1adafbeab72c970e97b64 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:18:53 2018 +0900 Created a separate presenter commit 431ad666e080124c90e13cbaf0d4f0969aa7b2f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:10:04 2018 +0900 Simplified config presenter commit 2e106569ea258f5f7556a8b454a6dd0e9cbe6902 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:25:05 2018 +0900 Skip file_format setting if the file_type is trace commit 0572bd8357a2e9ea16118a0bd85264e3fb799322 Merge: 30ae33daa1d 6cb30f83255 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:55 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 30ae33daa1d4afcb57e6335fba62a3c5fc98468a Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:23 2018 +0900 Fix spec commit ccb6eb75187030ff0fd3c6e69f89eeca79d2a929 Merge: 1ebaaaf2094 34c57e09b9f Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jul 24 14:27:48 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 1ebaaaf2094c47c03e16745d2f8af736ec102b76 Merge: bfdf565800b dc7b4b7bb97 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 23 14:22:29 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit bfdf565800b58e838a760aa01d2fadb64e2d768f Merge: 681bd6a878a 44dbeccbe10 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 19:10:47 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 681bd6a878ad2a77c278f5619b51c542d7382aa2 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:19:46 2018 +0900 Specify DOWNTIME=false commit 59c4e31390e0d616d69babf8ac857e98f2dc774e Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:14:44 2018 +0900 Wrap long lines commit 3d85788edbe73fc74c72854508e47fe259d99236 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:05:31 2018 +0900 Checking filr_format and file_type paring commit 3c92a22faf6278e7a2d1ee13bd978bc659b72452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:07:21 2018 +0900 Fix build presenter spec commit 36e69897b0524cdee6060c928c03af734afae664 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:02:09 2018 +0900 Erase test reports at the proper timing commit 402ae97ecf7f9e3fe541f2d6abef6e47ab740452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:46:56 2018 +0900 Make GENERAL_ARCHIVE_FILE_TYPE as a single entry commit 75f75b3f5988398fff0660ca5f04aec756ab03bb Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:42:16 2018 +0900 Implement config artifact presenter commit 9ecaee914defba5f12a7a06375ea2876b4328d7f Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 14:27:54 2018 +0900 Introduce ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION check commit 34ea9610ab9a249a576ee435f365b9e1fcca7f00 Merge: d88523ca884 b60364c0f37 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 13:46:52 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit d88523ca88420354f61bd36f533c62a6ca474423 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 21:00:40 2018 +0900 Revert unnecessary change commit d9beb10ede5e4e8abe388fadbd6412640293917a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:57:03 2018 +0900 Remove scattering around erase_test_reports! commit c79f361ca01f8dbc0d395edee5fab7f5a0697934 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:53:00 2018 +0900 Rever archive_metadata refactoring (For simplifying) commit 55bc71a404d8cf5fa87e187f6e88da92ab95afa9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:45:19 2018 +0900 Use array_of_strings_or_string in Command commit 8a576b18c8ab8ead2344e2885aaf2fde11af0328 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:40:06 2018 +0900 Fix spec commit a2cda62fb922184aaf0e78699e06846c96565e0d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:27:11 2018 +0900 Fix presenter spec commit 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:23:41 2018 +0900 Fix artifact migratable commit a3930853c93862007ba6814511bc32042c7f4986 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:15:41 2018 +0900 Increment migration version to use `file_format` when archiving traces commit e31121cb5e617b0f05e375c2150ece0e38e5e0d6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 17:57:15 2018 +0900 Impolement job_artifact.test_reports method commit e54707fdf97392839cb2c4711160bd3bc89da196 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:49:27 2018 +0900 Fix erase method commit 20e95824341af1ebc5877d28dc5eba26f73eddf9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:28:00 2018 +0900 Fix spec commit 7ade498101d02573b20a2405ebe0bdb8efd8aa3b Merge: e7be6b2b362 98eccfc44c5 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 12:37:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit e7be6b2b3624ba44d56143084731cb9a6168f974 Merge: 5a8d4930e01 9bdc9b1ae69 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:36 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 5a8d4930e0127aae311bfa3da70d9ab9637791e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:28 2018 +0900 Evaluate artifact_format commit c3ce06aa9bc6481b37a16d175adf0fd1c37a1bc0 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 22:27:46 2018 +0900 Fix sending junit.xml commit e5ce3668ee65217aba610d5311efd5e82bacddf3 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 19:02:06 2018 +0900 Add spec for Gitlab::Ci::Config::Entry::Artifacts commit ede107caf13fb215045576dcce18e20eec776df1 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:58:28 2018 +0900 Revert refactoring commit 15531ba9feff669b2ac05936e0feaee1856c1571 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:57:31 2018 +0900 Revert refactoring commit 14821f3babcc210bc52e4e825adc8333752fbc88 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:55:41 2018 +0900 Add spec for file format. Add spec for config_artifacts commit 882faeab57ab39d18f72abd9b65d286db92e1011 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:20:28 2018 +0900 Add file_format to factory commit 3cd0513e254db15141cd748f6209179f462974f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:12:52 2018 +0900 Rename migration file properly commit f511933b5f618fc47d1512554878913922dfba61 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:09:57 2018 +0900 Revert artifacts_archive_file refactoring commit e295e8cbdee065ee3af6dd82f512729554237cad Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 16:03:26 2018 +0900 Dry up the converion in Entry::Reports commit b0ffa42f6410be4718e7a36cb21f7b585421750e Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:50:42 2018 +0900 Set file_format at callers commit f3dc7a2e02901c79a9e572514a1b731c680e43cc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:47:51 2018 +0900 Use presenter for presenting artifacts hash to runner commit e5299526138be90d65cf13368134e734b46f7597 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:59:09 2018 +0900 Support deleting junit artifact. Make wording explicit commit cc81c34acf23323257d190c23030d0a89265bccc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:35:12 2018 +0900 Add changelog commit abde0f2ab5c5c1d99b2f94a049984877bb5a4d77 Merge: 4c87e5b388f fabf6a5634f Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 13:22:22 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 4c87e5b388fb098fb6da71e17a47fa204033e4ac Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 17:33:07 2018 +0900 Fix static analysis commit bc96346be6990b75da9a36055814b24b5b805707 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 16:43:02 2018 +0900 Fix Config::Entry::Artifacts commit aac284613b9db43e3021198dc5b43b81806f1bce Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 14:40:20 2018 +0900 Generalized by DEFAULT_FILE_FORMAT commit a79299fdbb0ed74000ca37cff8fef8268cd29b13 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:55:02 2018 +0900 Cleanup API::Entities::JobRequest::Artifacts commit 1650249214768c23f6f46ec62c0c54448017eeb5 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:25:52 2018 +0900 Simplified file_type relations commit 981da91bc4c255ff992870e4e4c4393696f5bece Merge: e79808425eb 924146a8d6b Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:18:20 2018 +0900 Merge branch 'master' into artifact-format-v2 commit e79808425eb63c322a997e71d606d97b85e42048 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 18:16:52 2018 +0900 Remove unnecessary change commit a531bd7487955143489d286a0fb2e5d0984acc52 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 17:40:35 2018 +0900 Fix errors typo commit 57d6f21821c8ad934874c1aac3f627335c64c80d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:32:35 2018 +0900 Use the correct type name commit da4ca63f25a27a1268317952061c81a28516653f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:29:21 2018 +0900 Refactor job_artifacts_metadata to job_artifacts_archive_metadata commit 4098a8f10f92a6efa48080f8925809e251066f9d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:23:55 2018 +0900 Add job_artifacts_junit relation commit 5342f07e100253713dbf50eb303da1977484077f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:14:03 2018 +0900 Fix raw to raw? commit 15e0abcb22d9db3d8ef955e647f0a5d0a49c26b6 Merge: 31252fe8d75 ba38931d90b Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:12:38 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 31252fe8d751319c5390f898f66f0af4a8581013 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 19:05:51 2018 +0900 Temporaly use type Hash for reports commit 583165c0349f40e7be16a8039dbffb4139f94921 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:27:21 2018 +0900 Revert unnecessary change commit eb48369b8311b538f46f59a31f4a6d3f8c9e68e1 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:21:46 2018 +0900 Use file_format raw for trace commit fb69ae8349d58499ad21965c0d1cf95e2b79a8e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:20:10 2018 +0900 Check the presence of the file_format commit c0840224bc8789d35da032c2a0ee48aa9f2232aa Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:16:19 2018 +0900 Add format_restriction validation commit d64fbd388cb2294447df5185366d8b5016591949 Merge: 7ec81e7c7d1 c2a0a3ab1ae Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:11:44 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 7ec81e7c7d115f77d712892dfc79db72b9f5bc7a Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:23:54 2018 +0900 Artifacts presenter (Halfway) commit a3ccbe4c3a9b7d3095fe1929dee5fd9c57e168e0 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:22:52 2018 +0900 Fix schema.rb commit b630c670c707548799c6852e4465ef94fb4a0572 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:26:03 2018 +0900 Allow reports type under artifacts. Allow junit keyword in it. commit e7e37612487b556320d27f4fe0de32cd4ec20720 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:25:10 2018 +0900 Change column name to artifact_format commit f3f25d56a7c627f4bb9d91d19de175273a7a6a81 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 18:02:21 2018 +0900 Rename metadata to archive_metadata, and compress to file_format commit d7e0709319ab8fe35a2598a3d484eb89b1885934 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 17:47:18 2018 +0900 Validate compression. Clean up schema commit beb5990e7e3bfbb308245dc97284aaf9700bd982 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 19:06:54 2018 +0900 Make compression params at the first level commit 1e2e1c0db5412e1aed3bf47562350c20c69dc1a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 16:31:03 2018 +0900 Reorganize components
2018-07-27 05:04:35 +00:00
Ci::JobArtifact.file_types.each do |key, value|
has_one :"job_artifacts_#{key}", -> { where(file_type: value) }, class_name: 'Ci::JobArtifact', inverse_of: :job, foreign_key: :job_id
end
2018-03-20 22:21:17 +00:00
has_one :metadata, class_name: 'Ci::BuildMetadata'
2018-07-05 13:55:10 +00:00
has_one :runner_session, class_name: 'Ci::BuildRunnerSession', validate: true, inverse_of: :build
accepts_nested_attributes_for :runner_session
2018-03-26 17:26:52 +00:00
delegate :timeout, to: :metadata, prefix: true, allow_nil: true
2018-07-05 13:55:10 +00:00
delegate :url, to: :runner_session, prefix: true, allow_nil: true
delegate :terminal_specification, to: :runner_session, allow_nil: true
delegate :gitlab_deploy_token, to: :project
2018-03-26 17:26:52 +00:00
##
# The "environment" field for builds is a String, and is the unexpanded name!
#
def persisted_environment
return unless has_environment?
strong_memoize(:persisted_environment) do
Environment.find_by(name: expanded_environment_name, project: project)
end
end
serialize :options # rubocop:disable Cop/ActiveRecordSerialize
serialize :yaml_variables, Gitlab::Serializer::Ci::Variables # rubocop:disable Cop/ActiveRecordSerialize
2015-08-26 01:42:46 +00:00
2017-02-22 22:35:08 +00:00
delegate :name, to: :project, prefix: true
2015-08-26 01:42:46 +00:00
validates :coverage, numericality: true, allow_blank: true
2017-02-22 00:40:04 +00:00
validates :ref, presence: true
2015-08-26 01:42:46 +00:00
scope :unstarted, ->() { where(runner_id: nil) }
2015-10-02 11:46:38 +00:00
scope :ignore_failures, ->() { where(allow_failure: false) }
scope :with_artifacts_archive, ->() do
where('(artifacts_file IS NOT NULL AND artifacts_file <> ?) OR EXISTS (?)',
'', Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.job_id').archive)
end
scope :without_archived_trace, ->() do
where('NOT EXISTS (?)', Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.job_id').trace)
end
scope :with_artifacts_stored_locally, -> { with_artifacts_archive.where(artifacts_file_store: [nil, LegacyArtifactUploader::Store::LOCAL]) }
scope :with_artifacts_not_expired, ->() { with_artifacts_archive.where('artifacts_expire_at IS NULL OR artifacts_expire_at > ?', Time.now) }
scope :with_expired_artifacts, ->() { with_artifacts_archive.where('artifacts_expire_at < ?', Time.now) }
2016-07-07 10:56:02 +00:00
scope :last_month, ->() { where('created_at > ?', Date.today - 1.month) }
scope :manual_actions, ->() { where(when: :manual, status: COMPLETED_STATUSES + [:manual]) }
scope :ref_protected, -> { where(protected: true) }
scope :with_live_trace, -> { where('EXISTS (?)', Ci::BuildTraceChunk.where('ci_builds.id = ci_build_trace_chunks.build_id').select(1)) }
scope :matches_tag_ids, -> (tag_ids) do
matcher = ::ActsAsTaggableOn::Tagging
.where(taggable_type: CommitStatus)
.where(context: 'tags')
.where('taggable_id = ci_builds.id')
.where.not(tag_id: tag_ids).select('1')
where("NOT EXISTS (?)", matcher)
end
scope :with_any_tags, -> do
matcher = ::ActsAsTaggableOn::Tagging
.where(taggable_type: CommitStatus)
.where(context: 'tags')
.where('taggable_id = ci_builds.id').select('1')
where("EXISTS (?)", matcher)
end
mount_uploader :legacy_artifacts_file, LegacyArtifactUploader, mount_on: :artifacts_file
mount_uploader :legacy_artifacts_metadata, LegacyArtifactUploader, mount_on: :artifacts_metadata
2015-08-26 01:42:46 +00:00
acts_as_taggable
add_authentication_token_field :token
before_save :update_artifacts_size, if: :artifacts_file_changed?
before_save :ensure_token
before_destroy { unscoped_project }
before_create :ensure_metadata
after_create unless: :importing? do |build|
run_after_commit { BuildHooksWorker.perform_async(build.id) }
end
after_save :update_project_statistics_after_save, if: :artifacts_size_changed?
after_destroy :update_project_statistics_after_destroy, unless: :project_destroyed?
2015-08-26 01:42:46 +00:00
class << self
# This is needed for url_for to work,
# as the controller is JobsController
def model_name
ActiveModel::Name.new(self, nil, 'job')
end
2015-08-26 01:42:46 +00:00
def first_pending
pending.unstarted.order('created_at ASC').first
end
def retry(build, current_user)
Ci::RetryBuildService
.new(build.project, current_user)
.execute(build)
2015-08-26 01:42:46 +00:00
end
end
state_machine :status do
event :actionize do
transition created: :manual
2017-02-28 15:48:39 +00:00
end
after_transition any => [:pending] do |build|
build.run_after_commit do
2016-12-15 21:29:47 +00:00
BuildQueueWorker.perform_async(id)
end
end
after_transition pending: :running do |build|
build.run_after_commit do
BuildHooksWorker.perform_async(id)
end
end
after_transition any => [:success, :failed, :canceled] do |build|
build.run_after_commit do
BuildFinishedWorker.perform_async(id)
end
2015-08-26 01:42:46 +00:00
end
2016-06-10 21:36:54 +00:00
after_transition any => [:success] do |build|
build.run_after_commit do
BuildSuccessWorker.perform_async(id)
PagesWorker.perform_async(:deploy, id) if build.pages_generator?
2016-06-10 21:36:54 +00:00
end
end
before_transition any => [:failed] do |build|
next unless build.project
next if build.retries_max.zero?
if build.retries_count < build.retries_max
begin
Ci::Build.retry(build, build.user)
rescue Gitlab::Access::AccessDeniedError => ex
Rails.logger.error "Unable to auto-retry job #{build.id}: #{ex}"
end
end
end
2017-09-03 14:35:37 +00:00
after_transition pending: :running do |build|
build.ensure_metadata.update_timeout_state
2018-02-28 20:36:01 +00:00
end
2018-07-05 13:55:10 +00:00
after_transition running: any do |build|
Ci::BuildRunnerSession.where(build: build).delete_all
end
2015-08-26 01:42:46 +00:00
end
2018-03-20 22:21:17 +00:00
def ensure_metadata
2018-03-22 16:52:28 +00:00
metadata || build_metadata(project: project)
2015-08-26 01:42:46 +00:00
end
def detailed_status(current_user)
Gitlab::Ci::Status::Build::Factory
.new(self, current_user)
.fabricate!
2016-12-08 08:51:36 +00:00
end
def other_actions
pipeline.manual_actions.where.not(name: name)
end
def pages_generator?
Gitlab.config.pages.enabled &&
self.name == 'pages'
end
2016-07-16 16:39:58 +00:00
def playable?
action? && (manual? || retryable?)
2017-02-28 15:48:39 +00:00
end
def action?
self.when == 'manual'
end
def play(current_user)
Ci::PlayBuildService
.new(project, current_user)
.execute(self)
2016-07-16 16:39:58 +00:00
end
2016-12-08 09:40:56 +00:00
def cancelable?
active?
end
def retryable?
2017-04-06 12:31:38 +00:00
success? || failed? || canceled?
end
def retries_count
pipeline.builds.retried.where(name: self.name).count
end
def retries_max
self.options.fetch(:retry, 0).to_i
end
def latest?
!retried?
2016-03-31 17:51:28 +00:00
end
def expanded_environment_name
return unless has_environment?
strong_memoize(:expanded_environment_name) do
ExpandVariables.expand(environment, simple_variables)
end
end
2016-11-17 11:08:28 +00:00
def has_environment?
environment.present?
2016-11-17 11:08:28 +00:00
end
def starts_environment?
2016-11-17 11:08:28 +00:00
has_environment? && self.environment_action == 'start'
end
def stops_environment?
2016-11-17 11:08:28 +00:00
has_environment? && self.environment_action == 'stop'
end
def environment_action
self.options.fetch(:environment, {}).fetch(:action, 'start') if self.options
end
def outdated_deployment?
success? && !last_deployment.try(:last?)
end
def depends_on_builds
# Get builds of the same type
latest_builds = self.pipeline.builds.latest
# Return builds from previous stages
latest_builds.where('stage_idx < ?', stage_idx)
end
def triggered_by?(current_user)
2017-11-06 13:20:44 +00:00
user == current_user
end
2016-12-13 19:21:30 +00:00
# A slugified version of the build ref, suitable for inclusion in URLs and
# domain names. Rules:
#
# * Lowercased
# * Anything not matching [a-z0-9-] is replaced with a -
# * Maximum length is 63 bytes
2017-07-05 12:00:22 +00:00
# * First/Last Character is not a hyphen
2016-12-13 19:21:30 +00:00
def ref_slug
2017-08-07 18:00:11 +00:00
Gitlab::Utils.slugify(ref.to_s)
2016-12-13 19:21:30 +00:00
end
##
# Variables in the environment name scope.
#
def scoped_variables(environment: expanded_environment_name)
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.concat(predefined_variables)
variables.concat(project.predefined_variables)
variables.concat(pipeline.predefined_variables)
variables.concat(runner.predefined_variables) if runner
variables.concat(project.deployment_variables(environment: environment)) if environment
variables.concat(yaml_variables)
variables.concat(user_variables)
variables.concat(secret_group_variables)
variables.concat(secret_project_variables(environment: environment))
variables.concat(trigger_request.user_variables) if trigger_request
variables.concat(pipeline.variables)
variables.concat(pipeline.pipeline_schedule.job_variables) if pipeline.pipeline_schedule
end
end
##
# Variables that do not depend on the environment name.
#
def simple_variables
strong_memoize(:simple_variables) do
scoped_variables(environment: nil).to_runner_variables
end
end
##
# All variables, including persisted environment variables.
#
def variables
Gitlab::Ci::Variables::Collection.new
.concat(persisted_variables)
.concat(scoped_variables)
.concat(persisted_environment_variables)
.to_runner_variables
end
##
# Regular Ruby hash of scoped variables, without duplicates that are
# possible to be present in an array of hashes returned from `variables`.
#
def scoped_variables_hash
scoped_variables.to_hash
end
def features
{ trace_sections: true }
end
2018-07-17 10:58:57 +00:00
def runner_required_features
%w(variables)
end
def merge_request
return @merge_request if defined?(@merge_request)
2017-05-29 07:58:20 +00:00
@merge_request ||=
begin
Use latest_merge_request_diff association Compared to the merge_request_diff association: 1. It's simpler to query. The query uses a foreign key to the merge_request_diffs table, so no ordering is necessary. 2. It's faster for preloading. The merge_request_diff association has to load every diff for the MRs in the set, then discard all but the most recent for each. This association means that Rails can just query for N diffs from N MRs. 3. It's more complicated to update. This is a bidirectional foreign key, so we need to update two tables when adding a diff record. This also means we need to handle this as a special case when importing a GitLab project. There is some juggling with this association in the merge request model: * `MergeRequest#latest_merge_request_diff` is _always_ the latest diff. * `MergeRequest#merge_request_diff` reuses `MergeRequest#latest_merge_request_diff` unless: * Arguments are passed. These are typically to force-reload the association. * It doesn't exist. That means we might be trying to implicitly create a diff. This only seems to happen in specs. * The association is already loaded. This is important for the reasons explained in the comment, which I'll reiterate here: if we a) load a non-latest diff, then b) get its `merge_request`, then c) get that MR's `merge_request_diff`, we should get the diff we loaded in c), even though that's not the latest diff. Basically, `MergeRequest#merge_request_diff` is the latest diff in most cases, but not quite all.
2017-11-15 17:22:18 +00:00
merge_requests = MergeRequest.includes(:latest_merge_request_diff)
.where(source_branch: ref,
source_project: pipeline.project)
2017-05-29 07:58:20 +00:00
.reorder(iid: :desc)
merge_requests.find do |merge_request|
merge_request.commit_shas.include?(pipeline.sha)
end
end
end
2015-08-26 01:42:46 +00:00
def repo_url
2016-09-16 10:46:33 +00:00
auth = "gitlab-ci-token:#{ensure_token!}@"
2018-01-27 05:35:53 +00:00
project.http_url_to_repo.sub(%r{^https?://}) do |prefix|
2015-12-04 11:55:23 +00:00
prefix + auth
end
2015-08-26 01:42:46 +00:00
end
def allow_git_fetch
2015-12-04 11:55:23 +00:00
project.build_allow_git_fetch
2015-08-26 01:42:46 +00:00
end
def update_coverage
coverage = trace.extract_coverage(coverage_regex)
2018-07-02 10:43:06 +00:00
update(coverage: coverage) if coverage.present?
2015-08-26 01:42:46 +00:00
end
2017-09-25 16:54:08 +00:00
def parse_trace_sections!
ExtractSectionsFromBuildTraceService.new(project, user).execute(self)
2017-09-25 16:54:08 +00:00
end
def trace
Gitlab::Ci::Trace.new(self)
end
def has_trace?
trace.exist?
2016-08-25 11:53:20 +00:00
end
Squashed commit of the following: commit c35ca6594eb1d29cac46362d09036f3d128143ed Merge: 87da74fb98a 13ea4b387dd Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 27 13:25:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 87da74fb98aef1f664553ca2b8406ca154e4c19f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:27:45 2018 +0900 Remove unncessary GENERAL_ARCHIVE_FILE_TYPE commit 5a3cfc1fdc8e81dd5647e275f87c0da2d93235b4 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:19:44 2018 +0900 Expand entities in JobRequest::Artifacts commit 660f885ebb25a19182e601181050683d2b6134f6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:06:14 2018 +0900 Add tests commit 60bca3dcfd055647a9f43523b79d5eebdc4bdc5a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:30:52 2018 +0900 Simplify build runner presenter commit 81d1951d5562bec4086d719748360f3f24df4168 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:18:53 2018 +0900 Simplify `scope :test_reports` in job_artifacts commit 15d1d76ca1cb97501c82471eb1c927290071dcfb Merge: f3327b2912d ffbfd18ce2f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:53 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit f3327b2912d0b169e7a059dca7b4d15e77567075 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:44 2018 +0900 Fix "or string" to "or a string". Use be_valid commit 9aaae6d60f7537f55f862f4d61de7a0d3a3b6bc2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:25:57 2018 +0900 Fix spec file name - build_runner_presenter_spec.rb commit 41c64c190e2e2efa7ab91a0daa0598da2d755f05 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:18:12 2018 +0900 Rename to Ci::BuildRunnerPresenter commit e9762299eb66c8f88734f80d05d38b9616a8fde8 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:14:44 2018 +0900 Split methods into three in Ci::Builds::RunnerPresenter commit 6e73070313a782eb63d4fbcbe324d9acaf67334b Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:23:53 2018 +0900 Remove redandant as: :artifacts commit 063f647e4829d9c71a71d227f9946bb47b93691f Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:04:58 2018 +0900 Fix specs commit a45975afd9b9391390c1adafbeab72c970e97b64 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:18:53 2018 +0900 Created a separate presenter commit 431ad666e080124c90e13cbaf0d4f0969aa7b2f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:10:04 2018 +0900 Simplified config presenter commit 2e106569ea258f5f7556a8b454a6dd0e9cbe6902 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:25:05 2018 +0900 Skip file_format setting if the file_type is trace commit 0572bd8357a2e9ea16118a0bd85264e3fb799322 Merge: 30ae33daa1d 6cb30f83255 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:55 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 30ae33daa1d4afcb57e6335fba62a3c5fc98468a Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:23 2018 +0900 Fix spec commit ccb6eb75187030ff0fd3c6e69f89eeca79d2a929 Merge: 1ebaaaf2094 34c57e09b9f Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jul 24 14:27:48 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 1ebaaaf2094c47c03e16745d2f8af736ec102b76 Merge: bfdf565800b dc7b4b7bb97 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 23 14:22:29 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit bfdf565800b58e838a760aa01d2fadb64e2d768f Merge: 681bd6a878a 44dbeccbe10 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 19:10:47 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 681bd6a878ad2a77c278f5619b51c542d7382aa2 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:19:46 2018 +0900 Specify DOWNTIME=false commit 59c4e31390e0d616d69babf8ac857e98f2dc774e Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:14:44 2018 +0900 Wrap long lines commit 3d85788edbe73fc74c72854508e47fe259d99236 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:05:31 2018 +0900 Checking filr_format and file_type paring commit 3c92a22faf6278e7a2d1ee13bd978bc659b72452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:07:21 2018 +0900 Fix build presenter spec commit 36e69897b0524cdee6060c928c03af734afae664 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:02:09 2018 +0900 Erase test reports at the proper timing commit 402ae97ecf7f9e3fe541f2d6abef6e47ab740452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:46:56 2018 +0900 Make GENERAL_ARCHIVE_FILE_TYPE as a single entry commit 75f75b3f5988398fff0660ca5f04aec756ab03bb Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:42:16 2018 +0900 Implement config artifact presenter commit 9ecaee914defba5f12a7a06375ea2876b4328d7f Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 14:27:54 2018 +0900 Introduce ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION check commit 34ea9610ab9a249a576ee435f365b9e1fcca7f00 Merge: d88523ca884 b60364c0f37 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 13:46:52 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit d88523ca88420354f61bd36f533c62a6ca474423 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 21:00:40 2018 +0900 Revert unnecessary change commit d9beb10ede5e4e8abe388fadbd6412640293917a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:57:03 2018 +0900 Remove scattering around erase_test_reports! commit c79f361ca01f8dbc0d395edee5fab7f5a0697934 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:53:00 2018 +0900 Rever archive_metadata refactoring (For simplifying) commit 55bc71a404d8cf5fa87e187f6e88da92ab95afa9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:45:19 2018 +0900 Use array_of_strings_or_string in Command commit 8a576b18c8ab8ead2344e2885aaf2fde11af0328 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:40:06 2018 +0900 Fix spec commit a2cda62fb922184aaf0e78699e06846c96565e0d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:27:11 2018 +0900 Fix presenter spec commit 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:23:41 2018 +0900 Fix artifact migratable commit a3930853c93862007ba6814511bc32042c7f4986 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:15:41 2018 +0900 Increment migration version to use `file_format` when archiving traces commit e31121cb5e617b0f05e375c2150ece0e38e5e0d6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 17:57:15 2018 +0900 Impolement job_artifact.test_reports method commit e54707fdf97392839cb2c4711160bd3bc89da196 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:49:27 2018 +0900 Fix erase method commit 20e95824341af1ebc5877d28dc5eba26f73eddf9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:28:00 2018 +0900 Fix spec commit 7ade498101d02573b20a2405ebe0bdb8efd8aa3b Merge: e7be6b2b362 98eccfc44c5 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 12:37:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit e7be6b2b3624ba44d56143084731cb9a6168f974 Merge: 5a8d4930e01 9bdc9b1ae69 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:36 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 5a8d4930e0127aae311bfa3da70d9ab9637791e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:28 2018 +0900 Evaluate artifact_format commit c3ce06aa9bc6481b37a16d175adf0fd1c37a1bc0 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 22:27:46 2018 +0900 Fix sending junit.xml commit e5ce3668ee65217aba610d5311efd5e82bacddf3 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 19:02:06 2018 +0900 Add spec for Gitlab::Ci::Config::Entry::Artifacts commit ede107caf13fb215045576dcce18e20eec776df1 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:58:28 2018 +0900 Revert refactoring commit 15531ba9feff669b2ac05936e0feaee1856c1571 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:57:31 2018 +0900 Revert refactoring commit 14821f3babcc210bc52e4e825adc8333752fbc88 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:55:41 2018 +0900 Add spec for file format. Add spec for config_artifacts commit 882faeab57ab39d18f72abd9b65d286db92e1011 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:20:28 2018 +0900 Add file_format to factory commit 3cd0513e254db15141cd748f6209179f462974f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:12:52 2018 +0900 Rename migration file properly commit f511933b5f618fc47d1512554878913922dfba61 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:09:57 2018 +0900 Revert artifacts_archive_file refactoring commit e295e8cbdee065ee3af6dd82f512729554237cad Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 16:03:26 2018 +0900 Dry up the converion in Entry::Reports commit b0ffa42f6410be4718e7a36cb21f7b585421750e Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:50:42 2018 +0900 Set file_format at callers commit f3dc7a2e02901c79a9e572514a1b731c680e43cc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:47:51 2018 +0900 Use presenter for presenting artifacts hash to runner commit e5299526138be90d65cf13368134e734b46f7597 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:59:09 2018 +0900 Support deleting junit artifact. Make wording explicit commit cc81c34acf23323257d190c23030d0a89265bccc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:35:12 2018 +0900 Add changelog commit abde0f2ab5c5c1d99b2f94a049984877bb5a4d77 Merge: 4c87e5b388f fabf6a5634f Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 13:22:22 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 4c87e5b388fb098fb6da71e17a47fa204033e4ac Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 17:33:07 2018 +0900 Fix static analysis commit bc96346be6990b75da9a36055814b24b5b805707 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 16:43:02 2018 +0900 Fix Config::Entry::Artifacts commit aac284613b9db43e3021198dc5b43b81806f1bce Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 14:40:20 2018 +0900 Generalized by DEFAULT_FILE_FORMAT commit a79299fdbb0ed74000ca37cff8fef8268cd29b13 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:55:02 2018 +0900 Cleanup API::Entities::JobRequest::Artifacts commit 1650249214768c23f6f46ec62c0c54448017eeb5 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:25:52 2018 +0900 Simplified file_type relations commit 981da91bc4c255ff992870e4e4c4393696f5bece Merge: e79808425eb 924146a8d6b Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:18:20 2018 +0900 Merge branch 'master' into artifact-format-v2 commit e79808425eb63c322a997e71d606d97b85e42048 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 18:16:52 2018 +0900 Remove unnecessary change commit a531bd7487955143489d286a0fb2e5d0984acc52 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 17:40:35 2018 +0900 Fix errors typo commit 57d6f21821c8ad934874c1aac3f627335c64c80d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:32:35 2018 +0900 Use the correct type name commit da4ca63f25a27a1268317952061c81a28516653f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:29:21 2018 +0900 Refactor job_artifacts_metadata to job_artifacts_archive_metadata commit 4098a8f10f92a6efa48080f8925809e251066f9d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:23:55 2018 +0900 Add job_artifacts_junit relation commit 5342f07e100253713dbf50eb303da1977484077f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:14:03 2018 +0900 Fix raw to raw? commit 15e0abcb22d9db3d8ef955e647f0a5d0a49c26b6 Merge: 31252fe8d75 ba38931d90b Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:12:38 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 31252fe8d751319c5390f898f66f0af4a8581013 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 19:05:51 2018 +0900 Temporaly use type Hash for reports commit 583165c0349f40e7be16a8039dbffb4139f94921 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:27:21 2018 +0900 Revert unnecessary change commit eb48369b8311b538f46f59a31f4a6d3f8c9e68e1 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:21:46 2018 +0900 Use file_format raw for trace commit fb69ae8349d58499ad21965c0d1cf95e2b79a8e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:20:10 2018 +0900 Check the presence of the file_format commit c0840224bc8789d35da032c2a0ee48aa9f2232aa Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:16:19 2018 +0900 Add format_restriction validation commit d64fbd388cb2294447df5185366d8b5016591949 Merge: 7ec81e7c7d1 c2a0a3ab1ae Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:11:44 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 7ec81e7c7d115f77d712892dfc79db72b9f5bc7a Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:23:54 2018 +0900 Artifacts presenter (Halfway) commit a3ccbe4c3a9b7d3095fe1929dee5fd9c57e168e0 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:22:52 2018 +0900 Fix schema.rb commit b630c670c707548799c6852e4465ef94fb4a0572 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:26:03 2018 +0900 Allow reports type under artifacts. Allow junit keyword in it. commit e7e37612487b556320d27f4fe0de32cd4ec20720 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:25:10 2018 +0900 Change column name to artifact_format commit f3f25d56a7c627f4bb9d91d19de175273a7a6a81 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 18:02:21 2018 +0900 Rename metadata to archive_metadata, and compress to file_format commit d7e0709319ab8fe35a2598a3d484eb89b1885934 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 17:47:18 2018 +0900 Validate compression. Clean up schema commit beb5990e7e3bfbb308245dc97284aaf9700bd982 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 19:06:54 2018 +0900 Make compression params at the first level commit 1e2e1c0db5412e1aed3bf47562350c20c69dc1a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 16:31:03 2018 +0900 Reorganize components
2018-07-27 05:04:35 +00:00
def has_test_reports?
job_artifacts.test_reports.any?
end
2018-07-03 05:00:25 +00:00
def has_old_trace?
old_trace.present?
end
def trace=(data)
raise NotImplementedError
2016-03-31 11:24:14 +00:00
end
def old_trace
read_attribute(:trace)
2016-03-29 13:34:18 +00:00
end
def erase_old_trace!
return unless has_old_trace?
2018-07-03 05:00:25 +00:00
update_column(:trace, nil)
2015-08-26 01:42:46 +00:00
end
def needs_touch?
Time.now - updated_at > 15.minutes.to_i
end
2016-05-18 22:43:00 +00:00
def valid_token?(token)
self.token && ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
end
def has_tags?
tag_list.any?
end
def any_runners_online?
project.any_runners? { |runner| runner.active? && runner.online? && runner.can_pick?(self) }
end
def stuck?
pending? && !any_runners_online?
end
def execute_hooks
return unless project
build_data = Gitlab::DataBuilder::Build.build(self)
project.execute_hooks(build_data.dup, :job_hooks)
project.execute_services(build_data.dup, :job_hooks)
end
def browsable_artifacts?
artifacts_metadata?
end
def artifacts_metadata_entry(path, **options)
artifacts_metadata.open do |metadata_stream|
metadata = Gitlab::Ci::Build::Artifacts::Metadata.new(
metadata_stream,
path,
**options)
metadata.to_entry
end
end
2016-05-18 20:21:51 +00:00
def erase_artifacts!
remove_artifacts_file!
remove_artifacts_metadata!
save
2016-05-18 20:21:51 +00:00
end
Squashed commit of the following: commit c35ca6594eb1d29cac46362d09036f3d128143ed Merge: 87da74fb98a 13ea4b387dd Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 27 13:25:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 87da74fb98aef1f664553ca2b8406ca154e4c19f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:27:45 2018 +0900 Remove unncessary GENERAL_ARCHIVE_FILE_TYPE commit 5a3cfc1fdc8e81dd5647e275f87c0da2d93235b4 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:19:44 2018 +0900 Expand entities in JobRequest::Artifacts commit 660f885ebb25a19182e601181050683d2b6134f6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:06:14 2018 +0900 Add tests commit 60bca3dcfd055647a9f43523b79d5eebdc4bdc5a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:30:52 2018 +0900 Simplify build runner presenter commit 81d1951d5562bec4086d719748360f3f24df4168 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:18:53 2018 +0900 Simplify `scope :test_reports` in job_artifacts commit 15d1d76ca1cb97501c82471eb1c927290071dcfb Merge: f3327b2912d ffbfd18ce2f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:53 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit f3327b2912d0b169e7a059dca7b4d15e77567075 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:44 2018 +0900 Fix "or string" to "or a string". Use be_valid commit 9aaae6d60f7537f55f862f4d61de7a0d3a3b6bc2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:25:57 2018 +0900 Fix spec file name - build_runner_presenter_spec.rb commit 41c64c190e2e2efa7ab91a0daa0598da2d755f05 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:18:12 2018 +0900 Rename to Ci::BuildRunnerPresenter commit e9762299eb66c8f88734f80d05d38b9616a8fde8 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:14:44 2018 +0900 Split methods into three in Ci::Builds::RunnerPresenter commit 6e73070313a782eb63d4fbcbe324d9acaf67334b Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:23:53 2018 +0900 Remove redandant as: :artifacts commit 063f647e4829d9c71a71d227f9946bb47b93691f Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:04:58 2018 +0900 Fix specs commit a45975afd9b9391390c1adafbeab72c970e97b64 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:18:53 2018 +0900 Created a separate presenter commit 431ad666e080124c90e13cbaf0d4f0969aa7b2f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:10:04 2018 +0900 Simplified config presenter commit 2e106569ea258f5f7556a8b454a6dd0e9cbe6902 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:25:05 2018 +0900 Skip file_format setting if the file_type is trace commit 0572bd8357a2e9ea16118a0bd85264e3fb799322 Merge: 30ae33daa1d 6cb30f83255 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:55 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 30ae33daa1d4afcb57e6335fba62a3c5fc98468a Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:23 2018 +0900 Fix spec commit ccb6eb75187030ff0fd3c6e69f89eeca79d2a929 Merge: 1ebaaaf2094 34c57e09b9f Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jul 24 14:27:48 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 1ebaaaf2094c47c03e16745d2f8af736ec102b76 Merge: bfdf565800b dc7b4b7bb97 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 23 14:22:29 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit bfdf565800b58e838a760aa01d2fadb64e2d768f Merge: 681bd6a878a 44dbeccbe10 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 19:10:47 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 681bd6a878ad2a77c278f5619b51c542d7382aa2 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:19:46 2018 +0900 Specify DOWNTIME=false commit 59c4e31390e0d616d69babf8ac857e98f2dc774e Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:14:44 2018 +0900 Wrap long lines commit 3d85788edbe73fc74c72854508e47fe259d99236 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:05:31 2018 +0900 Checking filr_format and file_type paring commit 3c92a22faf6278e7a2d1ee13bd978bc659b72452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:07:21 2018 +0900 Fix build presenter spec commit 36e69897b0524cdee6060c928c03af734afae664 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:02:09 2018 +0900 Erase test reports at the proper timing commit 402ae97ecf7f9e3fe541f2d6abef6e47ab740452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:46:56 2018 +0900 Make GENERAL_ARCHIVE_FILE_TYPE as a single entry commit 75f75b3f5988398fff0660ca5f04aec756ab03bb Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:42:16 2018 +0900 Implement config artifact presenter commit 9ecaee914defba5f12a7a06375ea2876b4328d7f Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 14:27:54 2018 +0900 Introduce ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION check commit 34ea9610ab9a249a576ee435f365b9e1fcca7f00 Merge: d88523ca884 b60364c0f37 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 13:46:52 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit d88523ca88420354f61bd36f533c62a6ca474423 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 21:00:40 2018 +0900 Revert unnecessary change commit d9beb10ede5e4e8abe388fadbd6412640293917a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:57:03 2018 +0900 Remove scattering around erase_test_reports! commit c79f361ca01f8dbc0d395edee5fab7f5a0697934 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:53:00 2018 +0900 Rever archive_metadata refactoring (For simplifying) commit 55bc71a404d8cf5fa87e187f6e88da92ab95afa9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:45:19 2018 +0900 Use array_of_strings_or_string in Command commit 8a576b18c8ab8ead2344e2885aaf2fde11af0328 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:40:06 2018 +0900 Fix spec commit a2cda62fb922184aaf0e78699e06846c96565e0d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:27:11 2018 +0900 Fix presenter spec commit 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:23:41 2018 +0900 Fix artifact migratable commit a3930853c93862007ba6814511bc32042c7f4986 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:15:41 2018 +0900 Increment migration version to use `file_format` when archiving traces commit e31121cb5e617b0f05e375c2150ece0e38e5e0d6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 17:57:15 2018 +0900 Impolement job_artifact.test_reports method commit e54707fdf97392839cb2c4711160bd3bc89da196 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:49:27 2018 +0900 Fix erase method commit 20e95824341af1ebc5877d28dc5eba26f73eddf9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:28:00 2018 +0900 Fix spec commit 7ade498101d02573b20a2405ebe0bdb8efd8aa3b Merge: e7be6b2b362 98eccfc44c5 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 12:37:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit e7be6b2b3624ba44d56143084731cb9a6168f974 Merge: 5a8d4930e01 9bdc9b1ae69 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:36 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 5a8d4930e0127aae311bfa3da70d9ab9637791e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:28 2018 +0900 Evaluate artifact_format commit c3ce06aa9bc6481b37a16d175adf0fd1c37a1bc0 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 22:27:46 2018 +0900 Fix sending junit.xml commit e5ce3668ee65217aba610d5311efd5e82bacddf3 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 19:02:06 2018 +0900 Add spec for Gitlab::Ci::Config::Entry::Artifacts commit ede107caf13fb215045576dcce18e20eec776df1 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:58:28 2018 +0900 Revert refactoring commit 15531ba9feff669b2ac05936e0feaee1856c1571 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:57:31 2018 +0900 Revert refactoring commit 14821f3babcc210bc52e4e825adc8333752fbc88 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:55:41 2018 +0900 Add spec for file format. Add spec for config_artifacts commit 882faeab57ab39d18f72abd9b65d286db92e1011 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:20:28 2018 +0900 Add file_format to factory commit 3cd0513e254db15141cd748f6209179f462974f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:12:52 2018 +0900 Rename migration file properly commit f511933b5f618fc47d1512554878913922dfba61 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:09:57 2018 +0900 Revert artifacts_archive_file refactoring commit e295e8cbdee065ee3af6dd82f512729554237cad Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 16:03:26 2018 +0900 Dry up the converion in Entry::Reports commit b0ffa42f6410be4718e7a36cb21f7b585421750e Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:50:42 2018 +0900 Set file_format at callers commit f3dc7a2e02901c79a9e572514a1b731c680e43cc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:47:51 2018 +0900 Use presenter for presenting artifacts hash to runner commit e5299526138be90d65cf13368134e734b46f7597 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:59:09 2018 +0900 Support deleting junit artifact. Make wording explicit commit cc81c34acf23323257d190c23030d0a89265bccc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:35:12 2018 +0900 Add changelog commit abde0f2ab5c5c1d99b2f94a049984877bb5a4d77 Merge: 4c87e5b388f fabf6a5634f Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 13:22:22 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 4c87e5b388fb098fb6da71e17a47fa204033e4ac Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 17:33:07 2018 +0900 Fix static analysis commit bc96346be6990b75da9a36055814b24b5b805707 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 16:43:02 2018 +0900 Fix Config::Entry::Artifacts commit aac284613b9db43e3021198dc5b43b81806f1bce Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 14:40:20 2018 +0900 Generalized by DEFAULT_FILE_FORMAT commit a79299fdbb0ed74000ca37cff8fef8268cd29b13 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:55:02 2018 +0900 Cleanup API::Entities::JobRequest::Artifacts commit 1650249214768c23f6f46ec62c0c54448017eeb5 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:25:52 2018 +0900 Simplified file_type relations commit 981da91bc4c255ff992870e4e4c4393696f5bece Merge: e79808425eb 924146a8d6b Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:18:20 2018 +0900 Merge branch 'master' into artifact-format-v2 commit e79808425eb63c322a997e71d606d97b85e42048 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 18:16:52 2018 +0900 Remove unnecessary change commit a531bd7487955143489d286a0fb2e5d0984acc52 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 17:40:35 2018 +0900 Fix errors typo commit 57d6f21821c8ad934874c1aac3f627335c64c80d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:32:35 2018 +0900 Use the correct type name commit da4ca63f25a27a1268317952061c81a28516653f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:29:21 2018 +0900 Refactor job_artifacts_metadata to job_artifacts_archive_metadata commit 4098a8f10f92a6efa48080f8925809e251066f9d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:23:55 2018 +0900 Add job_artifacts_junit relation commit 5342f07e100253713dbf50eb303da1977484077f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:14:03 2018 +0900 Fix raw to raw? commit 15e0abcb22d9db3d8ef955e647f0a5d0a49c26b6 Merge: 31252fe8d75 ba38931d90b Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:12:38 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 31252fe8d751319c5390f898f66f0af4a8581013 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 19:05:51 2018 +0900 Temporaly use type Hash for reports commit 583165c0349f40e7be16a8039dbffb4139f94921 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:27:21 2018 +0900 Revert unnecessary change commit eb48369b8311b538f46f59a31f4a6d3f8c9e68e1 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:21:46 2018 +0900 Use file_format raw for trace commit fb69ae8349d58499ad21965c0d1cf95e2b79a8e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:20:10 2018 +0900 Check the presence of the file_format commit c0840224bc8789d35da032c2a0ee48aa9f2232aa Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:16:19 2018 +0900 Add format_restriction validation commit d64fbd388cb2294447df5185366d8b5016591949 Merge: 7ec81e7c7d1 c2a0a3ab1ae Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:11:44 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 7ec81e7c7d115f77d712892dfc79db72b9f5bc7a Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:23:54 2018 +0900 Artifacts presenter (Halfway) commit a3ccbe4c3a9b7d3095fe1929dee5fd9c57e168e0 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:22:52 2018 +0900 Fix schema.rb commit b630c670c707548799c6852e4465ef94fb4a0572 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:26:03 2018 +0900 Allow reports type under artifacts. Allow junit keyword in it. commit e7e37612487b556320d27f4fe0de32cd4ec20720 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:25:10 2018 +0900 Change column name to artifact_format commit f3f25d56a7c627f4bb9d91d19de175273a7a6a81 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 18:02:21 2018 +0900 Rename metadata to archive_metadata, and compress to file_format commit d7e0709319ab8fe35a2598a3d484eb89b1885934 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 17:47:18 2018 +0900 Validate compression. Clean up schema commit beb5990e7e3bfbb308245dc97284aaf9700bd982 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 19:06:54 2018 +0900 Make compression params at the first level commit 1e2e1c0db5412e1aed3bf47562350c20c69dc1a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 16:31:03 2018 +0900 Reorganize components
2018-07-27 05:04:35 +00:00
def erase_test_reports!
2018-07-27 05:32:24 +00:00
# TODO: Use fast_destroy_all in the context of https://gitlab.com/gitlab-org/gitlab-ce/issues/35240
job_artifacts_junit&.destroy
Squashed commit of the following: commit c35ca6594eb1d29cac46362d09036f3d128143ed Merge: 87da74fb98a 13ea4b387dd Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 27 13:25:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 87da74fb98aef1f664553ca2b8406ca154e4c19f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:27:45 2018 +0900 Remove unncessary GENERAL_ARCHIVE_FILE_TYPE commit 5a3cfc1fdc8e81dd5647e275f87c0da2d93235b4 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:19:44 2018 +0900 Expand entities in JobRequest::Artifacts commit 660f885ebb25a19182e601181050683d2b6134f6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:06:14 2018 +0900 Add tests commit 60bca3dcfd055647a9f43523b79d5eebdc4bdc5a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:30:52 2018 +0900 Simplify build runner presenter commit 81d1951d5562bec4086d719748360f3f24df4168 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:18:53 2018 +0900 Simplify `scope :test_reports` in job_artifacts commit 15d1d76ca1cb97501c82471eb1c927290071dcfb Merge: f3327b2912d ffbfd18ce2f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:53 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit f3327b2912d0b169e7a059dca7b4d15e77567075 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:44 2018 +0900 Fix "or string" to "or a string". Use be_valid commit 9aaae6d60f7537f55f862f4d61de7a0d3a3b6bc2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:25:57 2018 +0900 Fix spec file name - build_runner_presenter_spec.rb commit 41c64c190e2e2efa7ab91a0daa0598da2d755f05 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:18:12 2018 +0900 Rename to Ci::BuildRunnerPresenter commit e9762299eb66c8f88734f80d05d38b9616a8fde8 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:14:44 2018 +0900 Split methods into three in Ci::Builds::RunnerPresenter commit 6e73070313a782eb63d4fbcbe324d9acaf67334b Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:23:53 2018 +0900 Remove redandant as: :artifacts commit 063f647e4829d9c71a71d227f9946bb47b93691f Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:04:58 2018 +0900 Fix specs commit a45975afd9b9391390c1adafbeab72c970e97b64 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:18:53 2018 +0900 Created a separate presenter commit 431ad666e080124c90e13cbaf0d4f0969aa7b2f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:10:04 2018 +0900 Simplified config presenter commit 2e106569ea258f5f7556a8b454a6dd0e9cbe6902 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:25:05 2018 +0900 Skip file_format setting if the file_type is trace commit 0572bd8357a2e9ea16118a0bd85264e3fb799322 Merge: 30ae33daa1d 6cb30f83255 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:55 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 30ae33daa1d4afcb57e6335fba62a3c5fc98468a Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:23 2018 +0900 Fix spec commit ccb6eb75187030ff0fd3c6e69f89eeca79d2a929 Merge: 1ebaaaf2094 34c57e09b9f Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jul 24 14:27:48 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 1ebaaaf2094c47c03e16745d2f8af736ec102b76 Merge: bfdf565800b dc7b4b7bb97 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 23 14:22:29 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit bfdf565800b58e838a760aa01d2fadb64e2d768f Merge: 681bd6a878a 44dbeccbe10 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 19:10:47 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 681bd6a878ad2a77c278f5619b51c542d7382aa2 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:19:46 2018 +0900 Specify DOWNTIME=false commit 59c4e31390e0d616d69babf8ac857e98f2dc774e Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:14:44 2018 +0900 Wrap long lines commit 3d85788edbe73fc74c72854508e47fe259d99236 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:05:31 2018 +0900 Checking filr_format and file_type paring commit 3c92a22faf6278e7a2d1ee13bd978bc659b72452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:07:21 2018 +0900 Fix build presenter spec commit 36e69897b0524cdee6060c928c03af734afae664 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:02:09 2018 +0900 Erase test reports at the proper timing commit 402ae97ecf7f9e3fe541f2d6abef6e47ab740452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:46:56 2018 +0900 Make GENERAL_ARCHIVE_FILE_TYPE as a single entry commit 75f75b3f5988398fff0660ca5f04aec756ab03bb Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:42:16 2018 +0900 Implement config artifact presenter commit 9ecaee914defba5f12a7a06375ea2876b4328d7f Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 14:27:54 2018 +0900 Introduce ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION check commit 34ea9610ab9a249a576ee435f365b9e1fcca7f00 Merge: d88523ca884 b60364c0f37 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 13:46:52 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit d88523ca88420354f61bd36f533c62a6ca474423 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 21:00:40 2018 +0900 Revert unnecessary change commit d9beb10ede5e4e8abe388fadbd6412640293917a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:57:03 2018 +0900 Remove scattering around erase_test_reports! commit c79f361ca01f8dbc0d395edee5fab7f5a0697934 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:53:00 2018 +0900 Rever archive_metadata refactoring (For simplifying) commit 55bc71a404d8cf5fa87e187f6e88da92ab95afa9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:45:19 2018 +0900 Use array_of_strings_or_string in Command commit 8a576b18c8ab8ead2344e2885aaf2fde11af0328 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:40:06 2018 +0900 Fix spec commit a2cda62fb922184aaf0e78699e06846c96565e0d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:27:11 2018 +0900 Fix presenter spec commit 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:23:41 2018 +0900 Fix artifact migratable commit a3930853c93862007ba6814511bc32042c7f4986 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:15:41 2018 +0900 Increment migration version to use `file_format` when archiving traces commit e31121cb5e617b0f05e375c2150ece0e38e5e0d6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 17:57:15 2018 +0900 Impolement job_artifact.test_reports method commit e54707fdf97392839cb2c4711160bd3bc89da196 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:49:27 2018 +0900 Fix erase method commit 20e95824341af1ebc5877d28dc5eba26f73eddf9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:28:00 2018 +0900 Fix spec commit 7ade498101d02573b20a2405ebe0bdb8efd8aa3b Merge: e7be6b2b362 98eccfc44c5 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 12:37:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit e7be6b2b3624ba44d56143084731cb9a6168f974 Merge: 5a8d4930e01 9bdc9b1ae69 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:36 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 5a8d4930e0127aae311bfa3da70d9ab9637791e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:28 2018 +0900 Evaluate artifact_format commit c3ce06aa9bc6481b37a16d175adf0fd1c37a1bc0 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 22:27:46 2018 +0900 Fix sending junit.xml commit e5ce3668ee65217aba610d5311efd5e82bacddf3 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 19:02:06 2018 +0900 Add spec for Gitlab::Ci::Config::Entry::Artifacts commit ede107caf13fb215045576dcce18e20eec776df1 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:58:28 2018 +0900 Revert refactoring commit 15531ba9feff669b2ac05936e0feaee1856c1571 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:57:31 2018 +0900 Revert refactoring commit 14821f3babcc210bc52e4e825adc8333752fbc88 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:55:41 2018 +0900 Add spec for file format. Add spec for config_artifacts commit 882faeab57ab39d18f72abd9b65d286db92e1011 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:20:28 2018 +0900 Add file_format to factory commit 3cd0513e254db15141cd748f6209179f462974f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:12:52 2018 +0900 Rename migration file properly commit f511933b5f618fc47d1512554878913922dfba61 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:09:57 2018 +0900 Revert artifacts_archive_file refactoring commit e295e8cbdee065ee3af6dd82f512729554237cad Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 16:03:26 2018 +0900 Dry up the converion in Entry::Reports commit b0ffa42f6410be4718e7a36cb21f7b585421750e Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:50:42 2018 +0900 Set file_format at callers commit f3dc7a2e02901c79a9e572514a1b731c680e43cc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:47:51 2018 +0900 Use presenter for presenting artifacts hash to runner commit e5299526138be90d65cf13368134e734b46f7597 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:59:09 2018 +0900 Support deleting junit artifact. Make wording explicit commit cc81c34acf23323257d190c23030d0a89265bccc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:35:12 2018 +0900 Add changelog commit abde0f2ab5c5c1d99b2f94a049984877bb5a4d77 Merge: 4c87e5b388f fabf6a5634f Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 13:22:22 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 4c87e5b388fb098fb6da71e17a47fa204033e4ac Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 17:33:07 2018 +0900 Fix static analysis commit bc96346be6990b75da9a36055814b24b5b805707 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 16:43:02 2018 +0900 Fix Config::Entry::Artifacts commit aac284613b9db43e3021198dc5b43b81806f1bce Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 14:40:20 2018 +0900 Generalized by DEFAULT_FILE_FORMAT commit a79299fdbb0ed74000ca37cff8fef8268cd29b13 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:55:02 2018 +0900 Cleanup API::Entities::JobRequest::Artifacts commit 1650249214768c23f6f46ec62c0c54448017eeb5 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:25:52 2018 +0900 Simplified file_type relations commit 981da91bc4c255ff992870e4e4c4393696f5bece Merge: e79808425eb 924146a8d6b Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:18:20 2018 +0900 Merge branch 'master' into artifact-format-v2 commit e79808425eb63c322a997e71d606d97b85e42048 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 18:16:52 2018 +0900 Remove unnecessary change commit a531bd7487955143489d286a0fb2e5d0984acc52 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 17:40:35 2018 +0900 Fix errors typo commit 57d6f21821c8ad934874c1aac3f627335c64c80d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:32:35 2018 +0900 Use the correct type name commit da4ca63f25a27a1268317952061c81a28516653f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:29:21 2018 +0900 Refactor job_artifacts_metadata to job_artifacts_archive_metadata commit 4098a8f10f92a6efa48080f8925809e251066f9d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:23:55 2018 +0900 Add job_artifacts_junit relation commit 5342f07e100253713dbf50eb303da1977484077f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:14:03 2018 +0900 Fix raw to raw? commit 15e0abcb22d9db3d8ef955e647f0a5d0a49c26b6 Merge: 31252fe8d75 ba38931d90b Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:12:38 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 31252fe8d751319c5390f898f66f0af4a8581013 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 19:05:51 2018 +0900 Temporaly use type Hash for reports commit 583165c0349f40e7be16a8039dbffb4139f94921 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:27:21 2018 +0900 Revert unnecessary change commit eb48369b8311b538f46f59a31f4a6d3f8c9e68e1 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:21:46 2018 +0900 Use file_format raw for trace commit fb69ae8349d58499ad21965c0d1cf95e2b79a8e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:20:10 2018 +0900 Check the presence of the file_format commit c0840224bc8789d35da032c2a0ee48aa9f2232aa Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:16:19 2018 +0900 Add format_restriction validation commit d64fbd388cb2294447df5185366d8b5016591949 Merge: 7ec81e7c7d1 c2a0a3ab1ae Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:11:44 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 7ec81e7c7d115f77d712892dfc79db72b9f5bc7a Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:23:54 2018 +0900 Artifacts presenter (Halfway) commit a3ccbe4c3a9b7d3095fe1929dee5fd9c57e168e0 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:22:52 2018 +0900 Fix schema.rb commit b630c670c707548799c6852e4465ef94fb4a0572 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:26:03 2018 +0900 Allow reports type under artifacts. Allow junit keyword in it. commit e7e37612487b556320d27f4fe0de32cd4ec20720 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:25:10 2018 +0900 Change column name to artifact_format commit f3f25d56a7c627f4bb9d91d19de175273a7a6a81 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 18:02:21 2018 +0900 Rename metadata to archive_metadata, and compress to file_format commit d7e0709319ab8fe35a2598a3d484eb89b1885934 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 17:47:18 2018 +0900 Validate compression. Clean up schema commit beb5990e7e3bfbb308245dc97284aaf9700bd982 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 19:06:54 2018 +0900 Make compression params at the first level commit 1e2e1c0db5412e1aed3bf47562350c20c69dc1a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 16:31:03 2018 +0900 Reorganize components
2018-07-27 05:04:35 +00:00
end
def erase(opts = {})
return false unless erasable?
2016-05-18 20:21:51 +00:00
erase_artifacts!
Squashed commit of the following: commit c35ca6594eb1d29cac46362d09036f3d128143ed Merge: 87da74fb98a 13ea4b387dd Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 27 13:25:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 87da74fb98aef1f664553ca2b8406ca154e4c19f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:27:45 2018 +0900 Remove unncessary GENERAL_ARCHIVE_FILE_TYPE commit 5a3cfc1fdc8e81dd5647e275f87c0da2d93235b4 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:19:44 2018 +0900 Expand entities in JobRequest::Artifacts commit 660f885ebb25a19182e601181050683d2b6134f6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:06:14 2018 +0900 Add tests commit 60bca3dcfd055647a9f43523b79d5eebdc4bdc5a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:30:52 2018 +0900 Simplify build runner presenter commit 81d1951d5562bec4086d719748360f3f24df4168 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:18:53 2018 +0900 Simplify `scope :test_reports` in job_artifacts commit 15d1d76ca1cb97501c82471eb1c927290071dcfb Merge: f3327b2912d ffbfd18ce2f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:53 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit f3327b2912d0b169e7a059dca7b4d15e77567075 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:44 2018 +0900 Fix "or string" to "or a string". Use be_valid commit 9aaae6d60f7537f55f862f4d61de7a0d3a3b6bc2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:25:57 2018 +0900 Fix spec file name - build_runner_presenter_spec.rb commit 41c64c190e2e2efa7ab91a0daa0598da2d755f05 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:18:12 2018 +0900 Rename to Ci::BuildRunnerPresenter commit e9762299eb66c8f88734f80d05d38b9616a8fde8 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:14:44 2018 +0900 Split methods into three in Ci::Builds::RunnerPresenter commit 6e73070313a782eb63d4fbcbe324d9acaf67334b Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:23:53 2018 +0900 Remove redandant as: :artifacts commit 063f647e4829d9c71a71d227f9946bb47b93691f Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:04:58 2018 +0900 Fix specs commit a45975afd9b9391390c1adafbeab72c970e97b64 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:18:53 2018 +0900 Created a separate presenter commit 431ad666e080124c90e13cbaf0d4f0969aa7b2f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:10:04 2018 +0900 Simplified config presenter commit 2e106569ea258f5f7556a8b454a6dd0e9cbe6902 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:25:05 2018 +0900 Skip file_format setting if the file_type is trace commit 0572bd8357a2e9ea16118a0bd85264e3fb799322 Merge: 30ae33daa1d 6cb30f83255 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:55 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 30ae33daa1d4afcb57e6335fba62a3c5fc98468a Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:23 2018 +0900 Fix spec commit ccb6eb75187030ff0fd3c6e69f89eeca79d2a929 Merge: 1ebaaaf2094 34c57e09b9f Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jul 24 14:27:48 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 1ebaaaf2094c47c03e16745d2f8af736ec102b76 Merge: bfdf565800b dc7b4b7bb97 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 23 14:22:29 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit bfdf565800b58e838a760aa01d2fadb64e2d768f Merge: 681bd6a878a 44dbeccbe10 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 19:10:47 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 681bd6a878ad2a77c278f5619b51c542d7382aa2 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:19:46 2018 +0900 Specify DOWNTIME=false commit 59c4e31390e0d616d69babf8ac857e98f2dc774e Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:14:44 2018 +0900 Wrap long lines commit 3d85788edbe73fc74c72854508e47fe259d99236 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:05:31 2018 +0900 Checking filr_format and file_type paring commit 3c92a22faf6278e7a2d1ee13bd978bc659b72452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:07:21 2018 +0900 Fix build presenter spec commit 36e69897b0524cdee6060c928c03af734afae664 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:02:09 2018 +0900 Erase test reports at the proper timing commit 402ae97ecf7f9e3fe541f2d6abef6e47ab740452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:46:56 2018 +0900 Make GENERAL_ARCHIVE_FILE_TYPE as a single entry commit 75f75b3f5988398fff0660ca5f04aec756ab03bb Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:42:16 2018 +0900 Implement config artifact presenter commit 9ecaee914defba5f12a7a06375ea2876b4328d7f Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 14:27:54 2018 +0900 Introduce ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION check commit 34ea9610ab9a249a576ee435f365b9e1fcca7f00 Merge: d88523ca884 b60364c0f37 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 13:46:52 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit d88523ca88420354f61bd36f533c62a6ca474423 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 21:00:40 2018 +0900 Revert unnecessary change commit d9beb10ede5e4e8abe388fadbd6412640293917a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:57:03 2018 +0900 Remove scattering around erase_test_reports! commit c79f361ca01f8dbc0d395edee5fab7f5a0697934 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:53:00 2018 +0900 Rever archive_metadata refactoring (For simplifying) commit 55bc71a404d8cf5fa87e187f6e88da92ab95afa9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:45:19 2018 +0900 Use array_of_strings_or_string in Command commit 8a576b18c8ab8ead2344e2885aaf2fde11af0328 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:40:06 2018 +0900 Fix spec commit a2cda62fb922184aaf0e78699e06846c96565e0d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:27:11 2018 +0900 Fix presenter spec commit 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:23:41 2018 +0900 Fix artifact migratable commit a3930853c93862007ba6814511bc32042c7f4986 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:15:41 2018 +0900 Increment migration version to use `file_format` when archiving traces commit e31121cb5e617b0f05e375c2150ece0e38e5e0d6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 17:57:15 2018 +0900 Impolement job_artifact.test_reports method commit e54707fdf97392839cb2c4711160bd3bc89da196 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:49:27 2018 +0900 Fix erase method commit 20e95824341af1ebc5877d28dc5eba26f73eddf9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:28:00 2018 +0900 Fix spec commit 7ade498101d02573b20a2405ebe0bdb8efd8aa3b Merge: e7be6b2b362 98eccfc44c5 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 12:37:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit e7be6b2b3624ba44d56143084731cb9a6168f974 Merge: 5a8d4930e01 9bdc9b1ae69 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:36 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 5a8d4930e0127aae311bfa3da70d9ab9637791e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:28 2018 +0900 Evaluate artifact_format commit c3ce06aa9bc6481b37a16d175adf0fd1c37a1bc0 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 22:27:46 2018 +0900 Fix sending junit.xml commit e5ce3668ee65217aba610d5311efd5e82bacddf3 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 19:02:06 2018 +0900 Add spec for Gitlab::Ci::Config::Entry::Artifacts commit ede107caf13fb215045576dcce18e20eec776df1 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:58:28 2018 +0900 Revert refactoring commit 15531ba9feff669b2ac05936e0feaee1856c1571 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:57:31 2018 +0900 Revert refactoring commit 14821f3babcc210bc52e4e825adc8333752fbc88 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:55:41 2018 +0900 Add spec for file format. Add spec for config_artifacts commit 882faeab57ab39d18f72abd9b65d286db92e1011 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:20:28 2018 +0900 Add file_format to factory commit 3cd0513e254db15141cd748f6209179f462974f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:12:52 2018 +0900 Rename migration file properly commit f511933b5f618fc47d1512554878913922dfba61 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:09:57 2018 +0900 Revert artifacts_archive_file refactoring commit e295e8cbdee065ee3af6dd82f512729554237cad Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 16:03:26 2018 +0900 Dry up the converion in Entry::Reports commit b0ffa42f6410be4718e7a36cb21f7b585421750e Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:50:42 2018 +0900 Set file_format at callers commit f3dc7a2e02901c79a9e572514a1b731c680e43cc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:47:51 2018 +0900 Use presenter for presenting artifacts hash to runner commit e5299526138be90d65cf13368134e734b46f7597 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:59:09 2018 +0900 Support deleting junit artifact. Make wording explicit commit cc81c34acf23323257d190c23030d0a89265bccc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:35:12 2018 +0900 Add changelog commit abde0f2ab5c5c1d99b2f94a049984877bb5a4d77 Merge: 4c87e5b388f fabf6a5634f Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 13:22:22 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 4c87e5b388fb098fb6da71e17a47fa204033e4ac Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 17:33:07 2018 +0900 Fix static analysis commit bc96346be6990b75da9a36055814b24b5b805707 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 16:43:02 2018 +0900 Fix Config::Entry::Artifacts commit aac284613b9db43e3021198dc5b43b81806f1bce Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 14:40:20 2018 +0900 Generalized by DEFAULT_FILE_FORMAT commit a79299fdbb0ed74000ca37cff8fef8268cd29b13 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:55:02 2018 +0900 Cleanup API::Entities::JobRequest::Artifacts commit 1650249214768c23f6f46ec62c0c54448017eeb5 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:25:52 2018 +0900 Simplified file_type relations commit 981da91bc4c255ff992870e4e4c4393696f5bece Merge: e79808425eb 924146a8d6b Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:18:20 2018 +0900 Merge branch 'master' into artifact-format-v2 commit e79808425eb63c322a997e71d606d97b85e42048 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 18:16:52 2018 +0900 Remove unnecessary change commit a531bd7487955143489d286a0fb2e5d0984acc52 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 17:40:35 2018 +0900 Fix errors typo commit 57d6f21821c8ad934874c1aac3f627335c64c80d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:32:35 2018 +0900 Use the correct type name commit da4ca63f25a27a1268317952061c81a28516653f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:29:21 2018 +0900 Refactor job_artifacts_metadata to job_artifacts_archive_metadata commit 4098a8f10f92a6efa48080f8925809e251066f9d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:23:55 2018 +0900 Add job_artifacts_junit relation commit 5342f07e100253713dbf50eb303da1977484077f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:14:03 2018 +0900 Fix raw to raw? commit 15e0abcb22d9db3d8ef955e647f0a5d0a49c26b6 Merge: 31252fe8d75 ba38931d90b Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:12:38 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 31252fe8d751319c5390f898f66f0af4a8581013 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 19:05:51 2018 +0900 Temporaly use type Hash for reports commit 583165c0349f40e7be16a8039dbffb4139f94921 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:27:21 2018 +0900 Revert unnecessary change commit eb48369b8311b538f46f59a31f4a6d3f8c9e68e1 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:21:46 2018 +0900 Use file_format raw for trace commit fb69ae8349d58499ad21965c0d1cf95e2b79a8e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:20:10 2018 +0900 Check the presence of the file_format commit c0840224bc8789d35da032c2a0ee48aa9f2232aa Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:16:19 2018 +0900 Add format_restriction validation commit d64fbd388cb2294447df5185366d8b5016591949 Merge: 7ec81e7c7d1 c2a0a3ab1ae Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:11:44 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 7ec81e7c7d115f77d712892dfc79db72b9f5bc7a Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:23:54 2018 +0900 Artifacts presenter (Halfway) commit a3ccbe4c3a9b7d3095fe1929dee5fd9c57e168e0 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:22:52 2018 +0900 Fix schema.rb commit b630c670c707548799c6852e4465ef94fb4a0572 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:26:03 2018 +0900 Allow reports type under artifacts. Allow junit keyword in it. commit e7e37612487b556320d27f4fe0de32cd4ec20720 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:25:10 2018 +0900 Change column name to artifact_format commit f3f25d56a7c627f4bb9d91d19de175273a7a6a81 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 18:02:21 2018 +0900 Rename metadata to archive_metadata, and compress to file_format commit d7e0709319ab8fe35a2598a3d484eb89b1885934 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 17:47:18 2018 +0900 Validate compression. Clean up schema commit beb5990e7e3bfbb308245dc97284aaf9700bd982 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 19:06:54 2018 +0900 Make compression params at the first level commit 1e2e1c0db5412e1aed3bf47562350c20c69dc1a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 16:31:03 2018 +0900 Reorganize components
2018-07-27 05:04:35 +00:00
erase_test_reports!
erase_trace!
update_erased!(opts[:erased_by])
end
def erasable?
Squashed commit of the following: commit c35ca6594eb1d29cac46362d09036f3d128143ed Merge: 87da74fb98a 13ea4b387dd Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 27 13:25:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 87da74fb98aef1f664553ca2b8406ca154e4c19f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:27:45 2018 +0900 Remove unncessary GENERAL_ARCHIVE_FILE_TYPE commit 5a3cfc1fdc8e81dd5647e275f87c0da2d93235b4 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:19:44 2018 +0900 Expand entities in JobRequest::Artifacts commit 660f885ebb25a19182e601181050683d2b6134f6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 20:06:14 2018 +0900 Add tests commit 60bca3dcfd055647a9f43523b79d5eebdc4bdc5a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:30:52 2018 +0900 Simplify build runner presenter commit 81d1951d5562bec4086d719748360f3f24df4168 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:18:53 2018 +0900 Simplify `scope :test_reports` in job_artifacts commit 15d1d76ca1cb97501c82471eb1c927290071dcfb Merge: f3327b2912d ffbfd18ce2f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:53 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit f3327b2912d0b169e7a059dca7b4d15e77567075 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 26 19:01:44 2018 +0900 Fix "or string" to "or a string". Use be_valid commit 9aaae6d60f7537f55f862f4d61de7a0d3a3b6bc2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:25:57 2018 +0900 Fix spec file name - build_runner_presenter_spec.rb commit 41c64c190e2e2efa7ab91a0daa0598da2d755f05 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:18:12 2018 +0900 Rename to Ci::BuildRunnerPresenter commit e9762299eb66c8f88734f80d05d38b9616a8fde8 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 21:14:44 2018 +0900 Split methods into three in Ci::Builds::RunnerPresenter commit 6e73070313a782eb63d4fbcbe324d9acaf67334b Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:23:53 2018 +0900 Remove redandant as: :artifacts commit 063f647e4829d9c71a71d227f9946bb47b93691f Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 20:04:58 2018 +0900 Fix specs commit a45975afd9b9391390c1adafbeab72c970e97b64 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:18:53 2018 +0900 Created a separate presenter commit 431ad666e080124c90e13cbaf0d4f0969aa7b2f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 18:10:04 2018 +0900 Simplified config presenter commit 2e106569ea258f5f7556a8b454a6dd0e9cbe6902 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:25:05 2018 +0900 Skip file_format setting if the file_type is trace commit 0572bd8357a2e9ea16118a0bd85264e3fb799322 Merge: 30ae33daa1d 6cb30f83255 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:55 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 30ae33daa1d4afcb57e6335fba62a3c5fc98468a Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 25 17:13:23 2018 +0900 Fix spec commit ccb6eb75187030ff0fd3c6e69f89eeca79d2a929 Merge: 1ebaaaf2094 34c57e09b9f Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jul 24 14:27:48 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 1ebaaaf2094c47c03e16745d2f8af736ec102b76 Merge: bfdf565800b dc7b4b7bb97 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 23 14:22:29 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit bfdf565800b58e838a760aa01d2fadb64e2d768f Merge: 681bd6a878a 44dbeccbe10 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 19:10:47 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit 681bd6a878ad2a77c278f5619b51c542d7382aa2 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:19:46 2018 +0900 Specify DOWNTIME=false commit 59c4e31390e0d616d69babf8ac857e98f2dc774e Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:14:44 2018 +0900 Wrap long lines commit 3d85788edbe73fc74c72854508e47fe259d99236 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 18:05:31 2018 +0900 Checking filr_format and file_type paring commit 3c92a22faf6278e7a2d1ee13bd978bc659b72452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:07:21 2018 +0900 Fix build presenter spec commit 36e69897b0524cdee6060c928c03af734afae664 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 16:02:09 2018 +0900 Erase test reports at the proper timing commit 402ae97ecf7f9e3fe541f2d6abef6e47ab740452 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:46:56 2018 +0900 Make GENERAL_ARCHIVE_FILE_TYPE as a single entry commit 75f75b3f5988398fff0660ca5f04aec756ab03bb Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 15:42:16 2018 +0900 Implement config artifact presenter commit 9ecaee914defba5f12a7a06375ea2876b4328d7f Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 14:27:54 2018 +0900 Introduce ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION check commit 34ea9610ab9a249a576ee435f365b9e1fcca7f00 Merge: d88523ca884 b60364c0f37 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 20 13:46:52 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit d88523ca88420354f61bd36f533c62a6ca474423 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 21:00:40 2018 +0900 Revert unnecessary change commit d9beb10ede5e4e8abe388fadbd6412640293917a Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:57:03 2018 +0900 Remove scattering around erase_test_reports! commit c79f361ca01f8dbc0d395edee5fab7f5a0697934 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:53:00 2018 +0900 Rever archive_metadata refactoring (For simplifying) commit 55bc71a404d8cf5fa87e187f6e88da92ab95afa9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:45:19 2018 +0900 Use array_of_strings_or_string in Command commit 8a576b18c8ab8ead2344e2885aaf2fde11af0328 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 20:40:06 2018 +0900 Fix spec commit a2cda62fb922184aaf0e78699e06846c96565e0d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:27:11 2018 +0900 Fix presenter spec commit 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:23:41 2018 +0900 Fix artifact migratable commit a3930853c93862007ba6814511bc32042c7f4986 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 18:15:41 2018 +0900 Increment migration version to use `file_format` when archiving traces commit e31121cb5e617b0f05e375c2150ece0e38e5e0d6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 17:57:15 2018 +0900 Impolement job_artifact.test_reports method commit e54707fdf97392839cb2c4711160bd3bc89da196 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:49:27 2018 +0900 Fix erase method commit 20e95824341af1ebc5877d28dc5eba26f73eddf9 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 16:28:00 2018 +0900 Fix spec commit 7ade498101d02573b20a2405ebe0bdb8efd8aa3b Merge: e7be6b2b362 98eccfc44c5 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 19 12:37:22 2018 +0900 Merge branch 'master-ce' into artifact-format-v2 commit e7be6b2b3624ba44d56143084731cb9a6168f974 Merge: 5a8d4930e01 9bdc9b1ae69 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:36 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 5a8d4930e0127aae311bfa3da70d9ab9637791e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 18 15:43:28 2018 +0900 Evaluate artifact_format commit c3ce06aa9bc6481b37a16d175adf0fd1c37a1bc0 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 22:27:46 2018 +0900 Fix sending junit.xml commit e5ce3668ee65217aba610d5311efd5e82bacddf3 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 19:02:06 2018 +0900 Add spec for Gitlab::Ci::Config::Entry::Artifacts commit ede107caf13fb215045576dcce18e20eec776df1 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:58:28 2018 +0900 Revert refactoring commit 15531ba9feff669b2ac05936e0feaee1856c1571 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:57:31 2018 +0900 Revert refactoring commit 14821f3babcc210bc52e4e825adc8333752fbc88 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:55:41 2018 +0900 Add spec for file format. Add spec for config_artifacts commit 882faeab57ab39d18f72abd9b65d286db92e1011 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:20:28 2018 +0900 Add file_format to factory commit 3cd0513e254db15141cd748f6209179f462974f2 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:12:52 2018 +0900 Rename migration file properly commit f511933b5f618fc47d1512554878913922dfba61 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 17:09:57 2018 +0900 Revert artifacts_archive_file refactoring commit e295e8cbdee065ee3af6dd82f512729554237cad Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 16:03:26 2018 +0900 Dry up the converion in Entry::Reports commit b0ffa42f6410be4718e7a36cb21f7b585421750e Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:50:42 2018 +0900 Set file_format at callers commit f3dc7a2e02901c79a9e572514a1b731c680e43cc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 15:47:51 2018 +0900 Use presenter for presenting artifacts hash to runner commit e5299526138be90d65cf13368134e734b46f7597 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:59:09 2018 +0900 Support deleting junit artifact. Make wording explicit commit cc81c34acf23323257d190c23030d0a89265bccc Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 14:35:12 2018 +0900 Add changelog commit abde0f2ab5c5c1d99b2f94a049984877bb5a4d77 Merge: 4c87e5b388f fabf6a5634f Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jul 16 13:22:22 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 4c87e5b388fb098fb6da71e17a47fa204033e4ac Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 17:33:07 2018 +0900 Fix static analysis commit bc96346be6990b75da9a36055814b24b5b805707 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 16:43:02 2018 +0900 Fix Config::Entry::Artifacts commit aac284613b9db43e3021198dc5b43b81806f1bce Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 14:40:20 2018 +0900 Generalized by DEFAULT_FILE_FORMAT commit a79299fdbb0ed74000ca37cff8fef8268cd29b13 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:55:02 2018 +0900 Cleanup API::Entities::JobRequest::Artifacts commit 1650249214768c23f6f46ec62c0c54448017eeb5 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:25:52 2018 +0900 Simplified file_type relations commit 981da91bc4c255ff992870e4e4c4393696f5bece Merge: e79808425eb 924146a8d6b Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 13 13:18:20 2018 +0900 Merge branch 'master' into artifact-format-v2 commit e79808425eb63c322a997e71d606d97b85e42048 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 18:16:52 2018 +0900 Remove unnecessary change commit a531bd7487955143489d286a0fb2e5d0984acc52 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 17:40:35 2018 +0900 Fix errors typo commit 57d6f21821c8ad934874c1aac3f627335c64c80d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:32:35 2018 +0900 Use the correct type name commit da4ca63f25a27a1268317952061c81a28516653f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:29:21 2018 +0900 Refactor job_artifacts_metadata to job_artifacts_archive_metadata commit 4098a8f10f92a6efa48080f8925809e251066f9d Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:23:55 2018 +0900 Add job_artifacts_junit relation commit 5342f07e100253713dbf50eb303da1977484077f Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:14:03 2018 +0900 Fix raw to raw? commit 15e0abcb22d9db3d8ef955e647f0a5d0a49c26b6 Merge: 31252fe8d75 ba38931d90b Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 12 13:12:38 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 31252fe8d751319c5390f898f66f0af4a8581013 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 19:05:51 2018 +0900 Temporaly use type Hash for reports commit 583165c0349f40e7be16a8039dbffb4139f94921 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:27:21 2018 +0900 Revert unnecessary change commit eb48369b8311b538f46f59a31f4a6d3f8c9e68e1 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:21:46 2018 +0900 Use file_format raw for trace commit fb69ae8349d58499ad21965c0d1cf95e2b79a8e3 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:20:10 2018 +0900 Check the presence of the file_format commit c0840224bc8789d35da032c2a0ee48aa9f2232aa Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:16:19 2018 +0900 Add format_restriction validation commit d64fbd388cb2294447df5185366d8b5016591949 Merge: 7ec81e7c7d1 c2a0a3ab1ae Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Jul 11 15:11:44 2018 +0900 Merge branch 'master' into artifact-format-v2 commit 7ec81e7c7d115f77d712892dfc79db72b9f5bc7a Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:23:54 2018 +0900 Artifacts presenter (Halfway) commit a3ccbe4c3a9b7d3095fe1929dee5fd9c57e168e0 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 20:22:52 2018 +0900 Fix schema.rb commit b630c670c707548799c6852e4465ef94fb4a0572 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:26:03 2018 +0900 Allow reports type under artifacts. Allow junit keyword in it. commit e7e37612487b556320d27f4fe0de32cd4ec20720 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 19:25:10 2018 +0900 Change column name to artifact_format commit f3f25d56a7c627f4bb9d91d19de175273a7a6a81 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 18:02:21 2018 +0900 Rename metadata to archive_metadata, and compress to file_format commit d7e0709319ab8fe35a2598a3d484eb89b1885934 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jul 6 17:47:18 2018 +0900 Validate compression. Clean up schema commit beb5990e7e3bfbb308245dc97284aaf9700bd982 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 19:06:54 2018 +0900 Make compression params at the first level commit 1e2e1c0db5412e1aed3bf47562350c20c69dc1a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Jul 5 16:31:03 2018 +0900 Reorganize components
2018-07-27 05:04:35 +00:00
complete? && (artifacts? || has_test_reports? || has_trace?)
end
def erased?
!self.erased_at.nil?
end
2016-05-18 20:21:51 +00:00
def artifacts_expired?
artifacts_expire_at && artifacts_expire_at < Time.now
2016-05-18 20:21:51 +00:00
end
def artifacts_expire_in
artifacts_expire_at - Time.now if artifacts_expire_at
end
def artifacts_expire_in=(value)
2016-06-10 19:45:06 +00:00
self.artifacts_expire_at =
if value
ChronicDuration.parse(value)&.seconds&.from_now
2016-06-10 19:45:06 +00:00
end
end
def has_expiring_artifacts?
2017-05-29 07:58:20 +00:00
artifacts_expire_at.present? && artifacts_expire_at > Time.now
end
2016-06-08 15:18:54 +00:00
def keep_artifacts!
2016-05-18 20:21:51 +00:00
self.update(artifacts_expire_at: nil)
2017-12-03 11:02:11 +00:00
self.job_artifacts.update_all(expire_at: nil)
2016-05-18 20:21:51 +00:00
end
def coverage_regex
super || project.try(:build_coverage_regex)
end
def when
read_attribute(:when) || build_attributes_from_config[:when] || 'on_success'
end
def yaml_variables
read_attribute(:yaml_variables) || build_attributes_from_config[:yaml_variables] || []
end
def user_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
break variables if user.blank?
variables.append(key: 'GITLAB_USER_ID', value: user.id.to_s)
variables.append(key: 'GITLAB_USER_EMAIL', value: user.email)
variables.append(key: 'GITLAB_USER_LOGIN', value: user.username)
variables.append(key: 'GITLAB_USER_NAME', value: user.name)
end
end
def secret_group_variables
return [] unless project.group
project.group.secret_variables_for(ref, project)
end
def secret_project_variables(environment: persisted_environment)
project.secret_variables_for(ref: ref, environment: environment)
end
2017-02-16 00:05:44 +00:00
def steps
2017-03-07 11:30:34 +00:00
[Gitlab::Ci::Build::Step.from_commands(self),
Gitlab::Ci::Build::Step.from_after_script(self)].compact
2017-02-16 00:05:44 +00:00
end
def image
Gitlab::Ci::Build::Image.from_image(self)
2017-02-16 00:05:44 +00:00
end
def services
Gitlab::Ci::Build::Image.from_services(self)
2017-02-16 00:05:44 +00:00
end
def cache
2018-01-04 18:43:31 +00:00
cache = options[:cache]
if cache && project.jobs_cache_index
cache = cache.merge(
key: "#{cache[:key]}-#{project.jobs_cache_index}")
2017-12-22 22:06:15 +00:00
end
2018-01-04 18:43:31 +00:00
[cache]
2017-02-16 00:05:44 +00:00
end
2016-11-20 19:43:50 +00:00
def credentials
Gitlab::Ci::Build::Credentials::Factory.new(self).create!
2016-11-20 19:43:50 +00:00
end
def dependencies
return [] if empty_dependencies?
depended_jobs = depends_on_builds
2017-03-18 23:35:17 +00:00
return depended_jobs unless options[:dependencies].present?
2017-03-18 23:35:17 +00:00
depended_jobs.select do |job|
options[:dependencies].include?(job.name)
end
end
def empty_dependencies?
options[:dependencies]&.empty?
end
2018-07-17 10:58:57 +00:00
def valid_build_dependencies?
return unless Feature.enabled?('ci_disable_validates_dependencies')
dependencies.each do |dependency|
raise MissingDependenciesError unless dependency.valid_dependency?
end
end
2017-12-02 07:23:19 +00:00
def valid_dependency?
return false if artifacts_expired?
return false if erased?
true
end
2018-07-17 10:58:57 +00:00
def supported_runner?(features)
runner_required_features.all? do |feature_name|
features[feature_name]
end
end
def hide_secrets(trace)
return unless trace
trace = trace.dup
Gitlab::Ci::MaskSecret.mask!(trace, project.runners_token) if project
Gitlab::Ci::MaskSecret.mask!(trace, token)
trace
end
2017-09-05 15:10:57 +00:00
def serializable_hash(options = {})
2017-09-06 08:16:11 +00:00
super(options).merge(when: read_attribute(:when))
2017-09-05 15:10:57 +00:00
end
2018-07-05 13:55:10 +00:00
def has_terminal?
running? && runner_session_url.present?
end
private
def update_artifacts_size
2017-12-03 15:21:59 +00:00
self.artifacts_size = legacy_artifacts_file&.size
end
def erase_trace!
trace.erase!
end
def update_erased!(user = nil)
2016-06-08 15:18:54 +00:00
self.update(erased_by: user, erased_at: Time.now, artifacts_expire_at: nil)
end
def unscoped_project
2017-03-17 23:06:11 +00:00
@unscoped_project ||= Project.unscoped.find_by(id: project_id)
end
CI_REGISTRY_USER = 'gitlab-ci-token'.freeze
def persisted_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
break variables unless persisted?
variables
.concat(pipeline.persisted_variables)
.append(key: 'CI_JOB_ID', value: id.to_s)
2018-05-20 12:18:50 +00:00
.append(key: 'CI_JOB_URL', value: Gitlab::Routing.url_helpers.project_job_url(project, self))
.append(key: 'CI_JOB_TOKEN', value: token, public: false)
.append(key: 'CI_BUILD_ID', value: id.to_s)
.append(key: 'CI_BUILD_TOKEN', value: token, public: false)
.append(key: 'CI_REGISTRY_USER', value: CI_REGISTRY_USER)
.append(key: 'CI_REGISTRY_PASSWORD', value: token, public: false)
.append(key: 'CI_REPOSITORY_URL', value: repo_url, public: false)
.concat(deploy_token_variables)
end
end
def predefined_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.append(key: 'CI', value: 'true')
variables.append(key: 'GITLAB_CI', value: 'true')
variables.append(key: 'GITLAB_FEATURES', value: project.licensed_features.join(','))
variables.append(key: 'CI_SERVER_NAME', value: 'GitLab')
variables.append(key: 'CI_SERVER_VERSION', value: Gitlab::VERSION)
variables.append(key: 'CI_SERVER_REVISION', value: Gitlab.revision)
variables.append(key: 'CI_JOB_NAME', value: name)
variables.append(key: 'CI_JOB_STAGE', value: stage)
variables.append(key: 'CI_COMMIT_SHA', value: sha)
variables.append(key: 'CI_COMMIT_BEFORE_SHA', value: before_sha)
variables.append(key: 'CI_COMMIT_REF_NAME', value: ref)
variables.append(key: 'CI_COMMIT_REF_SLUG', value: ref_slug)
variables.append(key: "CI_COMMIT_TAG", value: ref) if tag?
variables.append(key: "CI_PIPELINE_TRIGGERED", value: 'true') if trigger_request
variables.append(key: "CI_JOB_MANUAL", value: 'true') if action?
variables.concat(legacy_variables)
end
end
def legacy_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.append(key: 'CI_BUILD_REF', value: sha)
variables.append(key: 'CI_BUILD_BEFORE_SHA', value: before_sha)
variables.append(key: 'CI_BUILD_REF_NAME', value: ref)
variables.append(key: 'CI_BUILD_REF_SLUG', value: ref_slug)
variables.append(key: 'CI_BUILD_NAME', value: name)
variables.append(key: 'CI_BUILD_STAGE', value: stage)
variables.append(key: "CI_BUILD_TAG", value: ref) if tag?
variables.append(key: "CI_BUILD_TRIGGERED", value: 'true') if trigger_request
variables.append(key: "CI_BUILD_MANUAL", value: 'true') if action?
end
end
def persisted_environment_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
break variables unless persisted? && persisted_environment.present?
variables.concat(persisted_environment.predefined_variables)
# Here we're passing unexpanded environment_url for runner to expand,
# and we need to make sure that CI_ENVIRONMENT_NAME and
# CI_ENVIRONMENT_SLUG so on are available for the URL be expanded.
variables.append(key: 'CI_ENVIRONMENT_URL', value: environment_url) if environment_url
end
end
def deploy_token_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
break variables unless gitlab_deploy_token
variables.append(key: 'CI_DEPLOY_USER', value: gitlab_deploy_token.username)
variables.append(key: 'CI_DEPLOY_PASSWORD', value: gitlab_deploy_token.token, public: false)
end
end
def environment_url
options&.dig(:environment, :url) || persisted_environment&.external_url
end
def build_attributes_from_config
return {} unless pipeline.config_processor
pipeline.config_processor.build_attributes(name)
end
2016-09-19 10:38:03 +00:00
def update_project_statistics_after_save
update_project_statistics(read_attribute(:artifacts_size).to_i - artifacts_size_was.to_i)
end
def update_project_statistics_after_destroy
update_project_statistics(-artifacts_size)
end
def update_project_statistics(difference)
ProjectStatistics.increment_statistic(project_id, :build_artifacts_size, difference)
end
def project_destroyed?
project.pending_delete?
end
2015-08-26 01:42:46 +00:00
end
end