@@ -15,6 +15,7 @@ import (
1515 "github.com/artefactual-labs/enduro/internal/nha"
1616 nha_activities "github.com/artefactual-labs/enduro/internal/nha/activities"
1717 "github.com/artefactual-labs/enduro/internal/pipeline"
18+ "github.com/artefactual-labs/enduro/internal/validation"
1819 "github.com/artefactual-labs/enduro/internal/watcher"
1920 "github.com/artefactual-labs/enduro/internal/workflow/activities"
2021 "github.com/artefactual-labs/enduro/internal/workflow/manager"
@@ -208,7 +209,7 @@ func (w *ProcessingWorkflow) Execute(ctx workflow.Context, req *collection.Proce
208209 return fmt .Errorf ("error creating session: %v" , err )
209210 }
210211
211- sessErr = w .SessionHandler (sessCtx , attempt , tinfo , nameInfo )
212+ sessErr = w .SessionHandler (sessCtx , attempt , tinfo , nameInfo , req . ValidationConfig )
212213
213214 // We want to retry the session if it has been canceled as a result
214215 // of losing the worker but not otherwise. This scenario seems to be
@@ -283,7 +284,7 @@ func (w *ProcessingWorkflow) Execute(ctx workflow.Context, req *collection.Proce
283284}
284285
285286// SessionHandler runs activities that belong to the same session.
286- func (w * ProcessingWorkflow ) SessionHandler (sessCtx workflow.Context , attempt int , tinfo * TransferInfo , nameInfo nha.NameInfo ) error {
287+ func (w * ProcessingWorkflow ) SessionHandler (sessCtx workflow.Context , attempt int , tinfo * TransferInfo , nameInfo nha.NameInfo , validationConfig validation. Config ) error {
287288 defer func () {
288289 _ = releasePipeline (sessCtx , w .manager , tinfo .Event .PipelineName )
289290 workflow .CompleteSession (sessCtx )
@@ -328,6 +329,23 @@ func (w *ProcessingWorkflow) SessionHandler(sessCtx workflow.Context, attempt in
328329 }
329330 }
330331
332+ // Validate transfer.
333+ {
334+ if validationConfig .IsEnabled () && tinfo .Bundle != (activities.BundleActivityResult {}) {
335+ activityOpts := workflow .WithActivityOptions (sessCtx , workflow.ActivityOptions {
336+ ScheduleToStartTimeout : forever ,
337+ StartToCloseTimeout : time .Minute * 5 ,
338+ })
339+ err := workflow .ExecuteActivity (activityOpts , activities .ValidateTransferActivityName , & activities.ValidateTransferActivityParams {
340+ Config : validationConfig ,
341+ Path : tinfo .Bundle .FullPath ,
342+ }).Get (activityOpts , nil )
343+ if err != nil {
344+ return err
345+ }
346+ }
347+ }
348+
331349 // Transfer.
332350 {
333351 if tinfo .TransferID == "" {
0 commit comments