Skip to content
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

Integrate MDS client to ISM #711

Draft
wants to merge 22 commits into
base: 2.x
Choose a base branch
from

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Apr 20, 2023

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@SuZhou-Joe SuZhou-Joe requested a review from a team April 20, 2023 03:06
@SuZhou-Joe SuZhou-Joe marked this pull request as draft April 20, 2023 03:06
@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2023

Codecov Report

Merging #711 (d1ab5eb) into 2.x (4979092) will decrease coverage by 0.21%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              2.x     #711      +/-   ##
==========================================
- Coverage   63.37%   63.16%   -0.21%     
==========================================
  Files         341      345       +4     
  Lines       11545    11591      +46     
  Branches     2108     2111       +3     
==========================================
+ Hits         7317     7322       +5     
- Misses       3654     3695      +41     
  Partials      574      574              

see 6 files with indirect coverage changes

},
},
method: "POST",
extendClient({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the logic is moved to clusters/extend_client.ts, there is no much logic left in the ismPlugin.ts file, what's the benefit of break it to two files?

Copy link
Member Author

@SuZhou-Joe SuZhou-Joe Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to extend the legacyClient and OpenSearchClient(in MDS case) but the context is different when constructing so we have to move all the ism.xxx = ca(xxx) code into a separate function to reuse the extend logic.


export const getClientSupportMDS = (props: IGetClientProps) => {
const originalAsScoped = props.client.asScoped;
const handler: IContextProvider<RequestHandler<unknown, unknown, unknown>, "core"> = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what're the three unknowns?

server/plugin.ts Outdated
core,
client: legacyClient,
getDataSourceId() {
return "3e2ff6a0-de64-11ed-b697-57f5dd34beb6";
Copy link
Member Author

@SuZhou-Joe SuZhou-Joe Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: Use a request level params to get data source id, make it stateless.

@SuZhou-Joe SuZhou-Joe force-pushed the feature/mds-client-with-ism branch from 92302f8 to f93a406 Compare May 30, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants