Improvements to the package registration workflow in the General registry

Hello package maintainers (and everyone else too :slightly_smiling_face:)! We have some new RegistryCI features that we hope will help make registering packages smoother.

Background: what is RegistryCI? And what is “the General registry”?

The General registry is a repository of open source Julia packages. It is installed by default, and it is where packages come from by default when you do ] add MyPackage.

RegistryCI is the Julia package that powers the automatic merging of registration requests for the General registry. (It can also be used on your own registries!). This is what writes the “AutoMerge comment” that says if your new package or new version will get merged automatically, or if some guidelines were not fulfilled.

New feature 1: Some AutoMerge checks can be skipped if the author wishes

When you register a new version of your package, one of the checks AutoMerge does is a “sequential version check”, to see if a version has been skipped. For example, registering v1.1 and then v1.3 skips version v1.2. This isn’t a big problem, but it often happens by mistake, so we prevent auto-merging the pull request so the package author has a chance to fix it if they want to.

Previously, package authors could request manual intervention to merge the pull request anyway, if they had some reason for skipping the version. Now however, that intervention has been automated: the package author can comment [merge approved], and a label will automatically be applied to the PR instructing AutoMerge that the author has approved of merging anyway. AutoMerge will re-run, see the new label, and skip the sequential version check.

Currently, the sequential version check is the only check that can be skipped in this way. In the future, however, we may use this new framework to add other optional checks. For example, if a breaking release of a package would break a large amount of downstream dependencies, we may ask for confirmation from the author before registering the version, in the future.

New feature 2: The name similarity check can be overridden

If a package’s name is “too similar” to another registered package’s name, AutoMerge is blocked. This check exists primarily to prevent “typosquatting”, where a malicious package is registered with a very similar name to a popular package. It also helps prevent ordinary confusion, since having two packages with very similar names can be a bad experience for users.

However, this check can be overzealous, and ends up blocking many new packages. Previously, a registry maintainer would add a label indicating the name was OK, and then after the standard 3 day waiting period for new packages expired, manually merge the package. However, such PRs were often left dangling for some time.

Now, the label Override AutoMerge: name similarity is okay is in fact respected by AutoMerge, and when that label is applied, it will re-run and skip the name similarity check. Thus, the package will be automatically merged once the waiting period is up, assuming all the other checks pass.

This allows anyone with triage-level access to General to help merge such package registrations by applying that label.

New triagers!

We are excited to welcome @Lilith, @GunnarFarneback, and @goerz to the General registry maintenance team. They have all already contributed to General by helping folks out with their registrations. Now they are additionally empowered to add labels such as Override AutoMerge: name similarity is okay and close old PRs.

As volunteers, they (and the rest of General’s maintainers) may have limited time and varying availability; if you have an issue with a package registration you are encouraged to post here on Discourse or in the #pkg-registration channel on the public Julia Slack for help, rather than tagging any specific maintainer.

And remember that anyone can help maintain General!

Other improvements

We renamed the “checks” that appear at the bottom of each PR, so they appear as "Registry Consistency” and “AutoMerge” (instead of “CI” and “AutoMerge”). Note that all such checks must pass for a registration to be automatically merged.

Oh, what happened to the stdlib compat thing?

We began requiring compatibility bounds for standard libraries, just like they are required for regular packages. This is because there are plans for standard libraries to be upgradable instead of tied to a specific Julia version.

However, doing so revealed a latent Pkg.jl bug in which Pkg had trouble resolving test environments in some situations in which packages had compatibility bounds on standard libraries. While there is a workaround (allow <0.0.1 in the bounds), we decided to turn off the requirement for packages to have compat bounds for stdlibs again, while this was sorted out.

This bug has been fixed on Julia 1.9 and later, but the fix has not been backported to Julia 1.6 yet. We will likely soon re-enable the requirement for packages which are declared compatible only with Julia 1.9 or later, which don’t support earlier Julia versions anyway. We hope to eventually be able to re-enable the requirement across the board, as compatibility bounds are essential for the package ecosystem to function well, and at scale.

By the way: contribute to RegistryCI.jl!

