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

Change ems refresh task complete messaging #22776

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Nov 6, 2023

taken from:

Instead of displaying target information, this now displays a user friendly message in the ui

This was marked as stale and I liked the change by @galoiring so I put this together

Before

a93b3af1-f7cb-4a64-ad4d-3b5b87161e8c

After

Screenshot 2023-04-18 at 15 43 35

@@ -17,7 +17,7 @@ def self.debug_trace
cache_with_timeout(:queue_timeout) { MiqEmsRefreshWorker.worker_settings[:queue_timeout] || 60.minutes }

def self.queue_refresh_task(target, id = nil)
queue_refresh(target, id, :create_task => true)
queue_refresh(target, id, :create_task => true, :action => "EmsRefresh completed successfully")
Copy link
Member

Choose a reason for hiding this comment

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

@kbrock will this say "EmsRefresh completed successfully" while it is still running? If it failed?
Would :action => "Refreshing relationships and power states" or something like that make more sense? Maybe I'm missing when/where the :action attribute is displayed

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, don't know when task action is displayed, @Fryguy ?

@agrare
Copy link
Member

agrare commented Nov 7, 2023

So with this change I'm still seeing the target information in the task list
image

@kbrock
Copy link
Member Author

kbrock commented Nov 7, 2023

The issue should probably be fixed in https://github.com/ManageIQ/manageiq/blob/master/app/models/ems_refresh.rb#L173

For one, we could remove listing the target if the target is an ems.
Wonder if we want the target listed if there are more than 1

@kbrock kbrock requested a review from Fryguy as a code owner November 7, 2023 21:25
task_options = {
:action => "EmsRefresh(#{ems.name}) [#{targets}]".truncate(255),
:action => "EmsRefresh(#{ems.name})#{targets.present? ? " #{targets.count} #{targets.first.first.to_s.split(':').last}" : ""}",
Copy link
Member

Choose a reason for hiding this comment

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

targets.first.first.to_s.split(':').last

I think this is an indication that we're on the wrong track :/

Copy link
Member Author

Choose a reason for hiding this comment

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

  target_class = targets.first&.first&.demodulize # first, class, simplified
  task_options = {
      :action => "EmsRefresh(#{ems.name})#{targets.present? ? " #{targets.count} #{target_class}" : ""}",

Copy link
Member Author

Choose a reason for hiding this comment

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

I had also wanted to remove the target if the targets were the ems, but for some reason the code got too complicated and thought this was good enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think the message needs to list every VM that is being refreshed.
The customer won't know the VM id.
Maybe just "Manual Refresh" is good enough without the particular id?

Copy link
Member

Choose a reason for hiding this comment

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

I still think "Refreshing relationships and power states" or whatever the exact wording we use on the UI is fine

taken from:
- ManageIQ#22465
- ManageIQ/manageiq-providers-autosde#228

Instead of displaying target information, this now displays a quick user friendly summary
@miq-bot
Copy link
Member

miq-bot commented Nov 14, 2023

Checked commit kbrock@90fb062 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@agrare agrare merged commit 78eb352 into ManageIQ:master Nov 14, 2023
6 checks passed
@kbrock kbrock deleted the refresh_task_messaging branch November 15, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants