diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/models/commit_status.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-edaa33dee2ff2f7ea3fac488d41558eb5f86d68c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index d6a2f62ca9b..21e2e21e9b3 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -170,8 +170,11 @@ class CommitStatus < Ci::ApplicationRecord end before_transition any => :failed do |commit_status, transition| - failure_reason = transition.args.first - commit_status.failure_reason = CommitStatus.failure_reasons[failure_reason] + reason = ::Gitlab::Ci::Build::Status::Reason + .fabricate(commit_status, transition.args.first) + + commit_status.failure_reason = reason.failure_reason_enum + commit_status.allow_failure = true if reason.force_allow_failure? end before_transition [:skipped, :manual] => :created do |commit_status, transition| @@ -191,11 +194,7 @@ class CommitStatus < Ci::ApplicationRecord commit_status.run_after_commit do PipelineProcessWorker.perform_async(pipeline_id) unless transition_options[:skip_pipeline_processing] - if Feature.enabled?(:expire_job_and_pipeline_cache_synchronously, project, default_enabled: :yaml) - expire_etag_cache! - else - ExpireJobCacheWorker.perform_async(id) - end + expire_etag_cache! end end @@ -221,8 +220,8 @@ class CommitStatus < Ci::ApplicationRecord false end - def self.bulk_insert_tags!(statuses, tag_list_by_build) - Gitlab::Ci::Tags::BulkInsert.new(statuses, tag_list_by_build).insert! + def self.bulk_insert_tags!(statuses) + Gitlab::Ci::Tags::BulkInsert.new(statuses).insert! end def locking_enabled? |