file:// custom datasource can't read data when extract is served from repositoryCache (data: null → ZodError → "no-result") #43868
-
How are you running Renovate?CLI Which platform you running Renovate on?Local Which version of Renovate are you using?43.209.4 Please tell us more about your question or problemProblem?I update a dependency by reading another file in the repo: a regex custom manager produces the It works on a cold run but breaks as soon as the extract result is served from The reason is that the How to reproduce
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customDatasources": {
"local-versions": {
"transformTemplates": ["$.\"{{{packageName}}}\""]
}
},
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": ["/app.txt$/"],
"matchStrings": ["# renovate: depName=(?<depName>\\S+)\\s+\\S+=(?<currentValue>\\S+)"],
"datasourceTemplate": "custom.local-versions",
"registryUrlTemplate": "file://versions/{{{depName}}}.json"
}
]
}(Note: the registryUrl templatee
{ "foo": { "releases": [{ "version": "1.0.0" }, { "version": "1.1.0" }] } }Run it twice with the cache enair so the cache survives: # Run A: cold cache
renovate --platform=github --repository-cache=enabled --base-dir=/tmp/rn sample/<repo>
# Run B: warm cache
renovate --platform=github --repository-cache=enabled --base-dir=/tmp/rn sample/<repo>LogsRun A (cold) — works, Run B (warm) — fails: What's going onThe The only place that checks out miss path of // lib/workers/repository/process/extract-update.ts
if (
overwriteCache &&
isCacheExtractValid(baseBranchSha!, configHash, cachedExtract)
) {
packageFiles = cachedExtract.packageFiles;
try {
for (const files of Object.values(packageFiles)) {
for (const file of files) {
for (const dep of file.deps) {
delete dep.updates;
}
}
}
logger.debug('Deleted cached dep updates');
} catch (err) {
logger.info({ err }, 'Error deleting cached dep updates');
}
} else {
await instrument(
'checkoutBranch',
async () => await scm.checkoutBranch(baseBranch!),
);Lookup runs afterwards and never checks anything out ( Logs (if relevant)Logs |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Sounds like a bug to me. I don't have a solution at the moment, so converting it to an issue. |
Beta Was this translation helpful? Give feedback.
#43890