GunnarFarneback/LocalRegistry.jl

Package repo= value changed to most recent registration

lazzarello opened this issue · 1 comments

I got caught by this in my CI system (Gitlab) when a predefined variable value was the wrong URL for my setup and all jobs pulling in a private package broke!

The problem is that the value of repo = URL in Project.toml is always updated to the value in the last registration...for all versions of the package. In my case, an HTTPS URL was used via CI by accident, which updated numerous package URLs and this morning when my colleagues updated the packages, it broke on authentication. We're using SSH public key auth.

The best way I can think of to fix this is to associate a URL with a single version. Is that possible? I'm new to LocalRegistry and running a private registry in general. Or maybe have a configuration option to "enforce" a URL type?

The registry format associates a URL to a package and there's no way to split that on versions. The best way to avoid that the URL changes is not to provide a repo argument at all unless it's a new package. For CI it may be impractical to distinguish between old and new versions but it's not that difficult to set up the CI to provide a stable URL.

Another alternative is to set up the CI to create a merge request rather than push directly to the registry master. Specifically on GitLab this is very convenient with the create_gitlab_mr keyword argument. Then you would have a CI script for the registry which checks that the URL is of the expected form and whatever other consistency checks you like.