diff options
| author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-02 18:12:24 +0200 |
|---|---|---|
| committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-08-02 19:14:59 +0200 |
| commit | a2bbf7b8c197922067d1266249197e5f60e0fd7f (patch) | |
| tree | 39aba3f1fb73cc165faf03df7301e1c7cc3d59d8 /app/models/commit_status.rb | |
| parent | 8156e77c1a25bc6050e5036fa3bbfd29201a6d5c (diff) | |
| download | gitlab-ce-properly-process-all-needs.tar.gz | |
Properly process `needs:` with `when:`properly-process-all-needs
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.rb | 4 |
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 |
