Add --incremental option to hex.registry build#920
Add --incremental option to hex.registry build#920aj-foster wants to merge 2 commits intohexpm:mainfrom
--incremental option to hex.registry build#920Conversation
|
Thank you for the PR! I think a feature like this is very welcome, especially for really large registries. Instead of an cc @ericmj |
|
That makes sense. Would the
Then, later in CI (for example)...
I agree that an |
Yes, exactly! To be precise, it would copy the tarball to repositories tarballs/ directory and rebuild the registry. When you add multiple tarballs, it would be inefficient to add them one at a time, but I don't think we need to worry about it yet. I suppose we could later extend the command to
Right, that was my thinking as well. Let's hold off on this flag then, we can always add it later. Sorry for late reply! |
|
Closing this in favor of #931 for now. 🙂 |
Hello folks 👋🏼
This PR is primarily for discussion purposes. The code is for demonstration, but I welcome all feedback.
The
mix hex.registry buildcommand is great for managing local package registries. Thank you for implementing it. Occasionally we want to add a package (or package version) to a registry without regenerating the entire registry. For example, if we build a package.tarin a CI job and want to publish it to a local registry, it might be difficult to download all of the existing tarballs prior to building the registry.Perhaps there is a way around this. If so, great! No need for this PR. If there isn't, maybe this could help.
This PR implements an
--incrementaloption formix hex.registry build. When this option is enabled, it adds new packages to a registry without removing any existing packages. Thus, if you have a single tarball inPUBLIC_DIR/tarballs, then a single package will be added (or updated). All existing packages remain. The CI job could then re-upload thenames,versions, andpackages/Xfiles along with the new tarball.At the time of writing there are two commits with two variations of an implementation. The first keeps the incremental logic separate in a separate function. The second attempts to integrate it with the existing function. I welcome feedback on everything. 🙂
Thank you for everything you do in the community!