-
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
[feat] create additional http servers #36804
Conversation
Pinging @elastic/kibana-platform |
In order for this PR to automatically close the mentioned issue #, you will need to put this in the summary. Also, could you add back in the rest of the information from the pull request template? |
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.
Just have a couple small requests.
💔 Build Failed |
94a231b
to
22f962a
Compare
💔 Build Failed |
💔 Build Failed |
22f962a
to
60e072a
Compare
💚 Build Succeeded |
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.
Just a couple minor changes, my review is approved once those are done.
60e072a
to
875e7e4
Compare
💔 Build Failed |
d779294
to
904be16
Compare
In elastic#36804 we need to validate a `Partial<HttpConfig>` object which may or may not have all the required keys attached to it. This is the type of use-case for `Joi.reach`, so we should expose a reach-like method on the object validation class so that you can return the validator for a specific key on an object.
💔 Build Failed |
* [feat] add reach-like functionality to object In #36804 we need to validate a `Partial<HttpConfig>` object which may or may not have all the required keys attached to it. This is the type of use-case for `Joi.reach`, so we should expose a reach-like method on the object validation class so that you can return the validator for a specific key on an object. * [fix] change to validateKey * [fix] use throw error matcher * [fix] use same interface for validate * [fix] change test name]
904be16
to
c2489d2
Compare
279d414
to
6bb33b4
Compare
💔 Build Failed |
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.
A few small things, good to merge once resolved.
💔 Build Failed |
💚 Build Succeeded |
* [feat] create additional http servers allow for additional http servers to be created, tracked and returned * respond to pr feedback * tweak test * update documentation * destructure port, remove unnecessary imports * [fix] export correct type * [feat] expose createNewServer to plugins * [fix] respond to pr feedback * todo: add schema validation & integration test * use reach * [fix] use validateKey to validate partial * [fix] change config shadowing * check kibana port & prevent shadowing * centralize start/stop for servers, add integration test * remove unnecessary property * never forget your await * remove option to pass config into start * fix pr feedback * fix documentation * fix test failures
isListening: () => this.httpServer.isListening(), | ||
isListening: (port = 0) => { | ||
const server = this.secondaryServers.get(port); | ||
if (server) return server.isListening(); |
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.
should we differentiate between primary server and secondary? that creates additional logic
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 originally didn't differentiate them but thought we might want to since we might want ot know what the primary instance is (than again we could find the port for primary and get it that way).
anyway i created an issue for it #37695.
* [feat] create additional http servers allow for additional http servers to be created, tracked and returned * respond to pr feedback * tweak test * update documentation * destructure port, remove unnecessary imports * [fix] export correct type * [feat] expose createNewServer to plugins * [fix] respond to pr feedback * todo: add schema validation & integration test * use reach * [fix] use validateKey to validate partial * [fix] change config shadowing * check kibana port & prevent shadowing * centralize start/stop for servers, add integration test * remove unnecessary property * never forget your await * remove option to pass config into start * fix pr feedback * fix documentation * fix test failures
* [feat] create additional http servers allow for additional http servers to be created, tracked and returned * respond to pr feedback * tweak test * update documentation * destructure port, remove unnecessary imports * [fix] export correct type * [feat] expose createNewServer to plugins * [fix] respond to pr feedback * todo: add schema validation & integration test * use reach * [fix] use validateKey to validate partial * [fix] change config shadowing * check kibana port & prevent shadowing * centralize start/stop for servers, add integration test * remove unnecessary property * never forget your await * remove option to pass config into start * fix pr feedback * fix documentation * fix test failures
* [feat] create additional http servers (#36804) * [feat] create additional http servers allow for additional http servers to be created, tracked and returned * respond to pr feedback * tweak test * update documentation * destructure port, remove unnecessary imports * [fix] export correct type * [feat] expose createNewServer to plugins * [fix] respond to pr feedback * todo: add schema validation & integration test * use reach * [fix] use validateKey to validate partial * [fix] change config shadowing * check kibana port & prevent shadowing * centralize start/stop for servers, add integration test * remove unnecessary property * never forget your await * remove option to pass config into start * fix pr feedback * fix documentation * fix test failures * [fix] failing negation on merge
💔 Build Failed |
allow for additional http servers to be created, tracked and returned
Summary
This allows kibana plugins to create an additional http server with the
same options as the main server, but listening on a different port.
Closes #36713
Blocked by #37118
Dev Docs
New Platform plugins can now create additional HTTP servers on additional ports. Example:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportThis was checked for keyboard-only and screenreader accessibilityFor maintainers
This includes a feature addition or change that requires a release note and was labeled appropriately