Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retired to service active states #18348

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/service_retire_request.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class ServiceRetireRequest < MiqRetireRequest
TASK_DESCRIPTION = 'Service Retire'.freeze
SOURCE_CLASS_NAME = 'Service'.freeze
ACTIVE_STATES = %w(retired) + base_class::ACTIVE_STATES
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but "retired" doesn't sound like an active state, a better name for the validation to use might be VALID_STATES.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, I told her about this yesterday.

Copy link
Member

Choose a reason for hiding this comment

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

@d-m-u @bdunne I know it looks odd, and we can rename it in the future, but retired is an active state.
Reconfigured and migrated are active states as well.

Most of our lifecycle state machines have multiple states for each of 3 phases:

  1. Pre-processing
  2. Execution/Check Execution <---- the state would be provisioned/retired/reconfigured/migrated here
  3. Post-processing <----- It still has to process these states before it can be finished.
    The state is "finished" at the end of the state machine.


delegate :service_template, :to => :source, :allow_nil => true
end