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] Add warning logs about CSV export type being deprecated #104025

Merged

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Jun 30, 2021

Summary

Needed for: #102833

Users may have set up automated CSV reports in Kibana 7.12 or below, which is before the export type was replaced (csv_searchsource) in 7.13. To help the user be aware of an upcoming breaking change, this PR logs a warning to ask the user to re generates the POST URL string that is needed for the automation.

A new flag can be added to the payload object of the stored job parameters, isDeprecated. This flag exists for testability right now. Later, this flag will be used in the Management UI to highlight the reports that were created with a deprecated export type.

How to test

See the "How to test" section at #102833

Checklist

For maintainers

Release note

Added warning logging in Kibana Reporting to inform that a deprecated export type is used, and that report automation needs to be updated for future compatibility.

@@ -87,6 +87,7 @@ export function jobsQueryFactory(reportingCore: ReportingCore) {
elasticsearchClient.search({ body, index: getIndex() })
);

// FIXME: return the info in ReportApiJSON format;
Copy link
Member Author

@tsullivan tsullivan Jun 30, 2021

Choose a reason for hiding this comment

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

One thing became clear from updating the API functional tests, the data formats of the Reporting endpoints are inconsistent.

  • "generate" API: returns ReportApiJSON
  • "list" API: returns ReportDocument[]
  • "info" API: returns ReportSource

To make it consistent, all the APIs should return ReportApiJSON format.

The comments are added to this file, which is responsible for handling API requests that query jobs.

Copy link
Member Author

Choose a reason for hiding this comment

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

All of the FIXMEs are being handled in the next PR: #102833

@tsullivan tsullivan marked this pull request as ready for review July 1, 2021 01:47
@tsullivan tsullivan added release_note:skip Skip the PR/issue when compiling release notes Team:AppServices (Deprecated) Team:Reporting Services Use Team:Global Experiance and Feature:Reporting instead. v7.15.0 v8.0.0 labels Jul 1, 2021
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@tsullivan tsullivan added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes labels Jul 1, 2021
@tsullivan tsullivan requested review from a team July 1, 2021 17:52
@jloleysens jloleysens self-requested a review July 5, 2021 09:22
Copy link
Contributor

@jloleysens jloleysens 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 @tsullivan !

I did not test this locally, but your functional test coverage looks very comprehensive.

Later, this flag will be used in the Management UI to highlight the reports that were created with a deprecated export type.

Do we have Jira ticket/GH issue for tracking this?

@@ -20,6 +20,9 @@ export const createJobFnFactory: CreateJobFnFactory<
const crypto = cryptoFactory(config.get('encryptionKey'));

return async function createJob(jobParams, context, request) {
logger.warn(
`The "/generate/csv" endpoint is deprecated and will be removed in Kibana 8.0. Please recreate the POST URL used to automate this CSV export.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: perhaps we could rephrase this as:

This CSV export is deprecated and will be removed in Kibana 8.0. Please recreate the POST URL to continue generating this CSV export. See <docs link with screenshots>.

My concern with the current version is that mentioning an endpoint /generate/csv is a bit too implementation-level detail. WDYT?

Additionally, I think we should wrap this in i18n.translate.

If we can link them to somewhere in the docs that would be A+, but this can definitely be addressed in a follow up PR if you agree!

@jloleysens
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@tsullivan tsullivan merged commit b794e7b into elastic:master Jul 6, 2021
tsullivan added a commit to tsullivan/kibana that referenced this pull request Jul 6, 2021
…lastic#104025)

* add deprecation logging to csv export type

* fix payload.isDeprecated

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
tsullivan added a commit that referenced this pull request Jul 6, 2021
…104025) (#104528)

* add deprecation logging to csv export type

* fix payload.isDeprecated

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
darnautov pushed a commit to darnautov/kibana that referenced this pull request Jul 7, 2021
…lastic#104025)

* add deprecation logging to csv export type

* fix payload.isDeprecated

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@tsullivan tsullivan deleted the reporting/csv_deprecations_logging branch August 3, 2021 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Team:Reporting Services Use Team:Global Experiance and Feature:Reporting instead. release_note:enhancement v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants