Skip to content

Commit

Permalink
Don't rename fields
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jun 20, 2024
1 parent 4739e49 commit c2e4231
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
2 changes: 2 additions & 0 deletions flow/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ linters-settings:
enable-all: true
disable:
- shadow
staticcheck:
checks: ["all", "-ST1019"]
stylecheck:
checks:
- all
Expand Down
13 changes: 7 additions & 6 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:staticcheck // TODO remove in 0.15
package peerflow

import (
Expand Down Expand Up @@ -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 {
Expand Down
13 changes: 7 additions & 6 deletions flow/workflows/qrep_flow.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:staticcheck // TODO remove in 0.15
package peerflow

import (
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions nexus/flow-rs/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
12 changes: 6 additions & 6 deletions protos/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -107,7 +107,7 @@ message CreateTablesFromExistingOutput {

message SyncFlowOptions {
uint32 batch_size = 1;
map<uint32, RelationMessage> relation_message_mapping = 2; // deprecated
map<uint32, RelationMessage> relation_message_mapping = 2 [deprecated = true];
uint64 idle_timeout_seconds = 3;
map<uint32, string> src_table_id_name_mapping = 4;
map<string, TableSchema> table_name_schema_mapping = 5;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions ui/app/mirrors/create/helpers/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export interface MirrorSetting {
}

export const blankCDCSetting: CDCConfig = {
sourceDeprecated: undefined,
destinationDeprecated: undefined,
source: undefined,
destination: undefined,
sourceName: '',
destinationName: '',
flowJobName: '',
Expand Down

0 comments on commit c2e4231

Please sign in to comment.