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

Fallback Pipeline addition in core/v2 #16

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ManishaKumari295
Copy link

@ManishaKumari295 ManishaKumari295 commented Jul 18, 2024

Related to Fallback-pipeline execution task [https://github.com/sensu/sensu-enterprise-go/issues/1918]
Addition of FallbackPipeline Resource in core/v2 and related yaml structure

Signed-off-by: manisha kumari <[email protected]>
@@ -168,9 +168,13 @@ message CheckConfig {
// Pipelines are the pipelines this check will use to process its events.
repeated ResourceReference pipelines = 32 [ (gogoproto.jsontag) = "pipelines" ];

repeated MetricThreshold output_metric_thresholds = 33 [ (gogoproto.jsontag) = "output_metric_thresholds,omitempty", (gogoproto.moretags) = "yaml: \"output_metric_thresholds,omitempty\"" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we need to avoid changing field numbers since they're used for serialization/deserialization. We might end up with a scenario where the data was stored with field number 33 in etcd and read back with field number 34, effectively breaking serialization.

v2/check.proto Outdated
// MetricThresholds are a list of thresholds to apply to metrics in order to determine
// the check status.
repeated MetricThreshold output_metric_thresholds = 47 [ (gogoproto.jsontag) = "output_metric_thresholds,omitempty", (gogoproto.moretags) = "yaml: \"output_metric_thresholds,omitempty\"" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about field numbers.

v2/check.proto Outdated
@@ -328,11 +332,14 @@ message Check {
// Pipelines are the pipelines this check will use to process its events.
repeated ResourceReference pipelines = 46 [ (gogoproto.jsontag) = "pipelines" ];

//fallback pieplines detials in order of execution
repeated ResourceReference fallback_pipeline = 47 [ (gogoproto.jsontag) = "fallback_pipeline" ,(gogoproto.moretags) = "yaml: \"fallback_pipeline,omitempty\"" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

If there can be more than one this field should be plural (fallback_pipelines).

v2/check.proto Outdated
@@ -328,11 +332,14 @@ message Check {
// Pipelines are the pipelines this check will use to process its events.
repeated ResourceReference pipelines = 46 [ (gogoproto.jsontag) = "pipelines" ];

//fallback pieplines detials in order of execution
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: should be details

v2/secret.proto Outdated
@@ -1,7 +1,7 @@
syntax = "proto3";

import "github.com/gogo/[email protected]/gogoproto/gogo.proto";
import "github.com/sensu/core/v2/meta.proto";
//import "github.com/sensu/core/v2/meta.proto";
Copy link
Contributor

Choose a reason for hiding this comment

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

If not used it should be removed.

v2/types_gen.go Outdated
// this at the time of this writing.

//
//TODO: go build will build the latest version of the protoc-gen-gofast module
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I think your editor might be removing the spaces after // in comments. We probably want the spaces for consistency.

//FallbackPipelineListflow Pipelinelist = 2 [ (gogoproto.jsontag) = "pipelinelist", (gogoproto.moretags) = "yaml: \"pipelinelist\"" ];
repeated ResourceReference pipelist =2 [ (gogoproto.jsontag) = "pipelinelist", (gogoproto.moretags) = "yaml: \"pipelinelist\"" ];
}

Copy link
Contributor

@fguimond fguimond Jul 23, 2024

Choose a reason for hiding this comment

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

Nitpick: no need for the extra empty lines.


// FallbackpipelineList contains one or more pipeline list.
//FallbackPipelineListflow Pipelinelist = 2 [ (gogoproto.jsontag) = "pipelinelist", (gogoproto.moretags) = "yaml: \"pipelinelist\"" ];
repeated ResourceReference pipelist =2 [ (gogoproto.jsontag) = "pipelinelist", (gogoproto.moretags) = "yaml: \"pipelinelist\"" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it Pipelinelist or pipelist? I believe it should be PipelineList with camel-case.

Signed-off-by: manisha kumari <[email protected]>
Signed-off-by: manisha kumari <[email protected]>
Signed-off-by: manisha kumari <[email protected]>
Signed-off-by: manisha kumari <[email protected]>
Signed-off-by: manisha kumari <[email protected]>
Signed-off-by: manisha kumari <[email protected]>
Signed-off-by: manisha kumari <[email protected]>
@ManishaKumari295
Copy link
Author

@fguimond addressed all review points

Signed-off-by: manisha kumari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants