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

Create a migration function for datasource to add migrationVersion field #6025

Merged

Conversation

yibow98
Copy link
Contributor

@yibow98 yibow98 commented Mar 5, 2024

Description

This PR is to add a migration function with version 2.4.0 for datasource to add a migrationVersion field.
For more information, please refer to the RFC: #6022

Issues Resolved

#6022

Testing the changes

For the testing, it is included in this RFC: #6022

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 Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.13%. Comparing base (bb8155a) to head (548546b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6025      +/-   ##
==========================================
- Coverage   67.13%   67.13%   -0.01%     
==========================================
  Files        3317     3318       +1     
  Lines       64016    64021       +5     
  Branches    10256    10256              
==========================================
+ Hits        42979    42981       +2     
- Misses      18545    18548       +3     
  Partials     2492     2492              
Flag Coverage Δ
Linux_1 31.63% <ø> (ø)
Linux_2 55.20% <ø> (ø)
Linux_3 44.58% <100.00%> (-0.01%) ⬇️
Linux_4 35.16% <ø> (ø)
Windows_1 31.65% <ø> (ø)
Windows_2 55.17% <ø> (ø)
Windows_3 44.60% <100.00%> (-0.01%) ⬇️
Windows_4 35.16% <ø> (ø)

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.

@seraphjiang
Copy link
Member

Thanks @yibow98 should we remove dummy from title. it add migration method and set the default value to 2.4.0. not truly dummy

@yibow98 yibow98 changed the title Create a dummy migration function for datasource to add migrationVersion field Create a migration function for datasource to add migrationVersion field Mar 5, 2024
@yibow98
Copy link
Contributor Author

yibow98 commented Mar 5, 2024

Thanks @yibow98 should we remove dummy from title. it add migration method and set the default value to 2.4.0. not truly dummy

Done

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@seraphjiang seraphjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove dummy from code

Copy link
Member

@seraphjiang seraphjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use '2.4.0', how could we differentiate the MDS data saved before 2.13.0 . Otherwise lgtm

@yibow98
Copy link
Contributor Author

yibow98 commented Mar 5, 2024

if we use '2.4.0', how could we differentiate the MDS data saved before 2.13.0 . Otherwise lgtm

The migrationVersion is the version that the saved object apply the latest migration. If there is not data schema change, then all datasource should have the migrationVersion of 2.4.0 until we have a new migration function.

@yibow98 yibow98 force-pushed the add-datasource-migrationVersion branch from 35eefe8 to 3779498 Compare March 5, 2024 21:10
@yibow98 yibow98 force-pushed the add-datasource-migrationVersion branch from 3779498 to 548546b Compare March 5, 2024 22:15
@kavilla kavilla merged commit 70adcc9 into opensearch-project:main Mar 5, 2024
67 checks passed
@kavilla
Copy link
Member

kavilla commented Mar 5, 2024

Makes sense. Might need to fix at the root if you ever need to add multiple migrations.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 5, 2024
…eld (#6025)

This PR is to add a migration function with version 2.4.0 for datasource to add a migrationVersion field.
For more information, please refer to the RFC: #6022

Issues Resolved
#6022

Signed-off-by: Yibo Wang <yibow@amazon.com>
(cherry picked from commit 70adcc9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.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.

6 participants