summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/legacy_stage.rb2
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--app/models/ci/stage.rb2
-rw-r--r--app/models/commit_status.rb8
-rw-r--r--app/models/concerns/has_status.rb4
-rw-r--r--app/models/user.rb2
6 files changed, 10 insertions, 10 deletions
diff --git a/app/models/ci/legacy_stage.rb b/app/models/ci/legacy_stage.rb
index 0a67a652e22..9ca5cf13907 100644
--- a/app/models/ci/legacy_stage.rb
+++ b/app/models/ci/legacy_stage.rb
@@ -32,7 +32,7 @@ module Ci
end
def status
- @status ||= statuses.latest.slow_composite_status
+ @status ||= statuses.latest.slow_composite_status(project: project)
end
def detailed_status(current_user)
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 4e9be86d3a9..3ce44a066ae 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -968,7 +968,7 @@ module Ci
def latest_builds_status
return 'failed' unless yaml_errors.blank?
- statuses.latest.slow_composite_status || 'skipped'
+ statuses.latest.slow_composite_status(project: project) || 'skipped'
end
def keep_around_commits
diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb
index 75f73429c2a..e6c34f3df03 100644
--- a/app/models/ci/stage.rb
+++ b/app/models/ci/stage.rb
@@ -138,7 +138,7 @@ module Ci
end
def latest_stage_status
- statuses.latest.slow_composite_status || 'skipped'
+ statuses.latest.slow_composite_status(project: project) || 'skipped'
end
end
end
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 03260b28335..046f131b041 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -178,12 +178,12 @@ class CommitStatus < ApplicationRecord
select(:name)
end
- def self.status_for_prior_stages(index)
- before_stage(index).latest.slow_composite_status || 'success'
+ def self.status_for_prior_stages(index, project:)
+ before_stage(index).latest.slow_composite_status(project: project) || 'success'
end
- def self.status_for_names(names)
- where(name: names).latest.slow_composite_status || 'success'
+ def self.status_for_names(names, project:)
+ where(name: names).latest.slow_composite_status(project: project) || 'success'
end
def self.update_as_processed!
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb
index e06dad38c32..b80f8c2bbb2 100644
--- a/app/models/concerns/has_status.rb
+++ b/app/models/concerns/has_status.rb
@@ -65,8 +65,8 @@ module HasStatus
# This method performs expensive calculation of status:
# 1. By plucking all related objects,
# 2. Or executes expensive SQL query
- def slow_composite_status
- if Feature.enabled?(:ci_composite_status, default_enabled: false)
+ def slow_composite_status(project:)
+ if Feature.enabled?(:ci_composite_status, project, default_enabled: false)
Gitlab::Ci::Status::Composite
.new(all, with_allow_failure: columns_hash.key?('allow_failure'))
.status
diff --git a/app/models/user.rb b/app/models/user.rb
index e18d642a155..4d450f9305f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1689,7 +1689,7 @@ class User < ApplicationRecord
def gitlab_employee?
strong_memoize(:gitlab_employee) do
if Gitlab.com?
- Mail::Address.new(email).domain == "gitlab.com"
+ Mail::Address.new(email).domain == "gitlab.com" && confirmed?
else
false
end