Registering a package hosted on a public self-hosted gitlab instance

I am just looking at the registration process (I have never done it before), and I am not sure to fully understand everything. Is there a way to register on the General repository a (publicly available) package hosted on a self-hosted gitlab instance? I have the feeling that only git repositories of the main gitlab.com instance (and github repositories) are supported, is that right? Any workaround?

Is there any potential problem with using url everywhere, except that it’s longer to write, and not cool for other users? For instance if I have two self-hosted packages Lib and App, is it OK to add Lib to App dependencies by providing its url, and share App with the rest of the world by sharing its url? Does it make any difference in practice with what would happen if both packages were registered?

1 Like

@Nishanth_Kottary ^

Just mirror the repo on Github/Gitlab (disable issues, PRs, etc; the readme should indicate where to make them). On a self-hosted Gitlab instance, you can do this automatically with a hook after each commit (I think, never tried).

Generally, using URLs of package repos directly makes it difficult to work with the resolver. In due time, your package will have multiple versions, with various compatibility requirements, so the cleanest solution is putting it in a registry.

Note that if the package is for a limited audience, an internal/local registry is also an option. See various packages that make running one easier.

Thank you for these details. It is good to know that there is this mirroring option, but it is indeed only a workaround as it defeats the original purpose (which was not to use github).

Is it possible to know why the resolver might have problems when working with urls? Creating an internal registry is probably the cleanest option, but maybe overkill for my simple needs. And indeed the package is targeted for a limited audience.

AFAIK there’s no reason you shouldn’t be able to register an arbitrary publicly available git repo in General. The convenient options (Registrator/JuliaHub) won’t work, but a manual PR should do the trick.

3 Likes

What about Gitlab?

Generally, one thing these hosts provide is near 24/7 uptime. I am wondering how robust your self-hosting solution is. The concern about vanishing resources should be alleviated by

but in the meantime a mirror on a commonly used Git provided could help. Mirroring to a locally hosted Gitlab repo to gitlab.com may be the easiest.

It’s not a very big effort with LocalRegistry. Disclaimer: I’m the author.

That’s a good sign that an internal registry may be a better fit than General.

2 Likes

Well my research lab runs a gitlab instance, so it makes sense for me to keep code here rather than centralizing everything on Github. Regarding the uptime, it might not beat github, but should be good enough. But I totally understand that as a first step the Julia community decided to support only github/gitlab.

1 Like

You can definitely make a manual pull request to register the package. It will need a human to merge it. Feel free to post in the #pkg-registration channel on Slack, and someone will take a look at it.

You should be able to use a package to help you generate your registration pull requests.

@GunnarFarneback Could a user use LocalRegistry.jl to generate a manual pull request to the General registry (instead of to a private registry).

@davidanthoff Could a user use PkgDev.jl to generate a manual pull request to the General registry?

2 Likes

Yes, creating the commit is entirely straightforward. You would have to do the git forking and PR-ing on your own though. The complexity is about the same as setting up your own private registry.

2 Likes

It would be cool if there were a package that would also take care of the β€œlog in to GitHub, fork the General registry, and make a pull request” step.

Probably out of the scope of LocalRegistry.jl.

Does PkgDev.jl have that functionality?

Interesting! Sorry but this is not obvious for me, could you detail exactly how to do it? Is there a way to do something like register(MyLocalPackage, general)? Should I fork the General repository, use register on this local fork, and then do a PR from that?

That would be the general idea, yes.

1 Like

Side question with respect to the OP’s @GunnarFarneback : In order to setup a julia registry on a self-hosted Gitlab I guess one can do create_registry targeting the correct path. But then how could the package developers register their packages ? Would you have an idea ?