Skip to content

Commit

Permalink
protos(feature): Update protocol buffers (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
solidiquis authored Jul 11, 2024
1 parent 4dbc547 commit 25e2733
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 195 deletions.
4 changes: 2 additions & 2 deletions protos/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ deps:
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: f04e50c23f5f40f786d0e8fa3fe3d713
digest: shake256:67b115260e12cb2d6c5d5ce8dbbf3a095c86f0e52b84f9dbd16dec9433b218f8694bc9aadb1d45eb6fd52f5a7029977d460e2d58afb3208ab6c680e7b21c80e4
commit: a48fcebcf8f140dd9d09359b9bb185a4
digest: shake256:a926173f0ec3e1a929462c350acda846e546134b5ce2bb83fe44f02f9330a42b1c9b292f64b951b06a4d2c47e2ce4d477d6a2cb31502a15637ada35ecedefcf6
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ enum ExpressionMode {
EXPRESSION_MODE_UNSPECIFIED = 0 [deprecated = true];
EXPRESSION_MODE_RULES = 1;
EXPRESSION_MODE_CALCULATED_CHANNELS = 2;
EXPRESSION_MODE_RULER = 3;
}

message ValidateExpressionRequest {
Expand Down
2 changes: 2 additions & 0 deletions protos/sift/data/v1/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ message CalculatedChannelQuery {
// If set to the empty string, only non-run data is returned.
// If unset, all run / non-run data is returned.
optional string run_id = 3;
// Optional. If unset, will default to EXPRESSION_MODE_CALCULATED_CHANNELS.
optional sift.calculated_channels.v1.ExpressionMode mode = 4;
}

message GetDataResponse {
Expand Down
19 changes: 16 additions & 3 deletions protos/sift/rules/v1/rules.proto
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ service RuleService {
}

message Rule {
// 5 is reserved from old "current_status" column directly on rule
reserved 5;
string rule_id = 1 [(google.api.field_behavior) = REQUIRED];
string asset_id = 2 [(google.api.field_behavior) = REQUIRED];
string name = 3 [(google.api.field_behavior) = REQUIRED];
string description = 4 [(google.api.field_behavior) = REQUIRED];
string current_status = 5 [(google.api.field_behavior) = REQUIRED];
bool is_enabled = 6 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp created_date = 7 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp modified_date = 8 [(google.api.field_behavior) = REQUIRED];
Expand All @@ -182,10 +183,11 @@ message Rule {
repeated RuleCondition conditions = 12 [(google.api.field_behavior) = REQUIRED];
}
message RuleCondition {
// 4 is reserved from old "status" column that lived directly on rule condition
reserved 4;
string rule_condition_id = 1 [(google.api.field_behavior) = REQUIRED];
string rule_id = 2 [(google.api.field_behavior) = REQUIRED];
RuleConditionExpression expression = 3 [(google.api.field_behavior) = REQUIRED];
string status = 4 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp created_date = 5 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp modified_date = 6 [(google.api.field_behavior) = REQUIRED];
string created_by_user_id = 7 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -260,8 +262,9 @@ message UpdateRuleRequest {
string organization_id = 7;
}
message UpdateConditionRequest {
// 2 is reserved from old status update support on rule condition directly
reserved 2;
optional string rule_condition_id = 1;
string status = 2 [(google.api.field_behavior) = REQUIRED];
RuleConditionExpression expression = 3 [(google.api.field_behavior) = REQUIRED];
repeated UpdateActionRequest actions = 4 [(google.api.field_behavior) = REQUIRED];
}
Expand Down Expand Up @@ -409,6 +412,7 @@ message EvaluateRulesRequest {
string run_id = 3;
TimeRangeQuery time_range = 4;
}
bool dry_run = 5;
}
message EvaluatedAnnotationOptions {
repeated string tag_ids = 1;
Expand All @@ -420,4 +424,13 @@ message TimeRangeQuery {

message EvaluateRulesResponse {
int32 created_annotation_count = 1;
// If dry_run is true, this will be populated with the annotations that would be created
repeated DryRunAnnotation dry_run_annotations = 2;
}

message DryRunAnnotation {
string condition_id = 1;
string name = 2;
google.protobuf.Timestamp start_time = 3;
google.protobuf.Timestamp end_time = 4;
}
2 changes: 1 addition & 1 deletion python/lib/google/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ class _ExpressionModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper.
EXPRESSION_MODE_UNSPECIFIED: _ExpressionMode.ValueType # 0
EXPRESSION_MODE_RULES: _ExpressionMode.ValueType # 1
EXPRESSION_MODE_CALCULATED_CHANNELS: _ExpressionMode.ValueType # 2
EXPRESSION_MODE_RULER: _ExpressionMode.ValueType # 3

class ExpressionMode(_ExpressionMode, metaclass=_ExpressionModeEnumTypeWrapper): ...

EXPRESSION_MODE_UNSPECIFIED: ExpressionMode.ValueType # 0
EXPRESSION_MODE_RULES: ExpressionMode.ValueType # 1
EXPRESSION_MODE_CALCULATED_CHANNELS: ExpressionMode.ValueType # 2
EXPRESSION_MODE_RULER: ExpressionMode.ValueType # 3
global___ExpressionMode = ExpressionMode

@typing.final
Expand Down
Loading

0 comments on commit 25e2733

Please sign in to comment.