From c2e42314243ba13f33eca52d63151205786c6a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 20 Jun 2024 19:19:55 +0000 Subject: [PATCH] Don't rename fields --- flow/.golangci.yml | 2 ++ flow/workflows/cdc_flow.go | 13 +++++++------ flow/workflows/qrep_flow.go | 13 +++++++------ nexus/flow-rs/src/grpc.rs | 5 +++-- protos/flow.proto | 12 ++++++------ ui/app/mirrors/create/helpers/common.ts | 4 ++-- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/flow/.golangci.yml b/flow/.golangci.yml index 4403f2bfda..d54f05344d 100644 --- a/flow/.golangci.yml +++ b/flow/.golangci.yml @@ -63,6 +63,8 @@ linters-settings: enable-all: true disable: - shadow + staticcheck: + checks: ["all", "-ST1019"] stylecheck: checks: - all diff --git a/flow/workflows/cdc_flow.go b/flow/workflows/cdc_flow.go index 54eda096e8..03f0813f32 100644 --- a/flow/workflows/cdc_flow.go +++ b/flow/workflows/cdc_flow.go @@ -1,3 +1,4 @@ +//nolint:staticcheck // TODO remove in 0.15 package peerflow import ( @@ -262,14 +263,14 @@ func CDCFlowWorkflow( // TODO remove fields in 0.15 state.RelationMessageMapping = nil save_cfg := false - if cfg.SourceDeprecated != nil { - cfg.SourceName = cfg.SourceDeprecated.Name - cfg.SourceDeprecated = nil + if cfg.Source != nil { + cfg.SourceName = cfg.Source.Name + cfg.Source = nil save_cfg = true } - if cfg.DestinationDeprecated != nil { - cfg.DestinationName = cfg.DestinationDeprecated.Name - cfg.DestinationDeprecated = nil + if cfg.Destination != nil { + cfg.DestinationName = cfg.Destination.Name + cfg.Destination = nil save_cfg = true } if save_cfg { diff --git a/flow/workflows/qrep_flow.go b/flow/workflows/qrep_flow.go index 3d5bd08f4d..127a6ec14b 100644 --- a/flow/workflows/qrep_flow.go +++ b/flow/workflows/qrep_flow.go @@ -1,3 +1,4 @@ +//nolint:staticcheck // TODO remove in 0.15 package peerflow import ( @@ -554,14 +555,14 @@ func QRepFlowWorkflow( // TODO remove fields in 0.15 state.DisableWaitForNewRows = false save_cfg := false - if config.SourceDeprecated != nil { - config.SourceName = config.SourceDeprecated.Name - config.SourceDeprecated = nil + if config.SourcePeer != nil { + config.SourceName = config.SourcePeer.Name + config.SourcePeer = nil save_cfg = true } - if config.DestinationDeprecated != nil { - config.DestinationName = config.DestinationDeprecated.Name - config.DestinationDeprecated = nil + if config.DestinationPeer != nil { + config.DestinationName = config.DestinationPeer.Name + config.DestinationPeer = nil save_cfg = true } if save_cfg { diff --git a/nexus/flow-rs/src/grpc.rs b/nexus/flow-rs/src/grpc.rs index ac8fbe4fc3..15e0130dd4 100644 --- a/nexus/flow-rs/src/grpc.rs +++ b/nexus/flow-rs/src/grpc.rs @@ -154,9 +154,10 @@ impl FlowGrpcClient { return anyhow::Result::Err(anyhow::anyhow!("invalid system {}", job.system)); }; + #[allow(deprecated)] let mut flow_conn_cfg = pt::peerdb_flow::FlowConnectionConfigs { - source_deprecated: None, - destination_deprecated: None, + source: None, + destination: None, source_name: src, destination_name: dst, flow_job_name: job.name.clone(), diff --git a/protos/flow.proto b/protos/flow.proto index e3fe050c1b..dc89510dfd 100644 --- a/protos/flow.proto +++ b/protos/flow.proto @@ -39,8 +39,8 @@ message SetupInput { message FlowConnectionConfigs { string flow_job_name = 1; - peerdb_peers.Peer source_deprecated = 2; // deprecated - peerdb_peers.Peer destination_deprecated = 3; // deprecated + peerdb_peers.Peer source = 2 [deprecated = true]; + peerdb_peers.Peer destination = 3 [deprecated = true]; // config for the CDC flow itself // currently, TableMappings, MaxBatchSize and IdleTimeoutSeconds are dynamic via Temporal signals @@ -107,7 +107,7 @@ message CreateTablesFromExistingOutput { message SyncFlowOptions { uint32 batch_size = 1; - map relation_message_mapping = 2; // deprecated + map relation_message_mapping = 2 [deprecated = true]; uint64 idle_timeout_seconds = 3; map src_table_id_name_mapping = 4; map table_name_schema_mapping = 5; @@ -257,8 +257,8 @@ enum TypeSystem { message QRepConfig { string flow_job_name = 1; - peerdb_peers.Peer source_deprecated = 2; // deprecated - peerdb_peers.Peer destination_deprecated = 3; // deprecated + peerdb_peers.Peer source_peer = 2 [deprecated = true]; + peerdb_peers.Peer destination_peer = 3 [deprecated = true]; string destination_table_identifier = 4; @@ -337,7 +337,7 @@ message QRepFlowState { QRepPartition last_partition = 1; uint64 num_partitions_processed = 2; bool needs_resync = 3; - bool disable_wait_for_new_rows = 4; // deprecated + bool disable_wait_for_new_rows = 4 [deprecated = true]; FlowStatus current_flow_status = 5; } diff --git a/ui/app/mirrors/create/helpers/common.ts b/ui/app/mirrors/create/helpers/common.ts index 2cd5706487..65724ec8de 100644 --- a/ui/app/mirrors/create/helpers/common.ts +++ b/ui/app/mirrors/create/helpers/common.ts @@ -21,8 +21,8 @@ export interface MirrorSetting { } export const blankCDCSetting: CDCConfig = { - sourceDeprecated: undefined, - destinationDeprecated: undefined, + source: undefined, + destination: undefined, sourceName: '', destinationName: '', flowJobName: '',