-
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
Refactor HttpService tests #53033
Refactor HttpService tests #53033
Conversation
6bc8be7
to
6945a1a
Compare
stop(): Promise<void>; | ||
setup(...params: any[]): TSetup | Promise<TSetup>; | ||
start(...params: any[]): TStart | Promise<TStart>; | ||
stop(): void | Promise<void>; |
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 made this change to avoid making HttpService async and breaking a test utility that is used in quite a few places. I can also move this to a separate PR if we think that is better.
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's alright and that it's actually closer to the various services implementations
Pinging @elastic/kibana-platform (Team:Platform) |
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.
APM 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.
@elastic/kibana-app-arch team changes include rename of HttpServiceBase
to HttpSetup
.
Added 1 comment about replacing it with HttpStart
src/plugins/data/public/index_patterns/index_patterns/index_patterns.ts
Outdated
Show resolved
Hide resolved
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.
APM changes lgtm
0237996
to
18f0096
Compare
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 cleanup imho. Most of my comments are on existing code and not directly related to the PR changes.
public start(deps: HttpDeps) { | ||
return this.setup(deps); |
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.
(Probably a NIT) we are executing twice the setup
code by doing this, instead of once by storing as it was done before. The overheat is minimal (for now), but is there any upside on this change?
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.
Not necessary, but it's (very slightly) more consistent with how other services work.
src/core/public/public.api.md
Outdated
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "LoadingCountSetup" | ||
addLoadingCount: LoadingCountSetup['addLoadingCount']; |
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.
NIT: this is why I think we should stop using the Internal[XXX]
and actually make the 'effort' of adding proper public interfaces for all exported contracts. This is additional boilerplate I agree, but we will need them anyway when we'll cleanup the documentation.
This is a shame our doc generator is not able to properly 'replace' this kind of definition on the fly though.
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 is a shame our doc generator is not able to properly 'replace' this kind of definition on the fly though.
I agree. I think part of the complexity of building a tool that does this is knowing when to show the resolved type and when to show a link to a different page.
For now, I'll switch this to put the documented definition on the HttpSetup interface and duplicate it on the LoadingCountSetup interface.
stop(): Promise<void>; | ||
setup(...params: any[]): TSetup | Promise<TSetup>; | ||
start(...params: any[]): TStart | Promise<TStart>; | ||
stop(): void | Promise<void>; |
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's alright and that it's actually closer to the various services implementations
src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap
Show resolved
Hide resolved
18f0096
to
4bc4c51
Compare
4bc4c51
to
8c378ca
Compare
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Merging without approval from other teams since it's just a type rename. |
Summary
Follow up from #52434, this PR cleans up the HttpService more with these changes:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.(https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)
For maintainers