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

[Reporting] Make CSV authentication failure a warning #126358

Merged

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Feb 24, 2022

Summary

Partially addresses #125139

When generating a CSV we want to give users the ability to download the data that we were able to export before hitting the auth error.

Additionally, this PR adds a new "warning" notification so that reports that complete with warnings are shown as such by the notification.

Screenshots

Screenshot 2022-02-24 at 13 48 58

Screenshot 2022-02-24 at 14 18 31

Screenshot 2022-02-24 at 15 33 17

Checklist

@jloleysens jloleysens added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead release_note:skip Skip the PR/issue when compiling release notes Team:Reporting Services v8.2.0 labels Feb 24, 2022
@jloleysens jloleysens requested review from a team as code owners February 24, 2022 16:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesUx)


import { i18n } from '@kbn/i18n';

export const i18nTexts = {
Copy link
Member

Choose a reason for hiding this comment

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

This is very good clean-up! 👍

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

This looks great! But I think we should leave out the noResultsMessage

throw new AuthenticationExpiredError();
reportingError = new AuthenticationExpiredError();
warnings.push(
totalRecords > 0 ? i18nTexts.partialResultsMessage : i18nTexts.noResultsMessage
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we need to have an extra message to state there were no results due to the authentication error. The partialResultsMessage seems suitable to me for both cases. It risks us showing some false positives, since there could be other explanations for the CSV not having any results.

Copy link
Contributor Author

@jloleysens jloleysens Feb 28, 2022

Choose a reason for hiding this comment

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

I gave this more thought, the primary issue for me is that if a user downloads a CSV that we say has partial results but then contains no results it could create some confusion.

However, this will only ever occur when a user sends a report request that either contains an expired auth header (unlikely) or that expires before it gets back the first set of results (also unlikely, there is probably something bigger wrong).

Happy to remove the extra i18n for now.

@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@jloleysens
Copy link
Contributor Author

@tsullivan , I think I've addressed your feedback. Would you mind taking another look?

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
reporting 83 84 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
reporting 38.4KB 39.1KB +747.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

@gchaps gchaps added the ui-copy Review of UI copy with docs team is recommended label Feb 28, 2022
Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

With help from @tsullivan, here are some suggestions:

Report contains errors
This report contains partial CSV results because the authentication token expired. Export a smaller amount of data or increase the timeout of the authentication token.

CSV completed with issues
Download the report now, or go to Stack Management > Reporting for more on the issues.

Notes:

  • Removed the "This report completed with issues" because it repeats the title
  • Removed "Analytics and Insights" because it is not clickable in the UI.
  • Other suggestions:
    • Download the report now, or go to Stack Management > Reporting for details.

@jloleysens jloleysens merged commit 3285eb1 into elastic:main Mar 1, 2022
@jloleysens jloleysens deleted the reporting/csv-auth-failure-warning branch March 1, 2022 08:20
@jloleysens
Copy link
Contributor Author

🤦🏼‍♂️ i'm sorry, I accidentally merged this. I'll open up a follow up PR for the copy updates!

@jloleysens jloleysens added the backport:skip This commit does not require backporting label Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead release_note:skip Skip the PR/issue when compiling release notes ui-copy Review of UI copy with docs team is recommended v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants