diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 15:09:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 15:09:42 +0300 |
commit | 403678e00406edc8094f087ec70e00aa29e49bef (patch) | |
tree | 447d6d4967e9a11895683b27e637a50bd9fc0602 /app/models | |
parent | f5050253469fc0961c02deec0e698ad62bdd9de5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/group.rb | 11 | ||||
-rw-r--r-- | app/models/ci/legacy_stage.rb | 2 | ||||
-rw-r--r-- | app/models/ci/stage.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/ci/maskable.rb | 4 |
4 files changed, 10 insertions, 9 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 diff --git a/app/models/ci/legacy_stage.rb b/app/models/ci/legacy_stage.rb index 9ca5cf13907..f156219ea81 100644 --- a/app/models/ci/legacy_stage.rb +++ b/app/models/ci/legacy_stage.rb @@ -20,7 +20,7 @@ module Ci end def groups - @groups ||= Ci::Group.fabricate(self) + @groups ||= Ci::Group.fabricate(project, self) end def to_param diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb index e6c34f3df03..93bd42f8734 100644 --- a/app/models/ci/stage.rb +++ b/app/models/ci/stage.rb @@ -109,7 +109,7 @@ module Ci end def groups - @groups ||= Ci::Group.fabricate(self) + @groups ||= Ci::Group.fabricate(project, self) end def has_warnings? diff --git a/app/models/concerns/ci/maskable.rb b/app/models/concerns/ci/maskable.rb index 15bc48bf964..4e0ee72f18f 100644 --- a/app/models/concerns/ci/maskable.rb +++ b/app/models/concerns/ci/maskable.rb @@ -9,9 +9,9 @@ module Ci # * No variables # * No spaces # * Minimal length of 8 characters - # * Characters must be from the Base64 alphabet (RFC4648) with the addition of @ and : + # * Characters must be from the Base64 alphabet (RFC4648) with the addition of '@', ':' and '.' # * Absolutely no fun is allowed - REGEX = /\A[a-zA-Z0-9_+=\/@:-]{8,}\z/.freeze + REGEX = /\A[a-zA-Z0-9_+=\/@:.-]{8,}\z/.freeze included do validates :masked, inclusion: { in: [true, false] } |