Skip to content

Commit

Permalink
WIP: Send zipped Bags to Archivematica
Browse files Browse the repository at this point in the history
[skip-codecov]
  • Loading branch information
jraddaoui committed Aug 9, 2024
1 parent 751f1bf commit 6294306
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion internal/am/start_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (a *StartTransferActivity) Execute(

payload, resp, err := a.amps.Create(ctx, &amclient.PackageCreateRequest{
Name: opts.Name,
Type: "zipfile",
Type: "zipped bag",
Path: opts.Path,
ProcessingConfig: processingConfig,
AutoApprove: true,
Expand Down
4 changes: 2 additions & 2 deletions internal/am/start_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestStartTransferActivity(t *testing.T) {
mockutil.Context(),
&amclient.PackageCreateRequest{
Name: opts.Name,
Type: "zipfile",
Type: "zipped bag",
Path: opts.Path,
ProcessingConfig: "automated",
AutoApprove: true,
Expand All @@ -59,7 +59,7 @@ func TestStartTransferActivity(t *testing.T) {
mockutil.Context(),
&amclient.PackageCreateRequest{
Name: opts.Name,
Type: "zipfile",
Type: "zipped bag",
Path: opts.Path,
ProcessingConfig: "automated",
AutoApprove: true,
Expand Down
4 changes: 2 additions & 2 deletions internal/workflow/processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ func (w *ProcessingWorkflow) SessionHandler(
}

// Bundle PIP as an Archivematica standard transfer.
{
if !w.cfg.Preprocessing.Enabled {
// For the a3m workflow bundle the transfer to a directory shared with
// the a3m container.
var transferDir string
Expand Down Expand Up @@ -1036,7 +1036,7 @@ func (w *ProcessingWorkflow) preprocessing(ctx temporalsdk_workflow.Context, tin
return err
}

tinfo.TempPath = filepath.Join(w.cfg.Preprocessing.SharedPath, filepath.Clean(ppResult.RelativePath))
tinfo.Bundle.FullPath = filepath.Join(w.cfg.Preprocessing.SharedPath, filepath.Clean(ppResult.RelativePath))
tinfo.IsDir = true

// Save preprocessing preservation task data.
Expand Down
13 changes: 1 addition & 12 deletions internal/workflow/processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,17 +908,6 @@ func (s *ProcessingWorkflowTestSuite) TestPreprocessingChildWorkflow() {
&activities.ClassifyPackageActivityResult{Type: enums.PackageTypeUnknown}, nil,
)

s.env.OnActivity(activities.BundleActivityName, sessionCtx,
&activities.BundleActivityParams{
SourcePath: prepDest,
TransferDir: s.transferDir,
IsDir: true,
},
).Return(
&activities.BundleActivityResult{FullPath: transferPath},
nil,
)

s.env.OnActivity(a3m.CreateAIPActivityName, sessionCtx, mock.AnythingOfType("*a3m.CreateAIPActivityParams")).
Return(nil, nil).
Once()
Expand Down Expand Up @@ -953,7 +942,7 @@ func (s *ProcessingWorkflowTestSuite) TestPreprocessingChildWorkflow() {
s.env.OnActivity(
filesys.RemoveActivityName,
sessionCtx,
&filesys.RemoveActivityParams{Paths: []string{downloadDir, transferPath}},
&filesys.RemoveActivityParams{Paths: []string{downloadDir}},
).Return(&filesys.RemoveActivityResult{}, nil)
s.env.OnActivity(activities.DeleteOriginalActivityName, sessionCtx, watcherName, key).Return(nil, nil).Once()

Expand Down

0 comments on commit 6294306

Please sign in to comment.