Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-06 21:08:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-06 21:08:22 +0300
commit5a73318262aab6ab952f2b7205b3674ea1f20053 (patch)
treee53191adbc529ce23ca08a73e1235c7b6fb6ced5 /app/models
parent552877c4d1c535f529be13862692a8fe826a72a2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build_need.rb3
-rw-r--r--app/models/ci/processable.rb2
-rw-r--r--app/models/concerns/ci/partitionable.rb1
3 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ci/build_need.rb b/app/models/ci/build_need.rb
index 98d2f8e4fc0..3fa17d6d286 100644
--- a/app/models/ci/build_need.rb
+++ b/app/models/ci/build_need.rb
@@ -2,10 +2,13 @@
module Ci
class BuildNeed < Ci::ApplicationRecord
+ include Ci::Partitionable
include BulkInsertSafe
belongs_to :build, class_name: "Ci::Processable", foreign_key: :build_id, inverse_of: :needs
+ partitionable scope: :build
+
validates :build, presence: true
validates :name, presence: true, length: { maximum: 128 }
validates :optional, inclusion: { in: [true, false] }
diff --git a/app/models/ci/processable.rb b/app/models/ci/processable.rb
index 65600858650..eb805ffae0a 100644
--- a/app/models/ci/processable.rb
+++ b/app/models/ci/processable.rb
@@ -172,7 +172,7 @@ module Ci
def needs_attributes
strong_memoize(:needs_attributes) do
- needs.map { |need| need.attributes.except('id', 'build_id', 'partition_id') }
+ needs.map { |need| need.attributes.except('id', 'build_id') }
end
end
diff --git a/app/models/concerns/ci/partitionable.rb b/app/models/concerns/ci/partitionable.rb
index 1923681b72e..6e01da2e9df 100644
--- a/app/models/concerns/ci/partitionable.rb
+++ b/app/models/concerns/ci/partitionable.rb
@@ -25,6 +25,7 @@ module Ci
PARTITIONABLE_MODELS = %w[
CommitStatus
Ci::BuildMetadata
+ Ci::BuildNeed
Ci::BuildReportResult
Ci::BuildRunnerSession
Ci::BuildTraceChunk