-
Notifications
You must be signed in to change notification settings - Fork 9
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
minoc: filename override mechanism #551
Conversation
maybe not require banning colon from path components of artifact.uri
//log.debug("base url for site " + storageSite.getResourceID() + ": " + baseURL); | ||
if (protocolCompat(proto, baseURL)) { | ||
// // no plain anon URL for put: !anon or anon+token | ||
boolean gen = (!anon || (anon && authToken != null)); |
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.
From what I'm seeing, the pushTo
and pullFrom
loops are pretty similar except this and the file name override. Would it be possible (or worth it) to avoid the code duplication?
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.
maybe, but iirc there were enough subtle differences that made that more complex. I think you originally wrote it and convinced me of that, although now there's plenty of git blame
to go around :-)
Assert.assertEquals(sites.size(), result1.size()); | ||
Assert.assertTrue(result1.containsAll(sites)); | ||
|
||
List<StorageSite> result2 = ProtocolsGenerator.prioritizePullFromSites(sites); |
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.
What is this testing?
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.
it is just testing that pull from prioritization is random by those two sets not being the same order
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.
OK. Does it mean that it is possible to give a false positive when random randomly returns the same order?
assertCorrectPath("token/cadc:vault/uuid:fo/something.fits", "cadc:vault/uuid", "token", "something.fits"); | ||
|
||
assertCorrectPath("cadc:vault/uuid:/something.fits", "cadc:vault/uuid:/something.fits", null, null); | ||
|
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.
How does it handle the cadc:vault/uuid:fo/
case?
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 just tests that extra colons do not cause parts of the path to be lost (are preserved in the artifact uri); it is easy to implement the extraction in ways that lose stuff (eg if you split on colon and then it isn't a :fo/
)
the previous test checks that :fo/
is extracted and becomes the override filename
I probably could have used a non-vault looking uri to make it more obvious that it was "don't break other uses of colon in the uri".
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.
Sorry for being too vague, what I've meant is the incorrect case in which the URL ends in :fo/
.
No description provided.