-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix bug on null description #162106
Fix bug on null description #162106
Conversation
Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review only 👍
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: |
## Summary Closes elastic#162069 Fixes the validation error on the content management service if the description is set to null. I am not sure how the description can be set to null. If I create a Lens so in 7.17 and I don't set the description then it is automatically set to '' (empty string) I can think of 2 ways: - It was possible in older kibana versions - Someone changed the SO manually and set this to null This change fixes it with allowing the schema to also set nullable values. Note: Maybe covers the undefined case. To test it just import the SO given by Bhavya here elastic#162069 <img width="2496" alt="image" src="https://github.com/elastic/kibana/assets/17003240/481ef105-2efb-47c0-9d06-94f7fddbf703"> (cherry picked from commit 2e1d36a)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.9`: - [Fix bug on null description (#162106)](#162106) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Stratoula Kalafateli","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-07-18T09:08:34Z","message":"Fix bug on null description (#162106)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/162069\r\n\r\nFixes the validation error on the content management service if the\r\ndescription is set to null.\r\n\r\nI am not sure how the description can be set to null. If I create a Lens\r\nso in 7.17 and I don't set the description then it is automatically set\r\nto '' (empty string)\r\n\r\nI can think of 2 ways:\r\n- It was possible in older kibana versions\r\n- Someone changed the SO manually and set this to null\r\n\r\nThis change fixes it with allowing the schema to also set nullable\r\nvalues.\r\n\r\nNote: Maybe covers the undefined case.\r\n\r\nTo test it just import the SO given by Bhavya here\r\nhttps://github.com//issues/162069\r\n\r\n<img width=\"2496\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/481ef105-2efb-47c0-9d06-94f7fddbf703\">","sha":"2e1d36a10a0f718a59672b21858c430648831322","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","backport:prev-minor","v8.9.0","v8.10.0"],"number":162106,"url":"https://github.com/elastic/kibana/pull/162106","mergeCommit":{"message":"Fix bug on null description (#162106)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/162069\r\n\r\nFixes the validation error on the content management service if the\r\ndescription is set to null.\r\n\r\nI am not sure how the description can be set to null. If I create a Lens\r\nso in 7.17 and I don't set the description then it is automatically set\r\nto '' (empty string)\r\n\r\nI can think of 2 ways:\r\n- It was possible in older kibana versions\r\n- Someone changed the SO manually and set this to null\r\n\r\nThis change fixes it with allowing the schema to also set nullable\r\nvalues.\r\n\r\nNote: Maybe covers the undefined case.\r\n\r\nTo test it just import the SO given by Bhavya here\r\nhttps://github.com//issues/162069\r\n\r\n<img width=\"2496\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/481ef105-2efb-47c0-9d06-94f7fddbf703\">","sha":"2e1d36a10a0f718a59672b21858c430648831322"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162106","number":162106,"mergeCommit":{"message":"Fix bug on null description (#162106)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/162069\r\n\r\nFixes the validation error on the content management service if the\r\ndescription is set to null.\r\n\r\nI am not sure how the description can be set to null. If I create a Lens\r\nso in 7.17 and I don't set the description then it is automatically set\r\nto '' (empty string)\r\n\r\nI can think of 2 ways:\r\n- It was possible in older kibana versions\r\n- Someone changed the SO manually and set this to null\r\n\r\nThis change fixes it with allowing the schema to also set nullable\r\nvalues.\r\n\r\nNote: Maybe covers the undefined case.\r\n\r\nTo test it just import the SO given by Bhavya here\r\nhttps://github.com//issues/162069\r\n\r\n<img width=\"2496\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/17003240/481ef105-2efb-47c0-9d06-94f7fddbf703\">","sha":"2e1d36a10a0f718a59672b21858c430648831322"}}]}] BACKPORT--> Co-authored-by: Stratoula Kalafateli <[email protected]>
Part of #162069 > This happens in maps too and possibly other SOs that have null description (not sure if it were ever possible to have null description in maps.) It seems from the SOs that Bhavya sent that it was possible for visualizations. With this schema change the bug if fixed #162106 > Not sure if it makes sense to also do it in maps. @nreese wdyt? Add support for null description in maps saved object to be consistent with visualize saved objects. ### test instructions 1) Install web logs sample data set 2) export map 3) manually change ndjson, changing `description:""` to `description:null` 4) reimport map saved object 5) verify map can be opened --------- Co-authored-by: Kibana Machine <[email protected]>
Part of elastic#162069 > This happens in maps too and possibly other SOs that have null description (not sure if it were ever possible to have null description in maps.) It seems from the SOs that Bhavya sent that it was possible for visualizations. With this schema change the bug if fixed elastic#162106 > Not sure if it makes sense to also do it in maps. @nreese wdyt? Add support for null description in maps saved object to be consistent with visualize saved objects. ### test instructions 1) Install web logs sample data set 2) export map 3) manually change ndjson, changing `description:""` to `description:null` 4) reimport map saved object 5) verify map can be opened --------- Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit b222f7a)
) # Backport This will backport the following commits from `main` to `8.9`: - [[maps] support null description in saved object (#162145)](#162145) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-07-18T17:10:11Z","message":"[maps] support null description in saved object (#162145)\n\nPart of https://github.com/elastic/kibana/issues/162069\r\n\r\n> This happens in maps too and possibly other SOs that have null\r\ndescription (not sure if it were ever possible to have null description\r\nin maps.) It seems from the SOs that Bhavya sent that it was possible\r\nfor visualizations. With this schema change the bug if fixed\r\nhttps://github.com//pull/162106\r\n\r\n> Not sure if it makes sense to also do it in maps. @nreese wdyt?\r\n\r\nAdd support for null description in maps saved object to be consistent\r\nwith visualize saved objects.\r\n\r\n### test instructions\r\n1) Install web logs sample data set\r\n2) export map\r\n3) manually change ndjson, changing `description:\"\"` to\r\n`description:null`\r\n4) reimport map saved object\r\n5) verify map can be opened\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b222f7a7d1d8a9e994a4f8293a56afa0b363c645","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","Feature:Maps","v8.10.0","v8.9.1"],"number":162145,"url":"https://github.com/elastic/kibana/pull/162145","mergeCommit":{"message":"[maps] support null description in saved object (#162145)\n\nPart of https://github.com/elastic/kibana/issues/162069\r\n\r\n> This happens in maps too and possibly other SOs that have null\r\ndescription (not sure if it were ever possible to have null description\r\nin maps.) It seems from the SOs that Bhavya sent that it was possible\r\nfor visualizations. With this schema change the bug if fixed\r\nhttps://github.com//pull/162106\r\n\r\n> Not sure if it makes sense to also do it in maps. @nreese wdyt?\r\n\r\nAdd support for null description in maps saved object to be consistent\r\nwith visualize saved objects.\r\n\r\n### test instructions\r\n1) Install web logs sample data set\r\n2) export map\r\n3) manually change ndjson, changing `description:\"\"` to\r\n`description:null`\r\n4) reimport map saved object\r\n5) verify map can be opened\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b222f7a7d1d8a9e994a4f8293a56afa0b363c645"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162145","number":162145,"mergeCommit":{"message":"[maps] support null description in saved object (#162145)\n\nPart of https://github.com/elastic/kibana/issues/162069\r\n\r\n> This happens in maps too and possibly other SOs that have null\r\ndescription (not sure if it were ever possible to have null description\r\nin maps.) It seems from the SOs that Bhavya sent that it was possible\r\nfor visualizations. With this schema change the bug if fixed\r\nhttps://github.com//pull/162106\r\n\r\n> Not sure if it makes sense to also do it in maps. @nreese wdyt?\r\n\r\nAdd support for null description in maps saved object to be consistent\r\nwith visualize saved objects.\r\n\r\n### test instructions\r\n1) Install web logs sample data set\r\n2) export map\r\n3) manually change ndjson, changing `description:\"\"` to\r\n`description:null`\r\n4) reimport map saved object\r\n5) verify map can be opened\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b222f7a7d1d8a9e994a4f8293a56afa0b363c645"}},{"branch":"8.9","label":"v8.9.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <[email protected]>
## Summary Closes elastic#162069 Fixes the validation error on the content management service if the description is set to null. I am not sure how the description can be set to null. If I create a Lens so in 7.17 and I don't set the description then it is automatically set to '' (empty string) I can think of 2 ways: - It was possible in older kibana versions - Someone changed the SO manually and set this to null This change fixes it with allowing the schema to also set nullable values. Note: Maybe covers the undefined case. To test it just import the SO given by Bhavya here elastic#162069 <img width="2496" alt="image" src="https://github.com/elastic/kibana/assets/17003240/481ef105-2efb-47c0-9d06-94f7fddbf703">
Part of elastic#162069 > This happens in maps too and possibly other SOs that have null description (not sure if it were ever possible to have null description in maps.) It seems from the SOs that Bhavya sent that it was possible for visualizations. With this schema change the bug if fixed elastic#162106 > Not sure if it makes sense to also do it in maps. @nreese wdyt? Add support for null description in maps saved object to be consistent with visualize saved objects. ### test instructions 1) Install web logs sample data set 2) export map 3) manually change ndjson, changing `description:""` to `description:null` 4) reimport map saved object 5) verify map can be opened --------- Co-authored-by: Kibana Machine <[email protected]>
Summary
Closes #162069
Fixes the validation error on the content management service if the description is set to null.
I am not sure how the description can be set to null. If I create a Lens so in 7.17 and I don't set the description then it is automatically set to '' (empty string)
I can think of 2 ways:
This change fixes it with allowing the schema to also set nullable values.
Note: Maybe covers the undefined case.
To test it just import the SO given by Bhavya here #162069