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 <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
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 <yujin.emma.work@gmail.com>
|
@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
| - [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.
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 <112784385+yujin-emma@users.noreply.github.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
…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 <yujin.emma.work@gmail.com> * clean unused parameters in test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * bug fix 5861 Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * clean unused parameters in test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed UT Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update CHANGELOG.md Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * Update changelog message Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> --------- Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> Signed-off-by: Yu Jin <112784385+yujin-emma@users.noreply.github.com> (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 <yujin.emma.work@gmail.com> * clean unused parameters in test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * bug fix 5861 Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * clean unused parameters in test Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * fix failed UT Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * update CHANGELOG.md Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> * Update changelog message Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> --------- Signed-off-by: yujin-emma <yujin.emma.work@gmail.com> Signed-off-by: Yu Jin <112784385+yujin-emma@users.noreply.github.com> (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
pendingOverwriteswithout checking wether the object found or not, which is told by checkConflict results, in errors arrayWe do not need to mutate the
pendingOverwritesin checkConflictForDataSource since checkConflicts already handledIssues Resolved
Fixes #5861
Screenshot
Testing the changes
Check List
yarn test:jestyarn test:jest_integration