diff options
Diffstat (limited to 'app/models/ci/group.rb')
-rw-r--r-- | app/models/ci/group.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/ci/group.rb b/app/models/ci/group.rb index 0e05318b253..15dc1ca8954 100644 --- a/app/models/ci/group.rb +++ b/app/models/ci/group.rb @@ -11,11 +11,12 @@ module Ci include StaticModel include Gitlab::Utils::StrongMemoize - attr_reader :stage, :name, :jobs + attr_reader :project, :stage, :name, :jobs delegate :size, to: :jobs - def initialize(stage, name:, jobs:) + def initialize(project, stage, name:, jobs:) + @project = project @stage = stage @name = name @jobs = jobs @@ -23,7 +24,7 @@ module Ci def status strong_memoize(:status) do - if Feature.enabled?(:ci_composite_status, default_enabled: false) + if Feature.enabled?(:ci_composite_status, project, default_enabled: false) Gitlab::Ci::Status::Composite .new(@jobs) .status @@ -44,11 +45,11 @@ module Ci end end - def self.fabricate(stage) + def self.fabricate(project, stage) stage.statuses.ordered.latest .sort_by(&:sortable_name).group_by(&:group_name) .map do |group_name, grouped_statuses| - self.new(stage, name: group_name, jobs: grouped_statuses) + self.new(project, stage, name: group_name, jobs: grouped_statuses) end end end |