Skip to content

WS-1431: Implementing --for-download mode

Daniel Lyons requested to merge WS-1431-fetcher-for-downloads into 2.8-DEVELPMENT

Another big one, sorry!

There are a few changes in play here:

  • Formerly, LocatedFile just wrote files to whatever path it knew about. Now there is a FetchContext that it collaborates with to determine the location.
  • Because of this, I made FetchContext into an interface and replaced the plumbing of ForceMode with FetchContext, since it has the ForceMode on it anyway, and I don't want to keep widening the APIs
  • There is now a ProductMetadata type, service, and corresponding fetcher. This required making FetchPlan a decorator too, since it didn't seem like there was a good way to interpose creating the singular products.json file as a normal FileFetcher instance. This also means it isn't part of the progress reporting system, but it's probably OK because it's always cheap to generate
  • We have a new command line option for choosing the destination, using the aforementioned plumbing
  • The --for-download option now works by conditionalizing how the destination path is generated and decorating the overall FetchPlan

It would be good to add some tests for the Metadata stuff, but I think this MR is basically ready to go.

Merge request reports