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

Fix bug on null description #162106

Merged
merged 2 commits into from
Jul 18, 2023
Merged

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Jul 18, 2023

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:

  • 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 #162069

image

@stratoula stratoula added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens v8.9.0 v8.10.0 labels Jul 18, 2023
@stratoula stratoula marked this pull request as ready for review July 18, 2023 08:27
@stratoula stratoula requested a review from a team as a code owner July 18, 2023 08:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Code review only 👍

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

@stratoula stratoula merged commit 2e1d36a into elastic:main Jul 18, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 18, 2023
## 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 18, 2023
# 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]>
nreese added a commit that referenced this pull request Jul 18, 2023
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]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 18, 2023
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)
kibanamachine added a commit that referenced this pull request Jul 18, 2023
)

# 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]>
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
## 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">
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.9.0 v8.10.0
Projects
None yet
5 participants