From 563b06e92916be45c7f87a82af59b28826e1599f Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 13 Aug 2024 14:48:32 +0200 Subject: [PATCH] conflicts --- tools/confix/migrations.go | 51 +++++--------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/tools/confix/migrations.go b/tools/confix/migrations.go index 910c1004c4e4..01c14ca8a148 100644 --- a/tools/confix/migrations.go +++ b/tools/confix/migrations.go @@ -21,65 +21,26 @@ type MigrationMap map[string]func(from *tomledit.Document, to string) transform. // loadDestConfigFile is the function signature to load the destination version // configuration toml file. -type loadDestConfigFile func(to, planType string) (*tomledit.Document, error) +type loadDestConfigFile func(to string) (*tomledit.Document, error) var Migrations = MigrationMap{ "v0.45": NoPlan, // Confix supports only the current supported SDK version. So we do not support v0.44 -> v0.45. -<<<<<<< HEAD - "v0.46": PlanBuilder, - "v0.47": PlanBuilder, - "v0.50": PlanBuilder, - // "v0.xx.x": PlanBuilder, // add specific migration in case of configuration changes in minor versions -} - -// PlanBuilder is a function that returns a transformation plan for a given diff between two files. -func PlanBuilder(from *tomledit.Document, to string) transform.Plan { - plan := transform.Plan{} - deletedSections := map[string]bool{} - - target, err := LoadLocalConfig(to) -======= "v0.46": defaultPlanBuilder, "v0.47": defaultPlanBuilder, "v0.50": defaultPlanBuilder, - "v0.52": defaultPlanBuilder, - "v2": V2PlanBuilder, - // "v0.xx.x": defaultPlanBuilder, // add specific migration in case of configuration changes in minor versions -} - -type v2KeyChangesMap map[string][]string - -// list all the keys which are need to be modified in v2 -var v2KeyChanges = v2KeyChangesMap{ - "min-retain-blocks": []string{"comet.min-retain-blocks"}, - "index-events": []string{"comet.index-events"}, - "halt-height": []string{"comet.halt-height"}, - "halt-time": []string{"comet.halt-time"}, - "app-db-backend": []string{"store.app-db-backend"}, - "pruning-keep-recent": []string{ - "store.options.ss-pruning-option.keep-recent", - "store.options.sc-pruning-option.keep-recent", - }, - "pruning-interval": []string{ - "store.options.ss-pruning-option.interval", - "store.options.sc-pruning-option.interval", - }, - "iavl-cache-size": []string{"store.options.iavl-config.cache-size"}, - "iavl-disable-fastnode": []string{"store.options.iavl-config.skip-fast-storage-upgrade"}, - // Add other key mappings as needed + // "v0.xx.x": PlanBuilder, // add specific migration in case of configuration changes in minor versions } -func defaultPlanBuilder(from *tomledit.Document, to, planType string) (transform.Plan, *tomledit.Document) { - return PlanBuilder(from, to, planType, LoadLocalConfig) +func defaultPlanBuilder(from *tomledit.Document, to string) transform.Plan { + return PlanBuilder(from, to, LoadLocalConfig) } // PlanBuilder is a function that returns a transformation plan for a given diff between two files. -func PlanBuilder(from *tomledit.Document, to, planType string, loadFn loadDestConfigFile) (transform.Plan, *tomledit.Document) { +func PlanBuilder(from *tomledit.Document, to string, loadFn loadDestConfigFile) transform.Plan { plan := transform.Plan{} deletedSections := map[string]bool{} - target, err := loadFn(to, planType) ->>>>>>> 1d7f891ea (feat(confix): allow customization of migration plan (#21202)) + target, err := loadFn(to) if err != nil { panic(fmt.Errorf("failed to parse file: %w. This file should have been valid", err)) }