-
Notifications
You must be signed in to change notification settings - Fork 894
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
[Multiple DataSource] Do not support import data source object to Local cluster when not enable data source #6395
Conversation
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
…ards into lc-ds-error
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
test group 3 failed since the previous commit: https://github.com/opensearch-project/OpenSearch-Dashboards/actions/runs/8577288437/job/23509664181 |
lint check also failed in this PR: https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6411/checks |
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6395 +/- ##
==========================================
- Coverage 49.55% 45.14% -4.42%
==========================================
Files 2670 1654 -1016
Lines 54290 33563 -20727
Branches 8878 6378 -2500
==========================================
- Hits 26906 15151 -11755
+ Misses 25720 17242 -8478
+ Partials 1664 1170 -494
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6395-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 97355995c89a78bf45ebbdcbe3364fa8cc6eafe6
# Push it to GitHub
git push --set-upstream origin backport/backport-6395-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
@@ -64,6 +64,7 @@ export const registerImportRoute = (router: IRouter, config: SavedObjectConfig) | |||
workspaces: schema.maybe( | |||
schema.oneOf([schema.string(), schema.arrayOf(schema.string())]) | |||
), | |||
dataSourceEnabled: schema.maybe(schema.boolean({ defaultValue: false })), |
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.
shouldn't this dataSourceEnabled
option determined by the saved object service itself, passing as parameter doesn't looks right to me
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.
Hi, @zengyan-amazon something here might confuse me. The dataSourceEnabled
is originally from DataSourcePluginSetup props, it is from data source service and pass as service field, UI component will pass it as parameter to import api, UI got it from saved_object_management plugin set up (code)[https://github.com/opensearch-project/OpenSearch-Dashboards/blob/fb76ee9beee3a98d9b7c0783df072abe745acd7a/src/plugins/saved_objects_management/public/plugin.ts#L110], import api from core is used in this plugin, but does not have plugin setup, I do not know how to get the dataSourceEnabled from the saved object client from the core, could you please point me some example
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.
Issue to track here: #6557
@yujin-emma backport failed, can you fix? |
…object to Local cluster when not enable data source Signed-off-by: yujin-emma <[email protected]>
…object to Local cluster when not enable data source Signed-off-by: yujin-emma <[email protected]>
…object to Local cluster when not enable data source Signed-off-by: yujin-emma <[email protected]>
…a source object to Local cluster when not enable data source (#6913) * [Backport #6395] Do not support import data source object to Local cluster when not enable data source Signed-off-by: yujin-emma <[email protected]> * Update CHANGELOG.md Signed-off-by: yujin-emma <[email protected]> * fix: integration test failure Signed-off-by: SuZhou-Joe <[email protected]> Signed-off-by: yujin-emma <[email protected]> --------- Signed-off-by: yujin-emma <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]>
Description
Transfer saved object from a data source to local cluster can cause troubles, when a cluster disable Multiple Datasource feature, there is no data source concept, any saved objects containing data source information will fail to work, we should not support import saved object from a data source to cluster that is not enabled Multiple Datasource
Issues Resolved
#6115
Screenshot
Testing the changes
When not enable data source
Test import fail when import data-source obj only
Test import fail all when import exported obj from MDS cluster
Test import fail all when mixed non-MDS exported objs and MDS exported objs in a single import call
Test import success when import non-MDS exported objs
Check List
yarn test:jest
yarn test:jest_integration