Created attachment 1606012 [details] Bug Demo Description of problem: Timezone shown in the data view of a saved report is incorrect. Version-Release number of selected component (if applicable): 5.11.0.19 How reproducible: Always Steps to Reproduce: 1. Navigate to My Settings and change the timezone to something other than UTC 2. Create a report based on `VMs and Instances`, and fields - name, boot time 3. Queue the report 4. Observe the timezone in the report data 5. Navigate to the data view of the queued report and observe the timezone in the report data. Actual results: 1. 2. 3. 4. Timezone will be as set in step 1. 5. Timezone is set to UTC. Expected results: 1. 2. 3. 4. 5. Timezone must be the same as set in step 1. Additional info: Related BZ - https://bugzilla.redhat.com/show_bug.cgi?id=1599849
Already generated reports should not changed timezone, It is working as designed.
Hi Yuri, I think you've misunderstood. I first changed the timezone and then queued/generated the report. In that case, it should definitely show the changed timezone. I can see the expected timezone in the queued report in normal view, but not when I switch the view to Data view. I think that is a bug. Let me know what you think. Thanks, Parthvi
Created attachment 1611194 [details] imezones
I was testing on latest code from master - attached timezone.mov: There are 3 reports generated for user with different timezones: JST, HST, UTC. Current timezone is JST (as shown on tree view) Default timezone (saved in report) correctly displayed when report is loading. Applying filter is changing report's view to show current timezone instead of saved. It all looks fine to me
def format_row(row, allowed_columns = nil, expand_value_format = nil) @tz ||= get_time_zone(Time.zone) $log.info("XXX with #{@tz.inspect}") row.map do |key, _| value = allowed_columns.nil? || allowed_columns&.include?(key) ? format_column(key, row, @tz, col_format_hash[key]) : row[key] [key, expand_value_format.present? ? { :value => value, :style_class => get_style_class(key, row, @tz) } : value] end.to_h end https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_report.rb#L286 That's returning UTC after having been set to a different time in the settings.
Hey Parthvi, could you take another look at that appliance and let me know if the code that's currently running on it is more in line with how this should be working, please?
Um, it is on the lines of it, but not exactly. I changed the timezone and generated the report again, it didn't show current timezone in the data view, but the last timezone(MDT) that was set.
https://github.com/ManageIQ/manageiq/pull/19285
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/03dc3ff4ddd516ff06891bbca9c3bc9fa6a774f0 commit 03dc3ff4ddd516ff06891bbca9c3bc9fa6a774f0 Author: d-m-u <drewuhlmann> AuthorDate: Wed Sep 11 08:32:45 2019 -0400 Commit: d-m-u <drewuhlmann> CommitDate: Wed Sep 11 08:32:45 2019 -0400 Use the user timezone rather than the report timezone for display Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1743535 app/models/miq_report.rb | 6 +- spec/models/miq_report_spec.rb | 28 + 2 files changed, 31 insertions(+), 3 deletions(-)
New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/f5ec1bf7d2a356ab0a56864cb3187031d4716cba commit f5ec1bf7d2a356ab0a56864cb3187031d4716cba Author: Gregg Tanzillo <gtanzill> AuthorDate: Mon Sep 16 16:31:37 2019 +0000 Commit: Gregg Tanzillo <gtanzill> CommitDate: Mon Sep 16 16:31:37 2019 +0000 Merge pull request #19285 from d-m-u/fixing_timezone_on_reports Check for user timezone on report first for display formatting (cherry picked from commit ec4833e22465fd2555ec9e44f8e4550f22dba729) https://bugzilla.redhat.com/show_bug.cgi?id=1743535 app/models/miq_report.rb | 6 +- spec/models/miq_report_spec.rb | 28 + 2 files changed, 31 insertions(+), 3 deletions(-)
FIXED. Verified on 5.11.5.1.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2020