Closed stschiff closed 1 year ago
Patch coverage: 78.94%
and project coverage change: +0.25%
:tada:
Comparison is base (
2025835
) 69.55% compared to head (818e209
) 69.81%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I added an --archive
option to list
and fetch
-- as discussed. I also included the archive functionality to the unit tests. I'll merge this now.
OK, so I've implemented a new feature that now makes the server host multiple independent archives. The command line works like this:
So internally, all base directories are associated with an archive name, and multiple base directories can be associated to multiple archive-names. They are then of course internally combined.
The APIs work like before, but now use a new parameter in the query-string named
archive
. So for examplehttp://server/zip_file/myPac?archive=myArchive2
will tell the server that it should look for the package undermyArchive2
.If no
archive
parameter is given, the server will automatically select the first of the archives given on the command line.If an archive is selected that does not exist, the server will raise an HTTP 500 error, with a meaningful error message. Our client current does not process this, I think, so this would be something to take care of.
Here are a few test command lines that may be useful for testing:
This would then serve two archives, one with two packages, one with one.
Here are some example queries:
curl 'http://localhost:3000/packages'
-> This will yield the packages of archivemyArch
(the default)curl 'http://localhost:3000/packages?archive=asda'
-> This will yield an error listing the possible archivescurl 'http://localhost:3000/packages?archive=myArch2'
-> This will yield packages from archivemyArch2
curl 'http://localhost:3000/zip_file/Wang_2020?archive=myArch2'
-> This will complain that there is no package with that name in that archivecurl 'http://localhost:3000/zip_file/Wang_2020?archive=myArch' --output Wang_2020.zip
-> This will download the package.I think this fulfils the minimal requirements server-side. The next step is to implement this feature client-wise, which should be fairly straight forward.