OpenSearch-Dashboards icon indicating copy to clipboard operation
OpenSearch-Dashboards copied to clipboard

[MD] Register data source plugin interface to route handler context

Open zhongnansu opened this issue 3 years ago • 1 comments

Signed-off-by: Zhongnan Su [email protected]

Description

  • Create data source plugin context class that contains the interface to retrieve a client by datasource id.
  • Register data source plugin context to route handler context.
  • The caller plugin, for example, search plugin will use the interface as below to retrieve a data source client. It will be further implementer in other tasks. #1988
const dataSourceClient = await context.data_source.opensearch.getClient(id)
  • Init DataSourceClient class, with a dummy implementation of functions required by interfaces , it will be further implemented in other PRs
  • Init DataSourceService class, with interfaces defined

Issues Resolved

#1979

Check List

  • [ ] New functionality includes testing.
    • [ ] All tests pass
      • [ ] yarn test:jest
      • [ ] yarn test:jest_integration
      • [ ] yarn test:ftr
  • [ ] New functionality has been documented.
  • [ ] Commits are signed per the DCO using --signoff

zhongnansu avatar Aug 10 '22 00:08 zhongnansu

Codecov Report

Merging #2121 (025dcca) into feature/multi-datasource (456b5c7) will increase coverage by 0.01%. The diff coverage is n/a.

@@                     Coverage Diff                      @@
##           feature/multi-datasource    #2121      +/-   ##
============================================================
+ Coverage                     67.47%   67.48%   +0.01%     
============================================================
  Files                          3080     3080              
  Lines                         59246    59246              
  Branches                       9010     9010              
============================================================
+ Hits                          39977    39983       +6     
+ Misses                        17080    17076       -4     
+ Partials                       2189     2187       -2     
Impacted Files Coverage Δ
...ic/application/models/sense_editor/sense_editor.ts 64.88% <0.00%> (+0.88%) :arrow_up:
packages/osd-optimizer/src/node/cache.ts 52.77% <0.00%> (+2.77%) :arrow_up:
...s/osd-optimizer/src/node/node_auto_tranpilation.ts 87.75% <0.00%> (+4.08%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 10 '22 01:08 codecov-commenter

look forward for more coverage

definitely, the existing tests can pass now. I am merging in to unblock others. Tracking UT improvement here for this module. https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2163

zhongnansu avatar Aug 18 '22 00:08 zhongnansu