Skip to content

Add state_reason in Stack object#4823

Open
rashedkvm wants to merge 5 commits intocloudfoundry:mainfrom
rashedkvm:state-reason
Open

Add state_reason in Stack object#4823
rashedkvm wants to merge 5 commits intocloudfoundry:mainfrom
rashedkvm:state-reason

Conversation

@rashedkvm
Copy link
Contributor

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:
    Add state_reason in Stack object

  • An explanation of the use cases your change solves
    See RFC#0045 (Stack Management)
    Includes state_reason in Stack Validation Error and Warning. See RFC#0045 (Stack Management). Includes state_reason in Stack Validation Error and Warning

  • Links to any other associated PRs
    Enhance stack handling with state_reason field community#1420

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@rashedkvm rashedkvm force-pushed the state-reason branch 3 times, most recently from ec3648c to 27197fe Compare February 4, 2026 16:14
sethboyles
sethboyles previously approved these changes Feb 4, 2026
Copy link
Member

@sethboyles sethboyles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, but I'd like someone involved with the RFC to take a look too.

sethboyles
sethboyles previously approved these changes Feb 4, 2026
validates :name, presence: true, length: { maximum: 250 }
validates :description, length: { maximum: 250 }
validates :state, inclusion: { in: StackStates::VALID_STATES, message: "must be one of #{StackStates::VALID_STATES.join(', ')}" }, allow_nil: false, if: :state_requested?
validates :state_reason, length: { maximum: 1000 }, allow_nil: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe increase that to e.g. 5k ? The reson is anyway only setable by a platform admin and not a user so chances of misuse are low.
I just thought when someone wants to include a URL they can be quite lengthy sometimes, depending where they are hosted i have docu links that have around 500 chars at times. So just a bit more headroom maybe that admins dont run into the situation they have to care about link shorteners or something to their docu ? I think the VARCHAR limit of mariadb is 65k and psql has non afaik so it should be pretty safe, wdyt ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this makes sense, I will update state_reason field length to 5000.

See RFC#0045 (Stack Management)
Includes state_reason in Stack Validation Error and Warning

Signed-off-by: Rashed Kamal <rashed.kamal@broadcom.com>
Signed-off-by: Rashed Kamal <rashed.kamal@broadcom.com>
Signed-off-by: Rashed Kamal <rashed.kamal@broadcom.com>
Signed-off-by: Rashed Kamal <rashed.kamal@broadcom.com>
Signed-off-by: Rashed Kamal <rashed.kamal@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants