diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-16 21:07:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-16 21:07:32 +0300 |
commit | 6ba7c824e92d68c6ae25f64bda5ab213ad9c9a58 (patch) | |
tree | 72b28f0f5222162a67a1919ff25beff4c2cabc2d /app/models/commit_status.rb | |
parent | acee9d6fb529ca8fb91b2b07bd49bd207df23c51 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 9f77bd8ebe2..a8e2615b327 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -25,11 +25,12 @@ class CommitStatus < Ci::ApplicationRecord self.sequence_name = :ci_builds_id_seq self.primary_key = :id + query_constraints :id, :partition_id partitionable scope: :pipeline, partitioned: true belongs_to :user belongs_to :project - belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id, inverse_of: :statuses + belongs_to :pipeline, ->(build) { in_partition(build) }, class_name: 'Ci::Pipeline', foreign_key: :commit_id, inverse_of: :statuses, partition_foreign_key: :partition_id belongs_to :auto_canceled_by, class_name: 'Ci::Pipeline', inverse_of: :auto_canceled_jobs belongs_to :ci_stage, class_name: 'Ci::Stage', foreign_key: :stage_id @@ -233,6 +234,10 @@ class CommitStatus < Ci::ApplicationRecord false end + def self.use_partition_id_filter? + Ci::Pipeline.use_partition_id_filter? + end + def locking_enabled? will_save_change_to_status? end |