RegistryCI.jl is a Julia package that runs in General’s CI to power AutoMerge. Contributions to RegistryCI can have a big impact across the ecosystem, but RegistryCI does not get much attention. I think part of the reason why is the whole thing seems somewhat mysterious. So let me take the opportunity to make a sales pitch for contributions to RegistryCI and try to explain a bit more about how it works.

AutoMerge works by checking the package against a sequence of guidelines. These can be very simple to write. For example, there is a guideline that the package name should be composed only of ASCII characters. The implementation is only 9 lines long, and it is integrated into the list of guidelines that are checked for each new package registration with one line.

These don’t have to be quite so simple though! We download the package code, so we can look inside to find a license, using other Julia packages to help. And for new package registrations, we even often solve hundreds of optimization problems to compute the “visual distance” (using optimal transport) between images of the name of the package and existing package names. That one typically doesn’t end up being very useful with our current tunings though (usually our Damerau–Levenshtein distance check triggers first, so the visual distance doesn’t come into play).

The point being, we have the full power of Julia and the package ecosystem available within RegistryCI, and there’s a lot of flexibility to the system. So there’s a lot we can do here! Please, check out the repo, check out the open issues, and think about what you’d love to have in our AutoMerge system. It may be simpler than you think to implement!

48 Likes

Very cool, and great to see the improvenents of support behind General!

Once we can skip version numbers: would it also be possible to skip the requirement to have start version number 0.1.0 ? Or is it already relaxed ?
The point here is that this would allow to use SemVer consistently with a workflow where all pre-General versions are registered in a separate registry (I maintain a “PackageNursery” using LocalRegistry.jl for this purpose). If I could have all pre 1.0 (or even higher) versions in the package nursery and “release” to general starting with some version >= 1.0 this would be very helpful. In the moment I try to uses the separate registry with versions 0.0.x, but this disables Pkg’s incredible semver consistency handling.

1 Like

We actually removed that one over 3 years ago!

5 Likes

As someone who is not a RegistryCI maintainer, I can confirm that this is indeed the case.

I just made my first PR to add an auto-merge naming guideline and it took about 20 minutes of work and about 30 minutes of waiting for review. The time elapsed between having the idea and merging the PR was about 60 minutes.

7 Likes

A small update: as some of you have probably noticed, the automerge comment that is made automatically on registration pull requests has been updated. Folks sometimes got confused about things that were meant to be addressed by the comment, so it seemed like the comment’s clarity could be improved.

The new comments contain much of the same text as the old ones, but divided into sections with more formatting to try to make it more quickly parsable for experienced users (easier to tell what is different about this registration without reading every word) and more quickly understandable for new users (less “wall of text”). The text within each section is static (except for which guidelines were not met, and tweaks for JLL packages) and instead what depends on the content of the PR is which sections are displayed, so that the section titles alone can convey most of the information.

As always, please feel free to file issues and contribute PRs to the comment, error messages, and so forth at RegistryCI.jl.

Example old comment

Example new comment

18 Likes

General has two new labels which RegistryCI interacts with:

new label AutoMerge: last run blocked by comment

This label is automatically added to registration PRs which have a blocking comment, and it looks like this:


Currently, any comment on a registration PR which does not include [noblock] prevents automerge. This is intended to allow community review to pause the registration process. However, not everyone knows about this system, and it can be unclear if a PR with a lot comments is blocked or not. The label is intended to make this more clear and visible. It is updated each time automerge iterates through open PRs looking for eligible PRs to merge. If it sees that a PR is blocked, it adds the label; if it is no longer blocked, it removes the label.

This label is managed by RegistryCI and is not intended to be added or removed manually. However, if someone does add or remove it, it will do no harm; the label itself is not an input to anything RegistryCI does, it just surfaces the blocking status. Each run it is updated (added or removed) to reflect the current status.

new label Override AutoMerge: ignore blocking comments

Folks with triage-level access to General can add the label “Override AutoMerge: ignore blocking comments” to ignore all blocking comments. This can be easier than telling PR commentators to edit in [no block] when they want to unblock a PR, and can also be used to override a block by the community if necessary.

Hopefully these features will make the blocking system easier to understand and work with. There is also a proposal to make blocking opt-in rather than opt-out, which could be a good step as well. If you have thoughts on that, please chime in on the issue there (rather than on this thread).

4 Likes