tvalentyn commented on code in PR #37974:
URL: https://github.com/apache/beam/pull/37974#discussion_r3183829875


##########
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:
   how about we define the function in a common location without refactoring 
other places for now? so that at least new usages for parsing experiments can 
reference the code you created. WDYT?



-- 
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]

Reply via email to