Skip to content

Commit d454ba3

Browse files
committed
Extended state_reason field size to 5k
Signed-off-by: Rashed Kamal <rashed.kamal@broadcom.com>
1 parent 4df5b0a commit d454ba3

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

app/messages/stack_create_message.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class StackCreateMessage < MetadataBaseMessage
88
validates :name, presence: true, length: { maximum: 250 }
99
validates :description, length: { maximum: 250 }
1010
validates :state, inclusion: { in: StackStates::VALID_STATES, message: "must be one of #{StackStates::VALID_STATES.join(', ')}" }, allow_nil: false, if: :state_requested?
11-
validates :state_reason, length: { maximum: 1000 }, allow_nil: true
11+
validates :state_reason, length: { maximum: 5000 }, allow_nil: true
1212

1313
def state_requested?
1414
requested?(:state)

app/messages/stack_update_message.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class StackUpdateMessage < MetadataBaseMessage
77

88
validates_with NoAdditionalKeysValidator
99
validates :state, inclusion: { in: StackStates::VALID_STATES, message: "must be one of #{StackStates::VALID_STATES.join(', ')}" }, allow_nil: false, if: :state_requested?
10-
validates :state_reason, length: { maximum: 1000 }, allow_nil: true
10+
validates :state_reason, length: { maximum: 5000 }, allow_nil: true
1111

1212
def state_requested?
1313
requested?(:state)

db/migrations/20260202105042_add_state_reason_to_stacks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Sequel.migration do
22
up do
33
alter_table :stacks do
4-
add_column :state_reason, String, null: true, size: 1000 unless @db.schema(:stacks).map(&:first).include?(:state_reason)
4+
add_column :state_reason, String, null: true, size: 5000 unless @db.schema(:stacks).map(&:first).include?(:state_reason)
55
end
66
end
77

spec/unit/messages/stack_create_message_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
end
125125

126126
describe 'state_reason' do
127-
MAX_STATE_REASON_LENGTH = 1000
127+
MAX_STATE_REASON_LENGTH = 5000
128128

129129
context 'when it is not provided' do
130130
let(:params) { valid_params }

spec/unit/messages/stack_update_message_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
end
6565

6666
describe 'state_reason' do
67-
MAX_STATE_REASON_LENGTH = 1000
67+
MAX_STATE_REASON_LENGTH = 5000
6868

6969
context 'when it is not provided' do
7070
let(:params) { valid_params }

0 commit comments

Comments
 (0)