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

[saved objects] enable deletion of saved objects by type if configured

Open kavilla opened this issue 10 months ago • 4 comments

Description

Adds the following settings:

migrations.delete.enabled
migrations.delete.types

unknown types already exist but the purpose of this type is for plugins that are disabled. OpenSearch Dashboards gets confused when a plugin is not defining a saved object type but the saved object exists. This can occur when migrating from a non-OSD version and there exists non-compatiable saved objects.

If OSD is failing to migrate an index because of a document, I can now configure OSD to delete types of saved objects that I specified because I know that these types should not be carried over.

Issues Resolved

resolves: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1040

Changelog

  • feat: Adds migrations.delete to delete saved objects by type during a migration

Screenshot

Testing the changes

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

kavilla avatar Apr 13 '24 10:04 kavilla

Thanks @kavilla for the improvement

@BionIT @CCongWang to take a look as related to migration and upgration scenario.

seraphjiang avatar Apr 13 '24 18:04 seraphjiang

Can we add specific use case or attach a video or screenshot (if possible) in this PR details to make it more clear to the people who does not have context? Details like what problem we are trying to solve, what type of users would receive help from this change etc. would be helpful. Thanks!

bandinib-amzn avatar Apr 15 '24 21:04 bandinib-amzn

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

github-actions[bot] avatar Apr 25 '24 22:04 github-actions[bot]

Codecov Report

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

Project coverage is 67.69%. Comparing base (b5121d3) to head (fa87907).

Files Patch % Lines
...er/saved_objects/migrations/core/index_migrator.ts 33.33% 5 Missing and 1 partial :warning:
.../core/server/saved_objects/saved_objects_config.ts 0.00% 2 Missing :warning:
...earch_dashboards/opensearch_dashboards_migrator.ts 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6443      +/-   ##
==========================================
- Coverage   67.70%   67.69%   -0.01%     
==========================================
  Files        3417     3417              
  Lines       66922    66941      +19     
  Branches    10888    10892       +4     
==========================================
+ Hits        45308    45318      +10     
- Misses      18967    18974       +7     
- Partials     2647     2649       +2     
Flag Coverage Δ
Linux_1 33.16% <0.00%> (-0.02%) :arrow_down:
Linux_2 55.59% <57.14%> (-0.01%) :arrow_down:
Linux_3 ?
Linux_4 34.82% <0.00%> (-0.02%) :arrow_down:
Windows_1 33.18% <0.00%> (-0.02%) :arrow_down:
Windows_2 55.55% <57.14%> (-0.01%) :arrow_down:
Windows_3 45.23% <0.00%> (-0.03%) :arrow_down:
Windows_4 34.82% <0.00%> (-0.02%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 25 '24 22:04 codecov[bot]

@bandinib-amzn @Flyingliuhub @BionIT @xinruiba would you help to take a look and approve if no need. this is need for 2.14

seraphjiang avatar May 04 '24 19:05 seraphjiang

This change overall looks good to me. Can you add more UT to pass codecov CI? For link check failure, it looks like it is not related to your change, can you confirm?

bandinib-amzn avatar May 04 '24 21:05 bandinib-amzn

LGTM.

Flyingliuhub avatar May 04 '24 22:05 Flyingliuhub

re-run some failed checks

ZilongX avatar May 05 '24 00:05 ZilongX

ciGroup3 failed.

ananzh avatar May 05 '24 04:05 ananzh