Skip to content
Snippets Groups Projects

Add new jsonb column to store settings for default branch protection

Merged Michael Becker requested to merge feat/408150 into master
All threads resolved!
4 files
+ 42
0
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -31,6 +31,9 @@ class ApplicationSetting < MainClusterwide::ApplicationRecord
@@ -31,6 +31,9 @@ class ApplicationSetting < MainClusterwide::ApplicationRecord
archive_builds_in_seconds: 'Archive job value'
archive_builds_in_seconds: 'Archive job value'
}.freeze
}.freeze
 
# matches the size set in the database constraint
 
DEFAULT_BRANCH_PROTECTIONS_DEFAULT_MAX_SIZE = 1.kilobyte
 
enum whats_new_variant: { all_tiers: 0, current_tier: 1, disabled: 2 }, _prefix: true
enum whats_new_variant: { all_tiers: 0, current_tier: 1, disabled: 2 }, _prefix: true
enum email_confirmation_setting: { off: 0, soft: 1, hard: 2 }, _prefix: true
enum email_confirmation_setting: { off: 0, soft: 1, hard: 2 }, _prefix: true
@@ -95,6 +98,7 @@ def self.kroki_formats_attributes
@@ -95,6 +98,7 @@ def self.kroki_formats_attributes
chronic_duration_attr :project_runner_token_expiration_interval_human_readable, :project_runner_token_expiration_interval
chronic_duration_attr :project_runner_token_expiration_interval_human_readable, :project_runner_token_expiration_interval
validates :default_branch_protection_defaults, json_schema: { filename: 'default_branch_protection_defaults' }
validates :default_branch_protection_defaults, json_schema: { filename: 'default_branch_protection_defaults' }
 
validates :default_branch_protection_defaults, bytesize: { maximum: -> { DEFAULT_BRANCH_PROTECTIONS_DEFAULT_MAX_SIZE } }
validates :grafana_url,
validates :grafana_url,
system_hook_url: ADDRESSABLE_URL_VALIDATION_OPTIONS.merge({
system_hook_url: ADDRESSABLE_URL_VALIDATION_OPTIONS.merge({
Loading