Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/ref.rb')
-rw-r--r--app/models/ci/ref.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/models/ci/ref.rb b/app/models/ci/ref.rb
index 8655e8eb9b8..e8ce58f2de5 100644
--- a/app/models/ci/ref.rb
+++ b/app/models/ci/ref.rb
@@ -30,15 +30,6 @@ module Ci
state :fixed, value: 3
state :broken, value: 4
state :still_failing, value: 5
-
- after_transition any => [:fixed, :success] do |ci_ref|
- # Do not try to unlock if no artifacts are locked
- next unless ci_ref.artifacts_locked?
-
- ci_ref.run_after_commit do
- Ci::Refs::UnlockPreviousPipelinesWorker.perform_async(ci_ref.id)
- end
- end
end
class << self
@@ -75,5 +66,13 @@ module Ci
self.status_name
end
end
+
+ def last_successful_ci_source_pipeline
+ pipelines.ci_sources.success.order(id: :desc).first
+ end
+
+ def last_unlockable_ci_source_pipeline
+ pipelines.ci_sources.with_unlockable_status.order(id: :desc).first
+ end
end
end