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

Sensitive for git URL endings #40

Open
davidanthoff opened this issue Jul 17, 2020 · 8 comments
Open

Sensitive for git URL endings #40

davidanthoff opened this issue Jul 17, 2020 · 8 comments

Comments

@davidanthoff
Copy link
Contributor

This line marks differences in URLs as an error that it probably shouldn't, in particular the following two URLs should probably be treated as identical: https://github.com/Foo/Bar.jl and https://github.com/Foo/Bar.jl.git.

I'm not familiar with the code, though, to propose a fix.

@GunnarFarneback
Copy link
Collaborator

You can opt out of treating that check as an error with

register(..., checks_triggering_error = setdiff(RegistryTools.registrator_errors, :change_package_url))

@davidanthoff
Copy link
Contributor Author

But that would disable all checks, right? I don't want that, I just want the check to be tolerant with respect to URLs that point to the same location.

@GunnarFarneback
Copy link
Collaborator

Yes, it would.

If you have an algorithm that can robustly determine URL same-ness, and remember that this code is supposed to support more places than github, I guess it could be added. Another possible option would be to add a callback that would get asked whether two URLs are equivalent.

@GunnarFarneback
Copy link
Collaborator

Then there's also the workaround to look up the URL before calling register and decide whether to turn off the check or adjust the URL.

@davidanthoff
Copy link
Contributor Author

Is it a github thing that the URL with and without the trailing .git is treated as the same? I think so, right?

It seems like a github specific check here would be ok? That would help with the vast majority of cases that this package handles?

@GunnarFarneback
Copy link
Collaborator

Maybe we should take a step back here. What effect do you want to get by treating them as identical? You know that you can just use an empty string for package_repo if you don't want to update the URL?

@davidanthoff
Copy link
Contributor Author

PkgDev.tag passes a package_repo, and if that URL is different, it would be good to error, so I don't want to pass an empty string. PkgDev.tag takes the URL from the origin configuration of a local package clone. It will encounter URLs with both a .git postfix and without, because both are valid ways to clone a package from github.

@GunnarFarneback
Copy link
Collaborator

I see. LocalRegistry.register uses the approach of only looking at the remote URL for a new package registration. Otherwise it passes an empty string, unless the caller explicitly adds a repo argument. But then it trusts the caller and disables the change url error in RegistryTools. This is based on the reasoning in GunnarFarneback/LocalRegistry.jl#2 (comment), which aimed at avoiding conflicts between ssh and https URLs for the same repo.

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

No branches or pull requests

2 participants