Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface changes revision-2 #58

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions common.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";
option optimize_for = SPEED;
option java_multiple_files = true;
option go_package = "fivetran.com/fivetran_sdk";
package fivetran_sdk;
option go_package = "fivetran.com/fivetran_sdk_r2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the package name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are introducing breaking changes and will use the identifier revision (r2) to denote the version for these updates.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgewfraser as we discussed during the previous meeting, we need to be able to run one version in production while we need to be able to build and release different interface version in the testers to give to the partners. Since the testers are in the engineering repo too, there is no way to have two versions of grpc interface in the same package. So we introduced the "_r2" for "revision 2". (We chose to replace "version" with "revision" to indicate we are not going to use versions)

package fivetran_sdk.r2;

import "google/protobuf/timestamp.proto";

Expand All @@ -25,6 +25,8 @@ message FormField {
DropdownField dropdown_field = 6;
ToggleField toggle_field = 7;
}
optional string default_value = 8;
optional string placeholder = 9;
}

message DropdownField {
Expand Down Expand Up @@ -53,7 +55,6 @@ message TestResponse {
oneof response {
bool success = 1;
string failure = 2;
// potential future warning
}
}

Expand Down Expand Up @@ -86,14 +87,22 @@ enum DataType {
XML = 12;
STRING = 13;
JSON = 14;
NAIVE_TIME = 15;
}

message DataTypeParams {
oneof params {
DecimalParams decimal = 1;
int32 string_byte_length = 2;
}
}

message DecimalParams {
uint32 precision = 1;
uint32 scale = 2;
}

enum OpType {
enum RecordType {
UPSERT = 0;
UPDATE = 1;
DELETE = 2;
Expand All @@ -117,6 +126,7 @@ message ValueType {
string string = 13;
string json = 14;
string xml = 15;
google.protobuf.Timestamp naive_time = 16;
}
}

Expand All @@ -129,5 +139,5 @@ message Column {
string name = 1;
DataType type = 2;
bool primary_key = 3;
optional DecimalParams decimal = 4;
optional DataTypeParams params = 4;
}
28 changes: 5 additions & 23 deletions connector_sdk.proto
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
syntax = "proto3";
option optimize_for = SPEED;
option java_multiple_files = true;
option go_package = "fivetran.com/fivetran_sdk";
package fivetran_sdk;
option go_package = "fivetran.com/fivetran_sdk_r2";
package fivetran_sdk.r2;

import "common.proto";

// Fivetran (grpc client) <> Connector (grpc server)
service Connector {
// Fivetran (grpc client) <> SourceConnector (grpc server)
service SourceConnector {
rpc ConfigurationForm (ConfigurationFormRequest) returns (ConfigurationFormResponse) {}
rpc Test (TestRequest) returns (TestResponse) {}
rpc Schema (SchemaRequest) returns (SchemaResponse) {}
Expand Down Expand Up @@ -65,24 +65,6 @@ message TableSelection {
}

message UpdateResponse {
oneof response {
LogEntry log_entry = 1;
Operation operation = 2;
}
}

enum LogLevel {
INFO = 0;
WARNING = 1;
SEVERE = 2;
}

message LogEntry {
LogLevel level = 1;
string message = 2;
}

message Operation {
oneof op {
manjutapali marked this conversation as resolved.
Show resolved Hide resolved
Record record = 1;
SchemaChange schema_change = 2;
Expand All @@ -100,7 +82,7 @@ message SchemaChange {
message Record {
optional string schema_name = 1;
string table_name = 2;
OpType type = 3;
RecordType type = 3;
map<string, ValueType> data = 4;
}

Expand Down
10 changes: 5 additions & 5 deletions destination_sdk.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
syntax = "proto3";
option optimize_for = SPEED;
option java_multiple_files = true;
option go_package = "fivetran.com/fivetran_sdk";
package fivetran_sdk;
option go_package = "fivetran.com/fivetran_sdk_r2";
package fivetran_sdk.r2;

import "google/protobuf/timestamp.proto";
import "common.proto";

// Fivetran (grpc client) <> Destination (grpc server)
service Destination {
// Fivetran (grpc client) <> DestinationConnector (grpc server)
service DestinationConnector {
rpc ConfigurationForm (ConfigurationFormRequest) returns (ConfigurationFormResponse) {}
rpc Capabilities (CapabilitiesRequest) returns (CapabilitiesResponse) {}
rpc Test (TestRequest) returns (TestResponse) {}
Expand Down Expand Up @@ -75,7 +75,7 @@ message TruncateRequest {
}

message SoftTruncate {
string deleted_column = 3;
string deleted_column = 1;
}

message TruncateResponse {
Expand Down
Loading