Skip to content
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

Merged
merged 9 commits into from
Jan 26, 2024
Merged

minoc: filename override mechanism #551

merged 9 commits into from
Jan 26, 2024

Conversation

pdowler
Copy link
Member

@pdowler pdowler commented Jan 25, 2024

No description provided.

//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));
Copy link
Contributor

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?

Copy link
Member Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this testing?

Copy link
Member Author

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

Copy link
Contributor

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);

Copy link
Contributor

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?

Copy link
Member Author

@pdowler pdowler Jan 26, 2024

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".

Copy link
Contributor

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/.

@pdowler pdowler merged commit 4b17635 into opencadc:vos2 Jan 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants