jsonata custom manager has different behavior than regex #34567
Replies: 6 comments 22 replies
-
|
Hi there, Please help this Discussion progress by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. Discussions without reproductions are less likely to be converted to Issues. Please follow these steps:
If you need help with running renovate on your minimal reproduction repository, please refer to our Running Renovate guide. The Renovate team |
Beta Was this translation helpful? Give feedback.
-
|
It seems like a valid bug to me as I didn't test the implementation of jsonata manager on a digest. Please, provide a minimal reproduction and I will look into it. |
Beta Was this translation helpful? Give feedback.
-
|
I am also experiencing this error and have the same error messages. Self-hosted Renovate, Gitlab, renovate version 39.238.1 My config and source file ( {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"customType": "jsonata",
"fileFormat": "yaml",
"fileMatch": ["images/.*.yaml"],
"datasourceTemplate": "docker",
"matchStrings": [
"spec.sources.{ \"packageName\": registry & \"/\" & repository, \"currentValue\": tag, \"currentDigest\": digest }"
]
}
]
}---
spec:
sources:
- registry: docker.io
repository: hashicorp/vault
tag: "1.18.2"
digest: "sha256:2090eb7ac7a4bdef802f685698bd4dc0740de683affe8ff7df55f4fc77077ba7" |
Beta Was this translation helpful? Give feedback.
-
|
Hello, I'd also like to add my case. My use case is a custom helm chart in Helmfile, which is a simple wrapper for web apps. The regex manager correctly works, while the JSONata manager gives the following errors. releases:
- name: app1
chart: ../../charts/single-app
namespace: apps
values:
- image:
name: example.com/app1
tag: "latest@sha256:d62c46bec018305a5a2bf34219899f06bc271470be03204cb2dae8ae18709b95" "customManagers": [
{
"customType": "regex",
"managerFilePatterns": [
"/(^|/)(.*\\.)?helmfile\\.ya?ml(?:\\.gotmpl)?$/"
],
"matchStrings": [
"\\n - name: \"?(?<depName>[^\"\\s]+)\"?\\n(?:[^-]|\\n)*?chart: .*single-app\"?\\n(?:.|\\n)*?- image:\\n(?:.|\\n)*?name: \"?(?<packageName>[^\"\\s]+)\"?\\n(?:.|\\n)*?tag: \"?(?<currentValue>[^@\"\\s]+)(?:@(?<currentDigest>sha256:[^@\"\\s]+))?\"?"
],
"datasourceTemplate": "docker"
},
{
"customType": "jsonata",
"managerFilePatterns": [
"/(^|/)(.*\\.)?helmfile\\.ya?ml(?:\\.gotmpl)?$/"
],
"fileFormat": "yaml",
"matchStrings": [
"$map($filter(releases, function($v){$contains($v.chart, \"charts/single-app\")}), function($v){{\n \"depName\": $v.name & \"-jsonata\",\n \"packageName\": $v.values.image.name,\n \"currentValue\": $split($v.values.image.tag, \"@\")[0],\n \"currentDigest\": $split($v.values.image.tag, \"@\")[1]\n}})"
],
"datasourceTemplate": "docker"
}
], |
Beta Was this translation helpful? Give feedback.
-
|
I run into this issue as well and would like to know, if there I noticed that JSONata manager works fine for me, if the version has 3 parts, but not, if it has 4 parts. We use custom JSON files in our repository, which provides us good flexibility. We import those JSON files in CDK Code for example. |
Beta Was this translation helpful? Give feedback.
-
|
I want to clarify that The Mar 20 2025 comment by @RahulGautamSingh ("exact matching is not possible") is correct for the Concrete example: Business Central AL extensionsSetup: Self-hosted Renovate (GitHub Actions), GitHub, Renovate v43.150.0 Microsoft Dynamics 365 Business Central stores dependency versions in a mandatory 4-part format ( app.json: {
"id": "a8f9e1d2-3b4c-5678-9abc-def012345678",
"name": "AL Example Renovate",
"publisher": "Example Publisher",
"version": "1.0.0.0",
"application": "25.0.0.0",
"platform": "25.0.0.0",
"dependencies": [
{
"id": "63ca2fa4-4f03-4f2b-a480-172fef340d3f",
"name": "System Application",
"publisher": "Microsoft",
"version": "25.0.0.0"
},
{
"id": "5491b2df-228f-423d-b36a-bcfb380f4f5a",
"name": "1Vision Moxa-2-PrintVis IoT Connector",
"publisher": "1Vision365",
"version": "26.0.0.1"
}
]
}Renovate config {
"customManagers": [
{
"customType": "jsonata",
"fileFormat": "json",
"managerFilePatterns": ["**/app.json"],
"matchStrings": [
"dependencies[publisher!='Microsoft'].{\"depName\": publisher & '/' & name, \"packageName\": $replace(publisher, /\\s+/, '') & '.' & $replace(name, /\\s+/, '') & '.symbols.' & id, \"currentValue\": version}"
],
"datasourceTemplate": "nuget",
"registryUrlTemplate": "https://pkgs.dev.azure.com/dynamicssmb2/DynamicsBCPublicFeeds/_packaging/AppSourceSymbols/nuget/v3/index.json",
"versioningTemplate": "nuget",
"autoReplaceStringTemplate": "{{replace \"^(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)$\" \"$1.0\" newValue}}"
}
]
}The What happens Renovate detects that - "version": "26.0.0.1"
+ "version": "27.0.0"The BC compiler rejects this. The correct write-back is Why this is not covered by the digest fixThe Jun 6 fix makes For Workaround (self-hosted only)
"postUpgradeTasks": {
"commands": [
"sed -i -E 's/(\"(version|application|platform)\": \")([0-9]+\\.[0-9]+\\.[0-9]+)\"/\\1\\3.0\"/g' {{{packageFile}}}"
],
"fileFilters": ["**/app.json"],
"executionMode": "update"
}This requires |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
Self-hosted Renovate
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
bitbucket, renovate 39.185.0
Please tell us more about your question or problem
When running renovate with this custom manager, everything works:
Notice that the capture groups are
depName,currentDigestandcurrentValue. The result is expected and the values are replaced accordingly. Bothtaganddigestare updated in this case. However when using the seemingly equivalent (but more robust) jsonata manager, it breaks:I am getting log messages like
See logs for more. (I've also tried returning both an array and non-array in matchStrings, which didn't change anything, I think it made it worse).
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions