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

Failing to register new version of package using ssh address #289

Closed
racinmat opened this issue Apr 28, 2020 · 2 comments · Fixed by #293
Closed

Failing to register new version of package using ssh address #289

racinmat opened this issue Apr 28, 2020 · 2 comments · Fixed by #293
Labels
bug Something isn't working

Comments

@racinmat
Copy link
Contributor

racinmat commented Apr 28, 2020

Context: In our company we have private registry, and self-hosted registrator, and we use ssh keys for authentication for our self-hosted github.
Problem: I can not register new version of package when Registry is already using ssh address using the web UI.
In our registry, for packages we have e.g.
Package.toml in the registry

name = "InternalPackage"
uuid = "a2c437b0-bf6b-41a1-8a62-162a814afa99"
repo = "git@git.our_company.com:our_org/InternalPackage.jl.git"

when I put git@git.our_company.com:our_org/InternalPackage.jl.git to the form https://github.com/JuliaRegistries/Registrator.jl/blob/master/src/webui/templates/select.tpl
I obtain: ERROR: Package URL is invalid.

when I put https://git.our_company.com:our_org/InternalPackage to the form https://github.com/JuliaRegistries/Registrator.jl/blob/master/src/webui/templates/select.tpl
I obtain: ERROR: Registration failed: Changing package repo URL not allowed, please submit a pull request with the URL change to the target registry and retry.

Since we don't have anonymous clone allowed, we are using SSH keys everywhere and thus having https address would complicate things for us a lot.

@DilumAluthge DilumAluthge added the bug Something isn't working label Apr 28, 2020
@racinmat
Copy link
Contributor Author

racinmat commented May 21, 2020

So I was digging a bit into this issue. After changing the validation in https://github.com/JuliaRegistries/Registrator.jl/blob/master/src/webui/routes/register.jl#L15-L16 it passes and URL is parsed correctly, but then there is bigger problem in building RegistryTools.RegisterParams in https://github.com/JuliaRegistries/Registrator.jl/blob/master/src/webui/WebUI.jl#L131 which, for GitHub calls https://github.com/JuliaRegistries/Registrator.jl/blob/master/src/webui/gitutils.jl#L108 so no matter how the URI of repository was passed, HTTPS URI is passed to RegistryTools based on GitHub.Repo no matter how it was created.

To return SSH URI, there would need to be r.ssh_url instead of r.clone_url (and analogously r.ssh_url_to_repo instead of r.http_url_to_repo for GitLab).
I guess the most straightforward way to make it work is to pass additional parameter which marks if HTTPS or SSH was used and delegate it to cloneurl method and there return proper URI.

Does it make sense? Should make PR for it?

@nkottary
Copy link
Member

Yes. It would be good to have this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants