Open rarkins opened 1 week ago
I created as well https://github.com/Shegox/spring-boot-major as a minimal reproduction repository.
Effectively the use case is tracking a major release of spring-boot
in the spring-boot-major
-file. So I use the maven package org.springframework.boot:spring-boot
and use extractVersionTemplate
in the regex manager to extract just the major:
{
"customManagers": [
{
"customType": "regex",
"description": "Regex manager to update the spring major version in `spring-boot-major`.",
"fileMatch": [
"spring-boot-major$"
],
"matchStrings": [
"^(?<currentValue>\\d+)"
],
"datasourceTemplate": "maven",
"depNameTemplate": "org.springframework.boot:spring-boot",
"extractVersionTemplate": "^(?<version>\\d+)"
}
]
}
The logs show then, that the postProcessing tries to lookup the extracted version (in this case just 3
):
...
DEBUG: Rejected release
{
"datasource": "maven"
"packageName": "org.springframework.boot:spring-boot"
"registryUrl": "https://repo.maven.apache.org/maven2"
"version": "3"
}
...
DEBUG: packageFiles with updates
{
"baseBranch": "main"
"config": {
"regex": [
{
"deps": [
{
"depName": "org.springframework.boot:spring-boot",
"currentValue": "2",
"datasource": "maven",
"replaceString": "2",
"updates": [],
"packageName": "org.springframework.boot:spring-boot",
"versioning": "maven",
"warnings": [],
"sourceUrl": "https://github.com/spring-projects/spring-boot",
"registryUrl": "https://repo.maven.apache.org/maven2",
"homepage": "https://spring.io/projects/spring-boot",
"packageScope": "org.springframework.boot",
"currentVersion": "2"
}
],
"matchStrings": [
"^(?<currentValue>\\d+)"
],
"depNameTemplate": "org.springframework.boot:spring-boot",
"datasourceTemplate": "maven",
"packageFile": "spring-boot-major"
}
]
}
}
...
My expectation/assumption would be that we need to lookup the non-extracted version (3.3.5
) and perform the version extraction only after the maven post-processing.
@zharinov can we save a field like rawDatasourceVersion
and use it instead?
I just saw it working in my test repository (https://github.com/Shegox/spring-boot-major/pull/2). Looks like a fix got implemented? Maybe #32376
The logs now show this:
"renovateVersion": "39.9.5"
...
DEBUG: Rejected release combined with `extractVersion`: preserving the release
{
"datasource": "maven"
"packageName": "org.springframework.boot:spring-boot"
"registryUrl": "https://repo.maven.apache.org/maven2"
"version": "3"
"extractVersion": "^(?<version>\\d+)"
}
Edit: Can confirm in my original/internal scenario it is working now again as well 👍 🚀
Yes that was the fix/workaround
Discussed in https://github.com/renovatebot/renovate/discussions/31886
Relevant logs
``` DEBUG: Looking up com.jetbrains.intellij.idea:ideaIC in repository https://www.jetbrains.com/intellij-repository/snapshots/ DEBUG: hostRules: no authentication for www.jetbrains.com DEBUG: Using queue: host=www.jetbrains.com, concurrency=16 DEBUG: Found 38 new releases for com.jetbrains.intellij.idea:ideaIC in repository https://www.jetbrains.com/intellij-repository/snapshots/ DEBUG: GET https://www.jetbrains.com/intellij-repository/snapshots/com/jetbrains/intellij/idea/ideaIC/243.19420.21-EAP-SNAPSHOT/maven-metadata.xml = (code=ERR_NON_2XX_3XX_RESPONSE, statusCode=404 retryCount=0, duration=294) DEBUG: Content is not found for Maven url { "url": "https://www.jetbrains.com/intellij-repository/snapshots/com/jetbrains/intellij/idea/ideaIC/243.19420.21-EAP-SNAPSHOT/maven-metadata.xml" } DEBUG: Rejected release { "datasource": "maven" "packageName": "com.jetbrains.intellij.idea:ideaIC" "registryUrl": "https://www.jetbrains.com/intellij-repository/snapshots" "version": "243" } DEBUG: PackageFiles.add() - Package file saved for base branch { "baseBranch": "main" } DEBUG: Package releases lookups complete { "baseBranch": "main" } DEBUG: branchifyUpgrades DEBUG: detectSemanticCommits() DEBUG: getCommitMessages DEBUG: semanticCommits: detected "unknown" DEBUG: semanticCommits: disabled DEBUG: 0 flattened updates found: DEBUG: Returning 0 branch(es) DEBUG: config.repoIsOnboarded=true DEBUG: packageFiles with updates { "baseBranch": "main" "config": { "regex": [ { "deps": [ { "depName": "intellij-ideaIC-build-range-eap", "packageName": "com.jetbrains.intellij.idea:ideaIC", "currentValue": "242", "datasource": "maven", "registryUrls": [ "https://www.jetbrains.com/intellij-repository/snapshots/" ], "replaceString": "\nplatformType = IC\nplatformVersion = 2023.3.8\n\n# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html\n#pluginSinceBuild = XXX - loaded automatically from `platformVersion`\npluginUntilBuild = 242.*\n\n", "updates": [], "versioning": "maven", "warnings": [], "registryUrl": "https://www.jetbrains.com/intellij-repository/snapshots", "packageScope": "com.jetbrains.intellij.idea", "currentVersion": "242" } ], "matchStrings": [ "(^|\\n)\\s*platformType\\s*=\\s*IC\\s*(\\n+|$)[\\s\\S]*?(^|\\n)\\s*pluginUntilBuild\\s*=\\s*(?