Closed nicholasdille closed 4 years ago
Hi, please create a reproduction of this in a public github.com repo so that we can debug it.
The escaping comes from handlebars
. If you use {{{versioning}}}
with three brackets then the problem is resolved. However the currentValue
match is not quite correct so it still fails without removing the brackets around version:
{
"fileMatch": ["^Dockerfile$"],
"matchStrings": [
"#\\s*renovate:\\s*datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\sENV .*?_VERSION=\"(?<currentValue>.*)\"\\s"
],
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
}
It's not picking up the v3.7.0
update though - I'll leave that to you to troubleshoot.
Seems that the API returns something different to what you see in the UI: https://api.github.com/repos/kubernetes-sigs/kustomize/releases
The UI mixes releases and tags. There's a kustomize/v3.7.0
tag but not a release. Latest is v3.6.1
:
Thanks for the help! Did I miss this in the documentation?
I am still struggeling with finding a supported value in the Dockerfile
. Do I have to enter the version (3.6.1
) or the tag_name
from the release (kustomize/3.6.1
)?
Thanks for the help! Did I miss this in the documentation?
The docs mention that handlebars
is used to compile templates and it was handlebars
that was escaping the special characters. I have just now updated the example you copied from to use triple braces now and added an explicit note in a couple of places to recommend triple braces.
I am still struggeling with finding a supported value in the
Dockerfile
. Do I have to enter the version (3.6.1
) or thetag_name
from the release (kustomize/3.6.1
)?
It needs to match with the convention that the repo uses, which is kustomize/v3.6.1
. i.e. what you had last time. The problem is that kustomize/v3.7.0
is not a release. I don't know if that's a mistake of the maintainers or if it was intention to make them tags only.
If you change from github-releases
to github-tags
then you will get a PR: https://github.com/renovate-tests/renovate-versioning-regex/pull/2/files
Yes, switching to github-tags
allowed the update to kustomize/v3.7.0
. In addition, I had to remove the double quotes around the value in KUSTOMIZE_VERSION
... in the end not suprising... that's what the regex says ;-)
This state works! Thanks!
I'd worked past the "" in my above config actually, but glad you worked it out independently.
Your help was very much appreciated
Which Renovate are you using?
Renovate Open Source CLI (version 21.21.8)
Which platform are you using?
GitLab self-hosted
Have you checked the logs? Don't forget to include them if relevant
Yes, full log is included at the bottom.
What would you like to do?
We are using a regex manager to parse the following
Dockerfile
:Apparently, the regex contained in the versioning field of the comment does not work because the
<
and>
characters are replaced with HTML entities<
and%gt;
. Following is the relevant part of the log:The configuration file contains the following regex manager:
How can we make this work? Thanks in advance!
Full log