Skip to content

Draft: Make generic package version regex less strict

Steffen Neubauer requested to merge stefreak/gitlab:stefreak-fix-296097 into master

What does this MR do?

This MR changes the version format for generic packages to be less strict. It will allow not only numbers and dots, but also symbols like dash, underscore, plus and tilde, as well as letters of the alphabet.

At the start of the version, there must still be a strict semver version (three digits separated by dots). But after that users may add up to 20 free form characters, including letters, numbers, and some symbols.

The idea is that the string still must look like a version, and in the future when sorting or version comparison must be implemented, the packages can be sorted in two steps: first sort by the semver version, and then use alphabetical sorting for the appendix string.

I hope this is a good enough compromise. With this change I (and probably a bunch of other users) will be able to use package registries. Until then users who need special characters in the version have no other choice but to use other solutions like S3, which are often much more complicated because of credentials management etc.

See also the gitlab issues #296097 (closed) and #255234 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Steffen Neubauer

Merge request reports