Skip to content

Commit 818cdb7

Browse files
authored
[CLI] fix a few things in domain migration command (cadence-workflow#5374)
What changed? add two methods in ClientFactory for migration countWorkflowCheck should be on current domain fix concurrency bug make template look slightly better Why? add two methods in ClientFactory for migration This is needed to be able to use environment flags for internal usage How did you test it? shengs@shengs-C02XN3VDJGH6 cadence % go run cmd/tools/cli/main.go --do domain-1 domain migration --destination_address localhost:7933 --destination_domain domain-2 --tasklist ts1 --search_attr someID:INT 2023/08/08 10:21:28 Loading configFiles=[config/base.yaml config/development.yaml] 2023/08/08 10:21:28 Loading configFiles=[config/base.yaml config/development.yaml] {"level":"info","ts":"2023-08-08T10:21:28.241-0700","msg":"Updated dynamic config","logging-call-at":"file_based_client.go:284"} Validation Check: - Domain Meta Data: true Current Domain: Name: domain-1 UUID: d3cc0a3c-8f55-40af-9820-c48f8a0f46e5 New Domain: Name: domain-2 UUID: 203f0088-1d0f-40ac-a7c3-fdcf57ec0a99 - Workflow Check: true Long Running Workflow Num: 0 - Dynamic Config Check: false - Config Key: matching.asyncTaskDispatchTimeout Current Response: Data: "50s" Filters: - Name: domainName Value: "domain-1" - Name: taskListName Value: ["ts1"] New Response: Data: "20s" Filters: - Name: domainName Value: "domain-2" - Name: taskListName Value: ["ts1"] - Search Attributes Check: false Missing Search Attributes in Current Domain: - someID:INT Missing Search Attributes in New Domain: - someID:INT Potential risks No Risk
1 parent fea24c2 commit 818cdb7

File tree

6 files changed

+575
-513
lines changed

6 files changed

+575
-513
lines changed

tools/cli/app_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ func (m *clientFactoryMock) ServerAdminClient(c *cli.Context) admin.Client {
6060
return m.serverAdminClient
6161
}
6262

63+
func (m *clientFactoryMock) ServerFrontendClientForMigration(c *cli.Context) frontend.Client {
64+
panic("not implemented")
65+
}
66+
67+
func (m *clientFactoryMock) ServerAdminClientForMigration(c *cli.Context) admin.Client {
68+
panic("not implemented")
69+
}
70+
6371
func (m *clientFactoryMock) ElasticSearchClient(c *cli.Context) *elastic.Client {
6472
panic("not implemented")
6573
}

tools/cli/domain.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ func newDomainCommands() []cli.Command {
8383
newDomainCLI(c, false).DescribeDomain(c)
8484
},
8585
},
86-
8786
{
8887
Name: "migration",
8988
Aliases: []string{"mi"},
9089
Usage: "Migrate existing domain to new domain. This command only validates the settings. It does not perform actual data migration",
9190
Flags: migrateDomainFlags,
9291
Action: func(c *cli.Context) {
93-
newDomainCLI(c, true).MigrateDomain(c)
92+
newDomainMigrationCLIImpl(c).Validation(c)
9493
},
9594
},
9695
}

0 commit comments

Comments
 (0)