Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloader rework #481
Downloader rework #481
Changes from 13 commits
f41b05d
8b706cd
b9d55fa
c2cd603
a849e48
5a302b1
93939e1
568b203
6f070b1
689315d
2f49462
71d8eb2
63ac5a3
f64ce53
61b29c7
a56cd95
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the corresponding removal in
AdvancedHttpDownloader
break certain tests such as the CLI test forDownloadAndInstallMod
(DownloadAndInstallMod -> DownloadModFromUrl
).The problem specifically is that the systems under test will have
IHttpDownloader
injected into them; and the DI mappings for that interface isn't remappable on the fly. We need:There's multiple possible approaches here; I have no particular preference as to which we use.
Here are some.
A. Restore the code for downloading from local
file://
URIs.This is a simple approach, and this code will only ever be used by the tests that require them; while the app gains support for a new URI scheme.
While it's not strictly part of
HTTP
to support this scheme, it's commonly supported in browsers and web technologies.B. Host the data at a static location.
Either on the Nexus, the same way we have
http://miami.nexus-cdn.com/100M
and friends.Or make a GitHub Release on a dummy repo and upload the files as assets; these have stable URLs.
https://github.com/{{organisation}}/{{repo}}/releases/download/{{tag}}/{{fileName}}
.C. Extend
LocalHttpServer
to serve files from LocalHost (this machine).Alternative solution that requires we bootstrap the server in all tests that run on local files.
Not trivial to do in 5 minutes unless you know the APIs, but even if you don't some AI wouldn't hurt there.
I have no preference for any of the choices. Just note that if you go with B/C, or another option, also delete
LocalFileDownloader
as it will be dead code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the tests are broken, so I'll fix that, I forgot I removed that code. But in general I don't like inserting overrides into classes where DI can do the trick instead.