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

Support HTCondor's funky _ schemes #69

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

CohenQU
Copy link

@CohenQU CohenQU commented May 19, 2023

No description provided.

CohenQU added 2 commits May 19, 2023 10:21
…to the file transfer scheme, causing transfers with the OSDF plugin to fail.

Introduced a new function, `correctURLWithUnderscore()`, which corrects URLs before they are passed to the URL parsing library. This function replaces any underscore in the scheme part of the URL with a period, ensuring compatibility with URL parsing.

The source and destination URL parsing code have been updated to first pass the URL through the new correction function, before parsing it. After parsing the URL, the original scheme (potentially containing underscores) is restored to ensure integrity and prevent potential misinterpretation of the URL.
…eviously introduced to resolve the issue of HTCondor adding underscores into the file transfer scheme.

The function initially lacked a condition to return the original string if the scheme separator '://' was not found. This could have led to the function returning an incorrect scheme index.

The function has now been updated to return the original source file and an empty string for the scheme when the separator is not present. This ensures that URLs without a scheme will not be altered incorrectly.
@CohenQU CohenQU linked an issue May 19, 2023 that may be closed by this pull request
@CohenQU CohenQU marked this pull request as ready for review May 22, 2023 18:40
Copy link
Collaborator

@djw8605 djw8605 left a comment

Choose a reason for hiding this comment

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

Could you add a test for correctURLWithUnderscore, use actual schemes that ligo and etc are using.

Implemented a unit test, `TestCorrectURLWithUnderscore()`, for the `correctURLWithUnderscore()` function to ensure its correct behavior.

The test covers several potential URL scenarios, including:

1. LIGO URLs that include an underscore in the scheme.
2. URLs that do not contain an underscore in the scheme.
3. URLs that lack a scheme altogether.
@bbockelm
Copy link

bbockelm commented Jun 3, 2023

@CohenQU - can you please resolve the conflict? Then I think it's ready to go.

@djw8605 djw8605 merged commit b51be7f into main Jun 5, 2023
@djw8605 djw8605 deleted the yqu/67-support-htcondors-funky-_-schemes branch June 5, 2023 14:56
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.

Support HTCondor's funky _ schemes
3 participants