-
Notifications
You must be signed in to change notification settings - Fork 897
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
Unconditionally seed all standard reports and widgets #16062
Conversation
this also fixes case from BZ, which was not reproduced => BZ Closed. (not need to reopen) but in the end we found how to reproduce it (example):
but report yml file system is created
so it will not update the report and will cause problem with changed name of report (between 5.8.1 and 5.8.0) not sure if this can happen in production. thanks @yrudman |
@miq-bot add-label bug, reporting, fine/yes |
@yrudman Cannot apply the following label because they are not recognized: cloud intel/reporting |
…r patch on new version could be older that build date of older version, and skipping file based on timestamp will lead to keeping records from old version https://bugzilla.redhat.com/show_bug.cgi?id=1494819
… may lead to keep recotrds from older version (when timestamp on yaml file from older version is more resent) https://bugzilla.redhat.com/show_bug.cgi?id=1494819
144c110
to
ce79a8a
Compare
Checked commits yrudman/manageiq@0b7e075~...ce79a8a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
if rec.filename && (rec.file_mtime.nil? || rec.file_mtime.utc < rpt[:file_mtime]) | ||
_log.info("#{typ.titleize}: [#{rec.name}] file has been updated on disk, synchronizing with model") | ||
if rec.filename | ||
_log.info("#{typ.titleize}: [#{rec.name}] file exists, synchronizing with model") |
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.
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 filename 005_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
@@ -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 comment
The 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 comment
The 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
@gtanzillo @jrafanie created issue about not consistent sorting of reports: #16083 |
Unconditionally seed all standard reports and widgets (cherry picked from commit 9653a69) https://bugzilla.redhat.com/show_bug.cgi?id=1497817
Fine backport details:
|
…-name Unconditionally seed all standard reports and widgets (cherry picked from commit 9653a69) https://bugzilla.redhat.com/show_bug.cgi?id=1497817
Before: seeding process did not update record in
miq_report
table if timestamp of yaml file inproducts/...
directory older than inmiq_report
. (assumption was: newer file are always from later version).Issue: files in cfme
build 5.7.4.0
have newer date than inbuild 5.8.1.5
and report modified in 5.8.1.5 (in #14646) was not seeded when upgrading from 5.7.4.0 to 5.8.1.5https://bugzilla.redhat.com/show_bug.cgi?id=1494819
After: Unconditionally seed all standard reports
\cc @gtanzillo