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

[Multi Datasource] Unify getDefaultDataSourceId and export #6843

Merged
merged 5 commits into from
May 31, 2024

Conversation

raintygao
Copy link
Contributor

@raintygao raintygao commented May 28, 2024

Description

  1. Add getDefaultDataSourceId and getDefaultDataSourceId$ function, unify in DSM and export in setup for other plugins to use
  2. Unify default data source ui settings id

Context

opensearch-project/dashboards-assistant#191 (comment)

Testing the changes

Changelog

  • refactor: Unify getDefaultDataSourceId and export

Check List

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

Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 67.41%. Comparing base (e2c0df2) to head (61dfa8c).

Files Patch % Lines
...c/components/edit_data_source/edit_data_source.tsx 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6843      +/-   ##
==========================================
- Coverage   67.43%   67.41%   -0.02%     
==========================================
  Files        3444     3444              
  Lines       67834    67839       +5     
  Branches    11031    11033       +2     
==========================================
- Hits        45741    45736       -5     
- Misses      19427    19438      +11     
+ Partials     2666     2665       -1     
Flag Coverage Δ
Linux_1 33.07% <ø> (ø)
Linux_2 55.12% <ø> (ø)
Linux_3 45.25% <94.44%> (+0.01%) ⬆️
Linux_4 34.82% <7.69%> (-0.01%) ⬇️
Windows_1 33.09% <ø> (-0.03%) ⬇️
Windows_2 55.09% <ø> (ø)
Windows_3 45.26% <94.44%> (+<0.01%) ⬆️
Windows_4 34.82% <7.69%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BionIT
Copy link
Collaborator

BionIT commented May 28, 2024

Could we add any tests that have been done for this change?

@raintygao
Copy link
Contributor Author

Could we add any tests that have been done for this change?

Sure, updated.

@SuZhou-Joe
Copy link
Member

How can other plugins use this method? I thought it will be export through data source service.

@raintygao
Copy link
Contributor Author

raintygao commented May 29, 2024

How can other plugins use this method? I thought it will be export through data source service.

Just discussed with @SuZhou-Joe @wanglam offline, we could return these util functions in setup. So that other plugins can use these functions through optionalPlugin instead of required.

SuZhou-Joe
SuZhou-Joe previously approved these changes May 30, 2024
zhyuanqi
zhyuanqi previously approved these changes May 30, 2024
raintygao and others added 4 commits May 31, 2024 09:53
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: tygao <tygao@amazon.com>
@raintygao raintygao dismissed stale reviews from zhyuanqi and SuZhou-Joe via 7b240bc May 31, 2024 01:56
Signed-off-by: tygao <tygao@amazon.com>
@raintygao raintygao requested a review from zhyuanqi May 31, 2024 07:22
@BionIT BionIT merged commit c7c47d2 into opensearch-project:main May 31, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 31, 2024
* Unify getDefaultDataSourceId and export

Signed-off-by: tygao <tygao@amazon.com>

* Changeset file for PR #6843 created/updated

* test: add tests for utils

Signed-off-by: tygao <tygao@amazon.com>

* return utils in setup

Signed-off-by: tygao <tygao@amazon.com>

* update interface

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit c7c47d2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
…h-project#6843)

* Unify getDefaultDataSourceId and export

Signed-off-by: tygao <tygao@amazon.com>

* Changeset file for PR opensearch-project#6843 created/updated

* test: add tests for utils

Signed-off-by: tygao <tygao@amazon.com>

* return utils in setup

Signed-off-by: tygao <tygao@amazon.com>

* update interface

Signed-off-by: tygao <tygao@amazon.com>

---------

Signed-off-by: tygao <tygao@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Jun 4, 2024
…6882)

* Unify getDefaultDataSourceId and export



* Changeset file for PR #6843 created/updated

* test: add tests for utils



* return utils in setup



* update interface



---------



(cherry picked from commit c7c47d2)

Signed-off-by: tygao <tygao@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Lu Yu <nluyu@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants