-
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 resolve index API to not throw 500 when encountering no_such_remote_cluster_exception
#204802
Conversation
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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.
Overall looks good!
Added a suggestion for having API integration tests too if posible.
}, | ||
}; | ||
|
||
describe('preview_scripted_field route', () => { |
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.
describe('preview_scripted_field route', () => { | |
describe('resolve_index route', () => { |
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.
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.
Can we also extend the integration tests with this case?
test/api_integration/apis/data_views/resolve_index/resolve_index.ts
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.
Added in 322412c. (We already had a test for should return 404 for an exact match index
but I added one for should return 200 for a search for indices with wildcard
.)
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.
Great, thanks!
test/api_integration/apis/data_views/resolve_index/resolve_index.ts
Outdated
Show resolved
Hide resolved
…ex.ts Co-authored-by: Julia Rechkunova <[email protected]>
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
cc @lukasolson |
Starting backport for target branches: 8.x |
…ote_cluster_exception` (elastic#204802) ## Summary Fixes elastic#197747. Updates the `/internal/index-pattern-management/resolve_index/{query}` route to properly handle `no_such_remote_cluster_exception` and return `404` rather than `500` server error. Adds unit tests for the route handler. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Julia Rechkunova <[email protected]> (cherry picked from commit 0952f6e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…no_such_remote_cluster_exception` (#204802) (#205016) # Backport This will backport the following commits from `main` to `8.x`: - [Fix resolve index API to not throw 500 when encountering `no_such_remote_cluster_exception` (#204802)](#204802) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Lukas Olson","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-19T21:55:29Z","message":"Fix resolve index API to not throw 500 when encountering `no_such_remote_cluster_exception` (#204802)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/197747.\r\n\r\nUpdates the `/internal/index-pattern-management/resolve_index/{query}`\r\nroute to properly handle `no_such_remote_cluster_exception` and return\r\n`404` rather than `500` server error.\r\n\r\nAdds unit tests for the route handler.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Julia Rechkunova <[email protected]>","sha":"0952f6e0f52771b3503c9ddd2afd793d8ed86709","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Data Views","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor"],"title":"Fix resolve index API to not throw 500 when encountering `no_such_remote_cluster_exception`","number":204802,"url":"https://github.com/elastic/kibana/pull/204802","mergeCommit":{"message":"Fix resolve index API to not throw 500 when encountering `no_such_remote_cluster_exception` (#204802)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/197747.\r\n\r\nUpdates the `/internal/index-pattern-management/resolve_index/{query}`\r\nroute to properly handle `no_such_remote_cluster_exception` and return\r\n`404` rather than `500` server error.\r\n\r\nAdds unit tests for the route handler.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Julia Rechkunova <[email protected]>","sha":"0952f6e0f52771b3503c9ddd2afd793d8ed86709"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204802","number":204802,"mergeCommit":{"message":"Fix resolve index API to not throw 500 when encountering `no_such_remote_cluster_exception` (#204802)\n\n## Summary\r\n\r\nFixes https://github.com/elastic/kibana/issues/197747.\r\n\r\nUpdates the `/internal/index-pattern-management/resolve_index/{query}`\r\nroute to properly handle `no_such_remote_cluster_exception` and return\r\n`404` rather than `500` server error.\r\n\r\nAdds unit tests for the route handler.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Julia Rechkunova <[email protected]>","sha":"0952f6e0f52771b3503c9ddd2afd793d8ed86709"}}]}] BACKPORT--> Co-authored-by: Lukas Olson <[email protected]>
Summary
Fixes #197747.
Updates the
/internal/index-pattern-management/resolve_index/{query}
route to properly handleno_such_remote_cluster_exception
and return404
rather than500
server error.Adds unit tests for the route handler.
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.