-
Notifications
You must be signed in to change notification settings - Fork 898
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
Name service during provisioning from dialog input #16338
Name service during provisioning from dialog input #16338
Conversation
@mkanoor @tinaafitz Does it make sense to add the ManageIQ/Service/Provisioning/StateMachines/Methods/catalogiteminitialization.rb |
8dadda5
to
7116981
Compare
7116981
to
2cc76dd
Compare
2cc76dd
to
89c9982
Compare
Checked commits gmcculloug/manageiq@b7fbdad~...89c9982 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
@mkanoor @tinaafitz PTAL. Added commit for setting service description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug Looks good.
@mkanoor Any thoughts on this approach? |
end | ||
|
||
def dialog_service_name(value) | ||
self.name = value if value.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug
Should we allow for designers to append a date_time to the service using something like
My_Service_%{date_time}
And we would put the current date_time in the name field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the designer could leave the field as readonly so the end user ordering it doesn't have to set the service name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users can do this today through automate, I would rather not introduce it here yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug
From a usability perspective the service names are all going to be same out of the box. If the user provisions the same service multiple times they would all have the same name. And for services that don't use automate they won't have a way to discern one from the other.
I am not disagreeing with that, but it is a slightly different use case and I would suggest that it is functionality we discuss/address in a different PR. Here I am just adding logic to the backend to allow a user to change the name or description of the service from the dialog when ordering. The scenario you are discussing is when the user cannot or does not change them. While it might impact the same area of code I think we can design and implement that in a separate PR. We would want to understand what common substitutions to support as part of the name. And it seems a little more like custom logic which belongs in automate. Also, the service named and description can be changed from the UI by the user after creation as well. Even this change could be completely implemented in automate by adding logic to the generic service state machine, but we want to start moving some of the common logic to the backend. IMHO, appending the time_stamp to the service name should remain as an automate customization. For example: What format would My main question would be if you agree with this overall approach of this PR or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…oning Name service during provisioning from dialog input (cherry picked from commit 5faba90) https://bugzilla.redhat.com/show_bug.cgi?id=1511517
Fine backport details:
|
…oning Name service during provisioning from dialog input (cherry picked from commit 5faba90) https://bugzilla.redhat.com/show_bug.cgi?id=1511509
Gaprindashvili backport details:
|
…_provisioning Name service during provisioning from dialog input (cherry picked from commit 5faba90) https://bugzilla.redhat.com/show_bug.cgi?id=1511517
Services by default are named the same as the service_template they were created through at provisioning time (Service Ordering). This means that ordering the same service template multiple times leads to the same named service created for a user and it becomes difficult to tell them apart.
The ability to update the name during provisioning was added to the
CatalogItemInitialization
method in automate to address this issue. However, that logic, while the default for many service provisioning state-machines, is not used in ever case and the default state machine can be changed to one that does not callCatalogItemInitialization
.This change moves the service naming (and description) logic into the model at service creation time. The same service dialog naming conversion that
CatalogItemInitialization
uses is also used here.Things to note:
CatalogItemInitialization
that wants to rename the service will run after and therefore still be honored.CatalogItemInitialization
. For example,CatalogItemInitialization
will add a timestamp onto the service name if no override is given. That level of customization will be left to the automate method to provide, allowing users to easily change that functionality if desired.Links [Optional]
Steps for Testing/QA [Optional]
service_name
. (orservice_description
)CatalogItemInitialization
CatalogItemInitialization
method and comment out theoverride_service_name
andoverride_service_description
methods.cc @billfitzgerald0120