-
Notifications
You must be signed in to change notification settings - Fork 918
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
Bug 5861 Fix: fix import api always display overwritten
after importing saved objects, after this fix, the first time import will display new
and after that will display overwritten
if import the same objects
#5871
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]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5871 +/- ##
==========================================
- Coverage 66.98% 66.98% -0.01%
==========================================
Files 3304 3304
Lines 63572 63569 -3
Branches 10153 10153
==========================================
- Hits 42585 42582 -3
Misses 18520 18520
Partials 2467 2467
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: yujin-emma <[email protected]>
@yujin-emma can we have better bug title, like as the detail which you are trying to address, not the bug number. Thanks |
overwritten
after importing saved objects, after this fix, the first time import will display new
and after that will display overwritten
if import the same objects
@@ -38,7 +38,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- [Discover] Enhanced the data source selector with added sorting functionality ([#5609](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5609)) | |||
- [Multiple Datasource] Add datasource picker component and use it in devtools and tutorial page when multiple datasource is enabled ([#5756](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5756)) | |||
- [Multiple Datasource] Add datasource picker to import saved object flyout when multiple data source is enabled ([#5781](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5781)) | |||
- [Multiple Datasource] Add interfaces to register add-on authentication method from plug-in module ([#5851](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5851)) | |||
- [Multiple Datasource] Add interfaces to register add-on authentication method from plug-in module ([#5851](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5851)) |
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, this change comes from rebasing the main, this change is from this commit: yujin-emma@e08bf30
Found a test failure not related to the code change in this PR: #5876 |
Checks on feature branch only failed with the function test failure issue: #5876, already filed another issue with this test, the left failure should be fine with rerun |
Signed-off-by: Yu Jin <[email protected]>
Signed-off-by: yujin-emma <[email protected]>
…ting saved objects, after this fix, the first time import will display `new` and after that will display `overwritten` if import the same objects (#5871) * bug fix 5861 Signed-off-by: yujin-emma <[email protected]> * clean unused parameters in test Signed-off-by: yujin-emma <[email protected]> * bug fix 5861 Signed-off-by: yujin-emma <[email protected]> * clean unused parameters in test Signed-off-by: yujin-emma <[email protected]> * fix failed UT Signed-off-by: yujin-emma <[email protected]> * update CHANGELOG.md Signed-off-by: yujin-emma <[email protected]> * Update changelog message Signed-off-by: yujin-emma <[email protected]> --------- Signed-off-by: yujin-emma <[email protected]> Signed-off-by: Yu Jin <[email protected]> (cherry picked from commit d8aefae) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…ting saved objects, after this fix, the first time import will display `new` and after that will display `overwritten` if import the same objects (#5871) (#5891) * bug fix 5861 Signed-off-by: yujin-emma <[email protected]> * clean unused parameters in test Signed-off-by: yujin-emma <[email protected]> * bug fix 5861 Signed-off-by: yujin-emma <[email protected]> * clean unused parameters in test Signed-off-by: yujin-emma <[email protected]> * fix failed UT Signed-off-by: yujin-emma <[email protected]> * update CHANGELOG.md Signed-off-by: yujin-emma <[email protected]> * Update changelog message Signed-off-by: yujin-emma <[email protected]> --------- Signed-off-by: yujin-emma <[email protected]> Signed-off-by: Yu Jin <[email protected]> (cherry picked from commit d8aefae) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Adjust the order of checkConflicts, checkConflictForDataSource and checkOriginConflict.
The root cause of issue 5861 is when check conflict with data source, if there is no data source conflict, the object will be added in
pendingOverwrites
without checking wether the object found or not, which is told by checkConflict results, in errors arrayWe do not need to mutate the
pendingOverwrites
in checkConflictForDataSource since checkConflicts already handledIssues Resolved
Fixes #5861
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration