Container Registry tag expiration example patterns are misleading

Problem to solve

The Container Registry tag expiration policy settings have a field to specify a regex pattern for Docker tags to consider for expiration. The examples given under the field don't make sense, and are misleading. When I saw the examples, I thought I should specify the tags that I want to keep, instead of the tags that I want to expire.

Screenshot:

image

Further details

The text under the field lists the following as example wildcards.

  • .*-stable
  • production/.*

The presence of stable and production in the examples lead me to erroneously believe that I should specify tags that I want to keep. I configured several projects this way, until I realized that I should be specifying the exact opposite.

Also, the production/.* example doesn't make sense, since it is not a valid tag. The / character is not valid in tag names.

Proposal

The help text should show examples of non-production or stable tags to expire. For example, something like this to keep tags with master or version numbers like 0.0.0.

^((?!master|\d+\.\d+\.\d+).)*$

Who can address the issue

Not sure.

Other links/references

Container Registry expiration policies were introduced in GitLab 12.8.

Assignee Loading
Time tracking Loading