tarun-google commented on code in PR #37974:
URL: https://github.com/apache/beam/pull/37974#discussion_r3183132042
##########
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:
Agree, but we can consider this broader re-factoring in later PR?
--
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]