-
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
[ML] Fixes incorrectly displayed error messages #159913
[ML] Fixes incorrectly displayed error messages #159913
Conversation
Pinging @elastic/ml-ui (:ml) |
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.
LGTM, thanks for catching this!
💚 Build Succeeded
Metrics [docs]Any counts in public APIs
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: |
PR elastic#155372 moved our error utils to a package and also made a few small code changes, one of which added `isPopulatedObject` to the error object type guards. `isPopulatedObject` uses `Object.keys` under the hood which cannot be used to access the non-enumerable properties of an object, like Error's `message`. ![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388) This PR reverts all of these functions back to their original versions which had existed in ML for a while without issue. This was change had been causing error messages to not display correctly. ![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956) vs ![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8) (cherry picked from commit 8ca1789)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#159923) # Backport This will backport the following commits from `main` to `8.8`: - [[ML] Reverting use of isPopulatedObject in error utils (#159913)](#159913) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"James Gowdy","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-19T12:52:11Z","message":"[ML] Reverting use of isPopulatedObject in error utils (#159913)\n\nPR #155372 moved our error utils\r\nto a package and also made a few small code changes, one of which added\r\n`isPopulatedObject` to the error object type guards.\r\n`isPopulatedObject` uses `Object.keys` under the hood which cannot be\r\nused to access the non-enumerable properties of an object, like Error's\r\n`message`.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388)\r\n\r\nThis PR reverts all of these functions back to their original versions\r\nwhich had existed in ML for a while without issue.\r\n\r\nThis was change had been causing error messages to not display\r\ncorrectly.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956)\r\n\r\nvs\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8)","sha":"8ca1789faa899f2e0a7abcf58fac50fa4d552af6","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","v8.9.0","v8.8.2"],"number":159913,"url":"https://github.com/elastic/kibana/pull/159913","mergeCommit":{"message":"[ML] Reverting use of isPopulatedObject in error utils (#159913)\n\nPR #155372 moved our error utils\r\nto a package and also made a few small code changes, one of which added\r\n`isPopulatedObject` to the error object type guards.\r\n`isPopulatedObject` uses `Object.keys` under the hood which cannot be\r\nused to access the non-enumerable properties of an object, like Error's\r\n`message`.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388)\r\n\r\nThis PR reverts all of these functions back to their original versions\r\nwhich had existed in ML for a while without issue.\r\n\r\nThis was change had been causing error messages to not display\r\ncorrectly.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956)\r\n\r\nvs\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8)","sha":"8ca1789faa899f2e0a7abcf58fac50fa4d552af6"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159913","number":159913,"mergeCommit":{"message":"[ML] Reverting use of isPopulatedObject in error utils (#159913)\n\nPR #155372 moved our error utils\r\nto a package and also made a few small code changes, one of which added\r\n`isPopulatedObject` to the error object type guards.\r\n`isPopulatedObject` uses `Object.keys` under the hood which cannot be\r\nused to access the non-enumerable properties of an object, like Error's\r\n`message`.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/6a0269df-ca2a-494a-9364-8f35f2b52388)\r\n\r\nThis PR reverts all of these functions back to their original versions\r\nwhich had existed in ML for a while without issue.\r\n\r\nThis was change had been causing error messages to not display\r\ncorrectly.\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/1862f069-1626-4ac3-8961-dca016b91956)\r\n\r\nvs\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/22172091/243143a5-0c8f-4365-a41d-7c1c09858ad8)","sha":"8ca1789faa899f2e0a7abcf58fac50fa4d552af6"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: James Gowdy <[email protected]>
PR #155372 moved our error utils to a package and also made a few small code changes, one of which added
isPopulatedObject
to the error object type guards.isPopulatedObject
usesObject.keys
under the hood which cannot be used to access the non-enumerable properties of an object, like Error'smessage
.This PR reverts all of these functions back to their original versions which had existed in ML for a while without issue.
This was change had been causing error messages to not display correctly.
vs