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

Respect days parameter when listing timeline events #4504

Merged
merged 1 commit into from
Aug 23, 2018

Conversation

tadeboro
Copy link
Contributor

Up until now, when the user requested hourly report (by selecting days selector in the UI), the code always returned only the events from the last day of selected interval.

This commit fixes this by unifying the time interval construction for all types of reports, getting rid of the buggy date construction in the process.

Fixes #4503

Up until now, when the user requested hourly report (by selecting days
selector in the UI), the code always returned only the events from the
last day of selected interval.

This commit fixes this by unifying the time interval construction for
all types of reports, getting rid of the buggy date construction in
the process.
@miq-bot
Copy link
Member

miq-bot commented Aug 21, 2018

Checked commit xlab-si@94c9796 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@tadeboro
Copy link
Contributor Author

@miq-bot add_reviewer @skateman

@miq-bot miq-bot requested a review from skateman August 21, 2018 09:23
@mzazrivec
Copy link
Contributor

@PanSpagetka Could you please look at the above change? Thanks.

@skateman
Copy link
Member

@miq-bot add_reviewer @PanSpagetka

@miq-bot miq-bot requested a review from PanSpagetka August 21, 2018 10:28
Copy link
Contributor

@PanSpagetka PanSpagetka left a comment

Choose a reason for hiding this comment

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

I know, that there are some issues in this area, but wasn't able to reproduce them. But I test it in UI and your code works and looks nicer.

@tadeboro
Copy link
Contributor Author

tadeboro commented Aug 23, 2018

@PanSpagetka To reproduce the issue, make sure "days" is active when selecting interval and select more than one day.

The actual code that is broken:

from_dt = create_time_in_utc("#{yy}-#{mm}-#{dd} 00:00:00", session[:user_tz]) # Get tz 12am in user's time zone
to_dt = create_time_in_utc("#{yy}-#{mm}-#{dd} 23:59:59", session[:user_tz]) # Get tz 11pm in user's time zone

As can be seen above, single-day interval is hard-coded into start and end date construction.

@tadeboro
Copy link
Contributor Author

Screenshots of parameter selection are available in the bug #4504 (last two screenshots).

@skateman
Copy link
Member

@PanSpagetka I verified that after the change the query is generated properly for the whole interval and not just for a single day.

@PanSpagetka
Copy link
Contributor

Yeah, now I have reproduced it, good job @tadeboro

@mzazrivec LGTM

@mzazrivec mzazrivec self-assigned this Aug 23, 2018
@mzazrivec mzazrivec added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 23, 2018
@mzazrivec mzazrivec merged commit b791068 into ManageIQ:master Aug 23, 2018
@tadeboro tadeboro deleted the fix-timeline-daily-report branch August 28, 2018 04:08
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.

Daily timeline report only list events for last day of selected interval
5 participants