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] Guide users to the new CSV export type #102833

Closed
wants to merge 0 commits into from

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Jun 21, 2021

Summary

Closes #100363

This change "nags" users to change a POST URL that was created in an older version of Kibana, by allowing an export to set a new field: payload.isDeprecated. This triggers logging and the UI to notify the user that the export type will not be supported in 8.0.

  • Log warnings in the Kibana server logs when an export_types/csv job is created.
  • Add a tooltip to the Reporting Management UI to notify users about reports that were created using legacy job params
  • Use the deprecation service to alert admins before upgrading to 8.0 if they have existing CSV reports that were created using legacy job params.

Release notes

For CSV reports, using a POST URL copied from an older version of Kibana will result in a warning. A POST URL copied in Kibana 7.12 or lower will not be supported in 8.0. The POST URL should be regenerated in the latest version of Kibana for automation to continue seamlessly.

How to test

Testing requires copying a POST URL for CSV Export in Kibana 7.12, upgrading the instance to 7.x with this code change, and then send a POST request to the URL. Since the POST URL references a deprecated export type (/generate/csv), a warning gets logged in the Kibana server, and the job gets a warning treatment in the Reporting UI at Stack Management > Reporting.

Steps to set up a POST URL of the deprecated export type and send it to a 7.x Kibana instance with these changes:

  1. Set up 7.12 and add some data:
    cd ~/elastic/kibana7
    git checkout 7.12
    git pull elastic 7.12
    nvm use $(cat .node-version)
    yarn kbn clean ; yarn kbn bootstrap
    yarn es snapshot -E path.data=../version_7_12_backup
    yarn start --no-base-path
  2. Install sample data, add a saved search, copy the POST URL to export the CSV from Discover
  3. Create a shell script that generates the CSV using the POST URL: generate_deprecated_csv.sh
    #!/bin/sh
    curl -u my_reporting_user -H 'kbn-version: ${KIBANA_VERSION}' -XPOST "<paste the POST URL>"
  4. Test that the script successfully queues the job, and doesn't show a warning in the UI.
    KIBANA_VERSION=7.12.2 sh generate_deprecated_csv.sh
  5. Stop Kibana and Elasticsearch
  6. Switch to a branch of 7.x that has these code changes backported
  7. Run the latest code and Elasticsearch with the backed up data
    git checkout 7.x
    git pull elastic 7.x
    nvm use $(cat .node-version)
    git cherry-pick "<get a squashed commit hash containing these code changes>"
    yarn kbn clean ; yarn kbn bootstrap
    yarn es snapshot -E path.data=../version_7_12_backup
    yarn start --no-base-path
  8. Test that the deprecated POST URL script successfully queues the job, and shows warnings in the Kibana UI
    KIBANA_VERSION=7.14.0 sh generate_deprecated_csv.sh

Checklist

@tsullivan tsullivan force-pushed the reporting/csv-100363 branch 6 times, most recently from 51f3ee3 to 4f1cf41 Compare June 24, 2021 20:24
@tsullivan tsullivan force-pushed the reporting/csv-100363 branch 2 times, most recently from a513993 to 8cfc9a9 Compare June 28, 2021 22:13
@tsullivan tsullivan force-pushed the reporting/csv-100363 branch 8 times, most recently from 135d002 to d61d2af Compare June 29, 2021 18:10
@spalger spalger added v7.15.0 and removed v7.14.0 labels Jun 30, 2021
@tsullivan tsullivan force-pushed the reporting/csv-100363 branch from d61d2af to 60dac27 Compare June 30, 2021 20:14
@tsullivan tsullivan force-pushed the reporting/csv-100363 branch 3 times, most recently from 6c10330 to da723a0 Compare July 2, 2021 00:27
@tsullivan tsullivan force-pushed the reporting/csv-100363 branch 7 times, most recently from b248b5c to 85e0793 Compare July 7, 2021 21:20
@tsullivan tsullivan force-pushed the reporting/csv-100363 branch 10 times, most recently from a2a2250 to 980ac90 Compare July 13, 2021 19:00
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
reporting 59 60 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
reporting 69.9KB 69.7KB -171.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
reporting 18 14 -4

Page load bundle

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

id before after diff
reporting 56.5KB 58.6KB +2.1KB

History

  • 💔 Build #137718 failed a2a22504b0a8870db9fcd85b58bddbc2f93f98e4
  • 💚 Build #137065 succeeded 85e0793c0bd96e43e6293979ffa63dd8f0ebdd70
  • 💚 Build #137047 succeeded 542ff4c419d8417f03aef3c663407ae668b2aebb
  • 💔 Build #136700 failed 2e76a568593531ec7a32540857c32d0b4c2f28b2
  • 💔 Build #136652 failed 060275db28534793f0f3697420e8f84c539446a5

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

@tsullivan
Copy link
Member Author

Replaced with #106184

@sophiec20 sophiec20 added the (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead enhancement New value added to drive a business result release_note:enhancement v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Reporting] Add guidance to users on the new CSV export type
4 participants