Skip to content

Commit

Permalink
common_migrations: add new migrations to handle settings-generator as…
Browse files Browse the repository at this point in the history
… struct

- RemoveWeakSettingsMigration: When we downgrade multiple version to a
  version where migrator is not aware of deleting the setting-generator
 as struct or the strength file. This migration will help us to delete
the strength and setting generator metadata.

- RemoveSchnauzerMigration: This will remove metadata(always) and data
  if the value matches with the value in existing datastore.

- RemoveDataMigration: This will remove the data when value matches with
  existing data.

- ResetMetadataMigration: Migration to remove all metadata on upgrade
  and downgrade. This metadata will be rewritten by storewolf.

This migration will be used to convert a strong setting to a weak
setting.

Also deleted the test test_replaces_nothing for
ReplaceSchnauzerMigration because we are deleting all the metadata as
first step of the migrator, hence we will not have any metadata
available in existing datastore to compare. We will assume that the
settings generator in input metadata is same as Old schanuzer string and
will always replace that with incoming setting generator string.
  • Loading branch information
vyaghras committed Jan 28, 2025
1 parent 6cc062f commit afdc836
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 152 deletions.
1 change: 1 addition & 0 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sources/api/migration/migration-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exclude = ["README.md"]
bottlerocket-release.workspace = true
datastore.workspace = true
handlebars.workspace = true
models.workspace = true
schnauzer.workspace = true
serde.workspace = true
serde_json.workspace = true
Expand Down
Loading

0 comments on commit afdc836

Please sign in to comment.