Skip to content

Allow longer Helm channel names

Mathieu Parent requested to merge sathieu/gitlab:helm_longer_channel into master

What does this MR do and why?

After the merge of !69278 (merged), I just had an helm channel name not matching this regexp 😢 : renovate_https-github_com-operator-framework-operator-lifecycle-manager_git-0_x, the reason is: it's length is more than 63 (non separator) chars.

See https://rubular.com/r/mVhumVSwVXASQt

and https://gitlab.com/kubitus-project/external-helm-charts/operator-lifecycle-manager/-/jobs/1653787302#L318

I tested that the new regex is fine against ReDoS:

$ time ruby -e '"aaaa.bb-ccc." * 500000000 + "!" =~ %r{\A([a-zA-Z0-9](\.|-|_)?){1,63}(?<!\.|-|_)\z}.freeze'

real    0m8,703s
user    0m3,268s
sys     0m5,365s
$ time ruby -e '"aaaa.bb-ccc." * 500000000 + "!" =~ %r{\A([a-zA-Z0-9](\.|-|_)?){1,255}(?<!\.|-|_)\z}.freeze'

real    0m8,966s
user    0m3,375s
sys     0m5,462s
Edited by Mathieu Parent

Merge request reports