-
Notifications
You must be signed in to change notification settings - Fork 900
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
Unconditionally seed all standard reports and widgets #16062
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,7 +472,7 @@ def self.sync_from_hash(attrs) | |
|
||
widget = find_by(:description => attrs["description"]) | ||
if widget | ||
if filename && widget.updated_at.utc < File.mtime(filename).utc | ||
if filename | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. I don't think this will break anything but it's been a while since I looked at how we query reports and widgets to know if we ever sort by updated_on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like list of widget sorted alphabetically and not changing between server reboots |
||
$log.info("Widget: [#{widget.description}] file has been updated on disk, synchronizing with model") | ||
["enabled", "visibility"].each { |a| attrs.delete(a) } # Don't updates these because they may have been modofoed by the end user. | ||
widget.updated_at = Time.now.utc | ||
|
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.
Ok, so I'm fine with these changes but I don't know if anything will be changed when we're constantly touching the report objects. For example, do we have report definitions sorted in the UI by updated on?
I don't think so but it might be worth running this through several server boots and verifying the report pages show the reports in the same order in some screens.
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.
sorting does changes slightly between server reboots
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.
@yrudman How is the sorting changing? Can you tell f that is a result of this change?
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.
i think changing sorting is result of change, since before change reports record on DB was not touched.
Note: there is different sorting on left part (in tree) and on right part (in table)
before: (on master):
after (on this branch):
reboot 1 (red marks difference between rebootes):
reboot 2)
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.
@yrudman can you find how they're sorting these?
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.
@jrafanie I think there is no explicit sorting, also it does look inconsistent now when on the same screen there are same lists side by side, and those list have different order.
I think it make sense to sort those list of reports in the same way alphabetically.
Are you thinking of changing sorting in this PR ?
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.
I am still debugging to find-out how exactly sorting done on UI side. At this point I can say how right side sorted - it is sorted by yaml file name (
SELECT "miq_reports".* FROM "miq_reports" ORDER BY "miq_reports"."rpt_type" ASC, "miq_reports"."filename" ASC, "miq_reports"."name" ASC
) and report with filename005_VMs with Free Space _ 50% by Department
will be first (which is shown in right side of screenshots.It looks like the left side in report tree formed by using this SQL:
SELECT "miq_reports".* FROM "miq_reports" WHERE "miq_reports"."name" IN ('VMs with Free Space > 50% by Department', 'VMs w/Free Space > 75% by Function', 'VMs w/Free Space > 75% by LOB', 'VM Disk Usage', 'Hardware Information for VMs', 'Vendor and Type', 'Vendor and Guest OS', 'VM Location and Size', 'VM UUIDs', 'VMs with no UUID', 'VMs with Volume Free Space <= 20%', 'VMs with Volume Free Space >= 80%', 'VMs by MAC Address', 'Unregistered VMs', 'Orphaned VMs', 'VMs Snapshot Summary', 'User Accounts - Windows', 'User Accounts - Linux', 'Account Groups - Windows', 'Account Groups - Linux', 'Guest OS Information - any OS', 'Guest OS Information - Windows', 'Guest OS Information - Linux', 'Guest OS Password Information - Windows', 'Guest OS HKLM Registry Information')
and this SQL do not have any explicit sorting. I did not find (yet) any sorting on UI side
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.
@yrudman Can you confirm the order of these reports change on master without your changes? Based on your findings of the sql queries, I'd guess this would happen without your changes.
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.
not sure, i've tried couple time and master still the same. I think the order without explicit ordering is not guaranteed, but since data was not changed with reboot it is the same, will try more on master ...
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.
@jrafanie I was wrong in above comment - sorting slightly changing on master too