tarun-google commented on code in PR #37974:
URL: https://github.com/apache/beam/pull/37974#discussion_r3184281765
##########
sdks/go/pkg/beam/artifact/materialize.go:
##########
@@ -511,3 +522,25 @@ func queue2slice(q chan *jobpb.ArtifactMetadata)
[]*jobpb.ArtifactMetadata {
}
return ret
}
+
+type contextKey string
+
+const pipelineOptionsKey contextKey = "pipeline_options"
+
+// WithPipelineOptions returns a new context carrying the full pipeline
options struct.
+func WithPipelineOptions(ctx context.Context, options *structpb.Struct)
context.Context {
+ return context.WithValue(ctx, pipelineOptionsKey, options)
+}
+
+// isArtifactValidationEnabled parses pipeline options to check if
"disable_integrity_checks" is enabled.
+func isArtifactValidationEnabled(ctx context.Context) bool {
+ options, _ := ctx.Value(pipelineOptionsKey).(*structpb.Struct)
+ if options != nil {
+ for _, v := range
options.GetFields()["options"].GetStructValue().GetFields()["experiments"].GetListValue().GetValues()
{
Review Comment:
Added new util in artifact package. options to get experiments/check for
flag.
I did not follow the conventions of
PR(https://github.com/apache/beam/pull/37492) I prefer the abstraction to take
in struct(original data type) instead of string. adding this util in artifact
make it useful across all go/python/java boot.go containers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]