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

[Bug]Support for date range in report generation #524

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sumukhswamy
Copy link
Contributor

@sumukhswamy sumukhswamy commented Feb 5, 2025

Description

While generating reports the time picker which shows the time from and time to is not working
image
image
it auto selects the range as 'Now' and the duration specified, This happens to the edit functionality of the reports as well.

Fix after
https://github.com/user-attachments/assets/401ec030-7b92-4647-89e9-d77f240377e3

Issues Resolved

#414

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.20%. Comparing base (2d0e662) to head (b06b511).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #524   +/-   ##
=======================================
  Coverage   71.19%   71.20%           
=======================================
  Files          31       31           
  Lines        2052     2066   +14     
  Branches      454      460    +6     
=======================================
+ Hits         1461     1471   +10     
- Misses        585      589    +4     
  Partials        6        6           
Flag Coverage Δ
dashboards-report 71.20% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: sumukhswamy <[email protected]>
Signed-off-by: sumukhswamy <[email protected]>
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

what's the behavior for reports created before this PR?

timeFrom: Date;
timeTo: Date;
}

export function CreateReport(props: { [x: string]: any; setBreadcrumbs?: any; httpClient?: any; chrome: any }) {
export function CreateReport(props: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, i know this naming is not from this PR. but use createReport? And is it possible to start adding types for these any?

setShowTimeRangeError(true);
error = true;
}
else{
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting?

…nition.tsx

Co-authored-by: Joshua Li <[email protected]>
Signed-off-by: Sumukh Swamy <[email protected]>
@sumukhswamy
Copy link
Contributor Author

what's the behavior for reports created before this PR?

the reports being created always took the time diff as the current time minus the duration so the backend parameters just have now-duration for beginTime and endTime

@joshuali925
Copy link
Member

the reports being created always took the time diff as the current time minus the duration so the backend parameters just have now-duration for beginTime and endTime

But i see the other PR removed now-duration logic https://github.com/opensearch-project/reporting/pull/1069/files/b1fd6e69223c3af06581943346bbc1ff75094e07#r1949710370, or is it somewhere else?

@sumukhswamy
Copy link
Contributor Author

the reports being created always took the time diff as the current time minus the duration so the backend parameters just have now-duration for beginTime and endTime

But i see the other PR removed now-duration logic https://github.com/opensearch-project/reporting/pull/1069/files/b1fd6e69223c3af06581943346bbc1ff75094e07#r1949710370, or is it somewhere else?

yes that is correct I removed the logic for duration, I can add it back for older reports support

Signed-off-by: sumukhswamy <[email protected]>
@sumukhswamy
Copy link
Contributor Author

Have updated the backend PR to work for the older params and new ones as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants