Skip to content

Add validation to Conan recipe that conforms with Conan.io

Problem

The GitLab Conan registry does not have the same validation in the package recipe that the Conan client is checking. This can lead to problems when working with the GitLab registry.

Solution

Add validation on all 4 parts of the recipe: <pkg-name>/<version>@<user>/<channel>

The validation should match the regex ^[a-zA-Z0-9_][a-zA-Z0-9_\+\.-]{1,50}$

References

https://docs.conan.io/en/latest/reference/conanfile/attributes.html

Related problems

Currently, as of 12.10, the Conan registry is only available on the instance level, requiring the <user> value to be the project's full + separated path (example gitlab-org+gitlab). This causes a problem in that the user value is limited to 50 characters but some paths are greater than 50 characters. Current behavior is that users cannot push packages with length higher than 50, so this issue will not change that behavior, but it should be addressed as soon as possible either by enabling project level access, or revisiting instance level naming restrictions. This is handled in #11679 (closed)

Edited by Steve Abrams