Skip to content

Commit

Permalink
feat(strm-2703): use optional in proto messages for primitive types
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-p92 committed Oct 25, 2023
1 parent cf105bc commit 895ec44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jooqVersion=3.18.7
# TODO verify the tag is correct
dockertag = ghcr.io/getstrm/pace:latest

generatedBufDependencyVersion=00000000000000.609525407a2f
generatedBufDependencyVersion=00000000000000.4c112bea69d1
14 changes: 8 additions & 6 deletions protos/getstrm/api/data_policies/v1alpha/entities_v1alpha.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ message DataPolicy {

message Info {
string title = 1;
string description = 2;
optional string description = 2;
string version = 3;
string organization_id = 4;
string context = 4;
google.protobuf.Timestamp create_time = 5;
google.protobuf.Timestamp update_time = 6;
repeated string tags = 7;
Expand Down Expand Up @@ -53,14 +53,15 @@ message DataPolicy {
string statement = 1;
}
message Hash {
int64 seed = 1;
optional int64 seed = 1;
}
message FixedValue {
string value = 1;
}
// Todo: we probably should create a separate RegexExtract, since a RegexReplace with empty replacement is functionally different.
message RegexReplace {
string regex = 1;
string replacement = 2;
optional string replacement = 2;
}
message Nullify {
}
Expand Down Expand Up @@ -95,6 +96,7 @@ message DataPolicy {
// Note: we are currently not using the string-based spec after all. Using the Attributes instead improves
// testability and should make it easier for the frontend to render the policy. Otherwise the frontend
// would have to parse the string-based spec.
// Todo: remove the string-based spec for now?
string spec = 3;

// attributes are leading.
Expand All @@ -119,8 +121,6 @@ message DataPolicy {
string type = 2;
bool required = 3;
repeated string tags = 4;

// TODO add repeated?
}
}

Expand All @@ -137,10 +137,12 @@ message DataCatalog {
DATAHUB = 3;
}

// Todo: apart from the discussion on hierarchy vs. flat, Database is written without uppercase B.
message DataBase {
string id = 1;
string type = 2;
string display_name = 3;
// Todo: complete parent/child objects instead of ids can sometimes result in some cyclic issues.
DataCatalog catalog = 4;
repeated Schema schemas = 5;
repeated string tags = 6;
Expand Down

0 comments on commit 895ec44

Please sign in to comment.