Open djjuhasz opened 8 months ago
Some additional context: the "bundler" was first developed as part of the RDSS Archivematica Channel Adapter back in mid 2017 (amclient.TransferSession) because we needed to package Archivematica transfers with additional metadata retrieved from messages coming from the RDSS message broker. It then became the bundler package in legacy Enduro with the only goal of packaging the transfer but not dealing with its submission. But as you described it's been pretty much dead code. I would also not be surprised if you think it needs some refactoring, I would certainly not use afero today if I was writing it again.
Describe the bug
The bunder.Bundle() method calls
b.metadata.Write()
and three methods to write checksum files with MD5, SHA1, and SHA256 algorithms; but none of the four called methods write a file as intended. As a result most of the code in internal/bundler/metadata.go is unused.To Reproduce
Steps to reproduce the behavior:
Most of the
metadata.go
code is not run by the tests, though it should be run by the "Bundles a single file" test. Note also that the current test expects no files in themetadata/
subdirectory, and would error ifmetadata.csv
or any of the checksum files were present.Expected behavior
Bundler.Bundle()
should write four files to the bundlemetadata/
directory:OR the code to write the above files should be removed.
Screenshots
Additional context
MetadataSet.entries
map or theChecksumSet.values
map, so when theWrite()
methods are called on these structs, there is no data to write.NewMetadataSet()
andNewChecksumSet()
(x3) with an empty copy of theb.fs
filesystem. When the respectiveWrite()
methods are called later, this empty copy ofafero.Fs
is used.