Bug 1743535
| Summary: | Incorrect timezone shown in the Data View of a saved report | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Parthvi Vala <pvala> | ||||||
| Component: | Reporting | Assignee: | drew uhlmann <duhlmann> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Parthvi Vala <pvala> | ||||||
| Severity: | high | Docs Contact: | Red Hat CloudForms Documentation <cloudforms-docs> | ||||||
| Priority: | medium | ||||||||
| Version: | 5.11.0 | CC: | dmetzger, obarenbo, simaishi, yrudman | ||||||
| Target Milestone: | GA | Keywords: | Reopened, ZStream | ||||||
| Target Release: | 5.11.5 | Flags: | pm-rhel:
cfme-5.11.z+
mfeifer: mirror+ |
||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | 5.11.5.0 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | |||||||||
| : | 1761516 (view as bug list) | Environment: | |||||||
| Last Closed: | 2020-05-05 13:43:09 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | Bug | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | CFME Core | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | |||||||||
| Bug Blocks: | 1761516 | ||||||||
| Attachments: |
|
||||||||
|
Description
Parthvi Vala
2019-08-20 08:05:55 UTC
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. 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 |