-
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] Use Kibana's HttpHandler for HTTP requests #59320
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.
Tested and LGTM
export interface HttpOptions { | ||
url?: string; | ||
} | ||
import { getHttp } from '../util/dependency_cache'; | ||
|
||
function getResultHeaders(headers: HeadersInit): HeadersInit { | ||
return { | ||
asSystemRequest: false, |
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.
this should be true
Something that was missed in a previous PR, but worth updating now.
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.
Fixed in bae457f
import { from, Observable } from 'rxjs'; | ||
import { switchMap } from 'rxjs/operators'; | ||
|
||
import { getXSRF } from '../util/dependency_cache'; |
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.
getXSRF
can now be removed from dependency_cache
and all references to XSRF
can go including the __LEGACY
section from MlDependencies
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.
Check bae457f
# Conflicts: # x-pack/legacy/plugins/transform/public/plugin.ts # x-pack/legacy/plugins/transform/public/shim.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.
transform changes LGTM
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.
Tested and LGTM
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / kibana-xpack-agent / X-Pack Saved Object API Integration Tests -- security_only.x-pack/test/saved_object_api_integration/security_only/apis/bulk_update·ts.saved objects security only enabled bulkUpdate dual-privileges readonly user "before all" hook for "should return 403 for hiddentype doc"Standard Out
Stack Trace
Kibana Pipeline / kibana-xpack-agent / X-Pack Saved Object API Integration Tests -- security_only.x-pack/test/saved_object_api_integration/security_only/apis/bulk_update·ts.saved objects security only enabled bulkUpdate dual-privileges readonly user "after all" hook for "should return 403 for hiddentype doc"Standard Out
Stack Trace
Kibana Pipeline / kibana-xpack-agent / X-Pack Saved Object API Integration Tests -- security_only.x-pack/test/saved_object_api_integration/security_only/apis/bulk_update·ts.saved objects security only enabled bulkUpdate dual-privileges readonly user "before all" hook for "should return 403 for hiddentype doc"Standard Out
Stack Trace
History
To update your PR or re-run it, just comment with: |
* [ML] use kibana http * [ML] fromHttpHandler * [ML] remove __LEGACY, update asSystemRequest header * [ML] transform with NP http
…x-closed-index * 'master' of github.com:elastic/kibana: (32 commits) [ML] Use Kibana's HttpHandler for HTTP requests (elastic#59320) [APM] Create settings page to manage Custom Links (elastic#57788) [Upgrade Assistant] Server-side batch reindexing (elastic#58598) completes navigation test (elastic#59141) [SIEM] Fixes dragging entries to the Timeline while data is loading may trigger a partial page reload (elastic#59476) [Reporting/Screenshots] Handle page setup errors and capture the page, don't fail the job (elastic#58683) [SIEM] [CASES] API with io-ts validation (elastic#59265) Use camelCase rather than snakeCase for plugin name (elastic#59461) [Maps] top term percentage field property (elastic#59386) Add custom action to registry and show actions list in siem (elastic#58395) [Search service] Add enhanced ES search strategy (elastic#59224) [Logs UI] Speed up stream rendering using memoization (elastic#59163) expand max-old-space-size for xpack jest tests (elastic#59455) Added possibility to embed connectors create and edit flyouts (elastic#58514) Revert "Temporarily disabling PR project mappings (elastic#59485)" (elastic#59491) Temporarily disabling PR project mappings (elastic#59485) [Endpoint] Fix alert list functional test error (elastic#59357) Rename status_page to statusPage (elastic#59186) Fix visual baseline job (elastic#59348) Extended AlertContextValue with metadata optional property (elastic#59391) ... # Conflicts: # x-pack/plugins/upgrade_assistant/common/types.ts # x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts # x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts # x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts
Summary
Part of #49743. Replaces
fetch
in http service with Kibana HttpHandler. It prepends the URL with a base path and adds requiredkbn-
headers to the request so ML API services have been adjusted accordingly. Alsohttp$
required to introduce a customfromFetch
to use kibana's http handler instead of build-in fetch.Checklist