Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gradle): correct handling of heuristically matched dependency triples #33487

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

Churro
Copy link
Collaborator

@Churro Churro commented Jan 8, 2025

Changes

Adds special handling for an ambiguous parser match that occurs (only) when heuristically matching 3 string values in combination as groupId, artifactId, version.

During parsing it is difficult to find out whether groupId, artifactId and version are parts of exactly one complete dependency string or independent dependency strings. For example, groupId could occur as a simple string or as one or more concatenated variables. The approach taken here is to first interpolate and then decide how to treat the values.

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Test repo: https://github.com/renovate-demo/30234-renovate-tt-gradle-reproducer/pulls

Extracted dependencies (repository=renovate-demo/30234-renovate-tt-gradle-reproducer)
"packageFiles": {
 "gradle": [
   {
     "packageFile": "otherconfigs.gradle",
     "datasource": "maven",
     "deps": [
       {
         "depName": "org.wiremock:wiremock",
         "currentValue": "3.7.0",
         "managerData": {
           "fileReplacePosition": 93,
           "packageFile": "otherconfigs.gradle"
         },
         "fileReplacePosition": 93,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       },
       {
         "depName": "org.junit.jupiter:junit-jupiter-params",
         "currentValue": "5.6.3",
         "managerData": {
           "fileReplacePosition": 159,
           "packageFile": "otherconfigs.gradle"
         },
         "fileReplacePosition": 159,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       },
       {
         "depName": "jakarta.ws.rs:jakarta.ws.rs-api",
         "currentValue": "2.1.6",
         "managerData": {
           "fileReplacePosition": 212,
           "packageFile": "otherconfigs.gradle"
         },
         "fileReplacePosition": 212,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       }
     ]
   },
   {
     "packageFile": "thisdoeswork.gradle",
     "datasource": "maven",
     "deps": [
       {
         "depName": "jakarta.ws.rs:jakarta.ws.rs-api",
         "currentValue": "2.1.6",
         "managerData": {
           "fileReplacePosition": 118,
           "packageFile": "thisdoeswork.gradle"
         },
         "fileReplacePosition": 118,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       },
       {
         "depName": "org.wiremock:wiremock",
         "currentValue": "3.7.0",
         "managerData": {
           "fileReplacePosition": 175,
           "packageFile": "thisdoeswork.gradle"
         },
         "fileReplacePosition": 175,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       }
     ]
   },
   {
     "packageFile": "build.gradle",
     "datasource": "maven",
     "deps": [
       {
         "depName": "org.junit.jupiter:junit-jupiter-api",
         "currentValue": "5.6.2",
         "managerData": {
           "fileReplacePosition": 122,
           "packageFile": "build.gradle"
         },
         "fileReplacePosition": 122,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       },
       {
         "depName": "org.junit.jupiter:junit-jupiter-params",
         "currentValue": "5.6.3",
         "managerData": {
           "fileReplacePosition": 182,
           "packageFile": "build.gradle"
         },
         "fileReplacePosition": 182,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       },
       {
         "depName": "jakarta.ws.rs:jakarta.ws.rs-api",
         "currentValue": "2.1.6",
         "managerData": {
           "fileReplacePosition": 235,
           "packageFile": "build.gradle"
         },
         "fileReplacePosition": 235,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       },
       {
         "depName": "org.wiremock:wiremock",
         "currentValue": "3.7.0",
         "managerData": {
           "fileReplacePosition": 292,
           "packageFile": "build.gradle"
         },
         "fileReplacePosition": 292,
         "datasource": "maven",
         "registryUrls": [],
         "depType": "dependencies"
       }
     ]
   }
 ]
}

@rarkins rarkins added this pull request to the merge queue Jan 8, 2025
Merged via the queue into renovatebot:main with commit 6e8b70e Jan 8, 2025
39 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 39.96.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

manager(gradle): no deps detected when 3 dep strings present in the configuration
3 participants