-
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
[Console] Move out of legacy + migrate server side to New Platform #55690
Merged
jloleysens
merged 19 commits into
elastic:master
from
jloleysens:np/console/move-out-legacy
Jan 30, 2020
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dec28e9
Initial move of public and setup of server skeleton
jloleysens 2426fcf
Fix public paths and types
jloleysens 29db598
Use new usage stats dependency directly in tracker also mark as an op…
jloleysens 0e8fae1
WiP on getting server side working
jloleysens 9f12049
Restore proxy route behaviour for base case, still need to test custo…
jloleysens d73a3e9
Add new type and lib files
jloleysens bbe729b
Clean up legacy start up code and add comment about issue in kibana.y…
jloleysens a3c85d9
Move console_extensions to new platform and introduce ConsoleSetup AP…
jloleysens 212a1a3
Re-introduce injected elasticsearch variable and use it in public
jloleysens 46c5cab
Don't pass stateSetter prop through to checkbox
jloleysens 5f76f38
Merge branch 'master' of github.com:elastic/kibana into np/console/mo…
jloleysens 4f7f3c5
Refactor of proxy route (split into separate files). Easier testing f…
jloleysens 79a9803
headers.js test -> headers.test.ts and moved some of the proxy route …
jloleysens 485a462
Finish migration of rest of proxy route test away from hapi
jloleysens 541ecf5
Bring console application in line with https://github.com/elastic/kib…
jloleysens 90d7b72
Update i18nrc file for console
jloleysens 5d0082b
Merge branch 'master' into np/console/move-out-legacy
elasticmachine 0c2dfde
Add setHeaders when passing back error response
jloleysens 217d5ae
Merge branch 'master' into np/console/move-out-legacy
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think it may be more appropriate to add
Buffer | stream.Readable
to theResponseError
union type. @restrry WDYT?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.
When it's required? As I can see proxyRequest rejects a promise with an error message, not steam or a buffer
kibana/src/plugins/console/server/lib/request.ts
Line 92 in 0e8fae1
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.
Hey @restrry ! Thanks for weighing in!
This is the flow:
User issues request in browser -> console streams to ES -> ES responds (e.g., status code 400!) -> console streams back to browser -> user sees error.
With the current implementation console cannot stream the error response ES gave us back to browser because the current implementation wants to send back JS object encoded as JSON when we haven't read the body into memory for that.
The error handler you linked to is for lower-level errors on
http
request - like if the socket gets hung up. Not for a 4xx or 5xx status code. You can see here how the response is handled:kibana/src/plugins/console/server/routes/api/console/proxy/create_handler.ts
Line 166 in 541ecf5
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.
Ok, I think we can merge the current changes. Could you add headers configuration as done in https://github.com/elastic/kibana/pull/55690/files/46c5cab221d6b63a8b442f3ba8a3a7bdc4c03f4d#diff-92d94ad4d163809567c4258f95ff37e2R96 ?
I created an issue to add tests for this API #56305
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.
agree, can be done in #56305