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:
authorKamil Trzciński <ayufan@ayufan.eu>2019-08-02 19:12:24 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-08-02 20:14:59 +0300
commita2bbf7b8c197922067d1266249197e5f60e0fd7f (patch)
tree39aba3f1fb73cc165faf03df7301e1c7cc3d59d8 /app/models/commit_status.rb
parent8156e77c1a25bc6050e5036fa3bbfd29201a6d5c (diff)
Properly process `needs:` with `when:`
Currently, some of the jobs with `needs:` would be processed in stages, it means that `when:` for such jobs would not be respected. This changes the behavior to have a separate execution paths for jobs with `needs:`.
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index d7eb78db5b8..a9c29fb390b 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -49,6 +49,10 @@ class CommitStatus < ApplicationRecord
where('EXISTS (?)', needs).preload(:needs)
end
+ scope :without_needs, -> do
+ where('NOT EXISTS (?)', Ci::BuildNeed.scoped_build.select(1))
+ end
+
# We use `CommitStatusEnums.failure_reasons` here so that EE can more easily
# extend this `Hash` with new values.
enum_with_nil failure_reason: ::CommitStatusEnums.failure_reasons