diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/models/ci/build_metadata.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/models/ci/build_metadata.rb')
-rw-r--r-- | app/models/ci/build_metadata.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/models/ci/build_metadata.rb b/app/models/ci/build_metadata.rb index 33092e881f0..2f28509f812 100644 --- a/app/models/ci/build_metadata.rb +++ b/app/models/ci/build_metadata.rb @@ -5,6 +5,7 @@ module Ci # Data that should be persisted forever, should be stored with Ci::Build model. class BuildMetadata < Ci::ApplicationRecord BuildTimeout = Struct.new(:value, :source) + ROUTING_FEATURE_FLAG = :ci_partitioning_use_ci_builds_metadata_routing_table include Ci::Partitionable include Presentable @@ -13,7 +14,12 @@ module Ci self.table_name = 'ci_builds_metadata' self.primary_key = 'id' - partitionable scope: :build + self.sequence_name = 'ci_builds_metadata_id_seq' + + partitionable scope: :build, through: { + table: :p_ci_builds_metadata, + flag: ROUTING_FEATURE_FLAG + } belongs_to :build, class_name: 'CommitStatus' belongs_to :project @@ -24,9 +30,9 @@ module Ci validates :id_tokens, json_schema: { filename: 'build_metadata_id_tokens' } validates :secrets, json_schema: { filename: 'build_metadata_secrets' } - serialize :config_options, Serializers::SymbolizedJson # rubocop:disable Cop/ActiveRecordSerialize - serialize :config_variables, Serializers::SymbolizedJson # rubocop:disable Cop/ActiveRecordSerialize - serialize :runtime_runner_features, Serializers::SymbolizedJson # rubocop:disable Cop/ActiveRecordSerialize + attribute :config_options, :sym_jsonb + attribute :config_variables, :sym_jsonb + attribute :runtime_runner_features, :sym_jsonb chronic_duration_attr_reader :timeout_human_readable, :timeout @@ -50,7 +56,7 @@ module Ci end def set_cancel_gracefully - runtime_runner_features.merge!( { cancel_gracefully: true } ) + runtime_runner_features.merge!({ cancel_gracefully: true }) end def cancel_gracefully? |