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): Support gradle versions as templates #13576

Merged

Conversation

zharinov
Copy link
Collaborator

Changes:

  • Resolve variable inside the whole templated string

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 tick 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

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

lib/manager/gradle/shallow/tokenizer.ts Show resolved Hide resolved
@viceice viceice merged commit ee55afb into renovatebot:main Jan 16, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 31.28.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@aepfli
Copy link

aepfli commented Jan 27, 2022

well, it detects now the verison, but it seems like the update is having issues, or i am doing something wrong here - see https://github.com/aepfli/renovate-gradle-reproducer/runs/4963762617?check_suite_focus=true

should i create a separate task? #13846

DEBUG: Setting current branch to main (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: latest commit (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
       "branchName": "main",
       "latestCommitDate": "2021-11-10T12:15:40+01:00"
DEBUG: getBranchPr(renovate/at.schrottner.gitlab-repositories-0.x) (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: findPr(renovate/at.schrottner.gitlab-repositories-0.x, undefined, open) (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: Retrieving PR list (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: Retrieved 2 Pull Requests (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: findPr(renovate/at.schrottner.gitlab-repositories-0.x, undefined, closed) (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: branchExists=false (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: dependencyDashboardCheck=undefined (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: recreateClosed is false (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: findPr(renovate/at.schrottner.gitlab-repositories-0.x, Update plugin at.schrottner.gitlab-repositories to v0.5.0, !open) (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: prAlreadyExisted=false (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: Checking schedule(at any time, null) (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: No schedule defined (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: Branch needs creating (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: Using reuseExistingBranch: false (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: manager.getUpdatedPackageFiles() reuseExistinbranch=false (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
DEBUG: Unknown value (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
       "depName": "at.schrottner.gitlab-repositories",
       "version": "positories",
       "currentValue": "0.4.0",
       "newValue": "0.5.0"
DEBUG: Error updating file (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)
       "existingContent": "plugins {\n    id \"at.schrottner.gitlab-repositories\" version \"${pluginVersion}\" // does not work\n    id \"com.diffplug.gradle.spotless\" version \"5.0.0\" //works\n}\n",
       "config": {
         "detectGlobalManagerConfig": false,
         "detectHostRulesFromEnv": false,
         "postUpgradeTasks": {
           "commands": [],
           "fileFilters": [],
           "executionMode": "update"
         },
         "onboardingBranch": "renovate/configure",
         "onboardingCommitMessage": null,
         "onboardingConfigFileName": "renovate.json",
         "onboardingNoDeps": false,
         "onboardingPrTitle": "Configure Renovate",
         "productLinks": {
           "documentation": "https://docs.renovatebot.com/",
           "help": "https://github.com/renovatebot/renovate/discussions",
           "homepage": "https://github.com/renovatebot/renovate"
         },
         "deepExtract": false,
         "draftPR": false,
         "printConfig": false,
         "composerIgnorePlatformReqs": [],
         "logContext": null,
         "dependencyDashboard": false,
         "dependencyDashboardApproval": false,
         "dependencyDashboardAutoclose": false,
         "dependencyDashboardTitle": "Dependency Dashboard",
         "dependencyDashboardHeader": "This issue provides visibility into Renovate updates and their statuses. [Learn more](https://docs.renovatebot.com/key-concepts/dashboard/)",
         "dependencyDashboardFooter": null,
         "dependencyDashboardLabels": null,
         "configWarningReuseIssue": true,
         "timezone": null,
         "schedule": ["at any time"],
         "updateNotScheduled": true,
         "persistRepoData": false,
         "ignorePlugins": false,
         "ignoreScripts": false,
         "platform": "github",
         "endpoint": "https://api.github.com/",
         "npmrc": null,
         "npmrcMerge": false,
         "npmToken": null,
         "updateLockFiles": true,
         "skipInstalls": null,
         "useBaseBranchConfig": "none",
         "excludeCommitPaths": [],
         "aliases": {},
         "registryUrls": [
           "https://repo.maven.apache.org/maven2",
           "https://plugins.gradle.org/m2/"
         ],
         "extractVersion": null,
         "versioning": "gradle",
         "azureWorkItemId": 0,
         "azureAutoApprove": false,
         "pinDigests": false,
         "separateMajorMinor": true,
         "separateMinorPatch": false,
         "rangeStrategy": "replace",
         "branchPrefix": "renovate/",
         "bumpVersion": null,
         "semanticCommits": "disabled",
         "semanticCommitType": "chore",
         "semanticCommitScope": "deps",
         "rollbackPrs": false,
         "recreateClosed": false,
         "rebaseWhen": "auto",
         "rebaseLabel": "rebase",
         "stopUpdatingLabel": "stop-updating",
         "stabilityDays": 0,
         "internalChecksFilter": "none",
         "prCreation": "immediate",
         "prNotPendingHours": 25,
         "prHourlyLimit": 0,
         "prConcurrentLimit": 0,
         "branchConcurrentLimit": null,
         "prPriority": 0,
         "bbUseDefaultReviewers": true,
         "automerge": false,
         "automergeType": "pr",
         "automergeStrategy": "auto",
         "automergeComment": "automergeComment",
         "ignoreTests": false,
         "transitiveRemediation": false,
         "branchName": "renovate/at.schrottner.gitlab-repositories-0.x",
         "additionalBranchPrefix": "",
         "branchTopic": "{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}",
         "commitMessage": "Update plugin at.schrottner.gitlab-repositories to v0.5.0",
         "commitBody": null,
         "commitBodyTable": false,
         "commitMessagePrefix": null,
         "commitMessageAction": "Update",
         "commitMessageTopic": "plugin at.schrottner.gitlab-repositories",
         "commitMessageExtra": "to {{#if isMajor}}v{{{newMajor}}}{{else}}{{#if isSingleVersion}}v{{{newVersion}}}{{else}}{{{newValue}}}{{/if}}{{/if}}",
         "commitMessageSuffix": null,
         "prBodyTemplate": "{{{header}}}{{{table}}}{{{notes}}}{{{changelogs}}}{{{configDescription}}}{{{controls}}}{{{footer}}}",
         "prTitle": "Update plugin at.schrottner.gitlab-repositories to v0.5.0",
         "prHeader": null,
         "prFooter": "This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).",
         "hashedBranchLength": null,
         "groupSlug": null,
         "labels": [],
         "addLabels": [],
         "assignees": [],
         "assigneesFromCodeOwners": false,
         "assigneesSampleSize": null,
         "assignAutomerge": false,
         "reviewers": [],
         "reviewersFromCodeOwners": false,
         "filterUnavailableUsers": false,
         "confidential": false,
         "reviewersSampleSize": null,
         "additionalReviewers": [],
         "postUpdateOptions": [],
         "constraints": {},
         "prBodyDefinitions": {
           "Package": "{{{depNameLinked}}}",
           "Type": "{{{depType}}}",
           "Update": "{{{updateType}}}",
           "Current value": "{{{currentValue}}}",
           "New value": "{{{newValue}}}",
           "Change": "`{{{displayFrom}}}` -> `{{{displayTo}}}`",
           "Pending": "{{{displayPending}}}",
           "References": "{{{references}}}",
           "Package file": "{{{packageFile}}}"
         },
         "prBodyColumns": ["Package", "Type", "Update", "Change", "Pending"],
         "prBodyNotes": [],
         "suppressNotifications": ["deprecationWarningIssues"],
         "pruneStaleBranches": true,
         "unicodeEmoji": true,
         "gitLabIgnoreApprovals": false,
         "fetchReleaseNotes": true,
         "cloneSubmodules": false,
         "ignorePrAuthor": false,
         "updatePinnedDependencies": true,
         "writeDiscoveredRepos": null,
         "platformAutomerge": false,
         "userStrings": {
           "ignoreTopic": "Renovate Ignore Notification",
           "ignoreMajor": "As this PR has been closed unmerged, Renovate will ignore this upgrade and you will not receive PRs for *any* future {{{newMajor}}}.x releases. However, if you upgrade to {{{newMajor}}}.x manually then Renovate will reenable minor and patch updates automatically.",
           "ignoreDigest": "As this PR has been closed unmerged, Renovate will ignore this upgrade and you will not receive PRs for the `{{{depName}}}` `{{{newDigestShort}}}` update again.",
           "ignoreOther": "As this PR has been closed unmerged, Renovate will now ignore this update ({{{newValue}}}). You will still receive a PR once a newer version is released, so if you wish to permanently ignore this dependency, please add it to the `ignoreDeps` array of your renovate config."
         },
         "renovateUsername": "aepfli",
         "repository": "aepfli/renovate-gradle-reproducer",
         "errors": [],
         "warnings": [],
         "branchList": [],
         "defaultBranch": "main",
         "isFork": false,
         "baseBranch": "main",
         "repoIsOnboarded": true,
         "renovateJsonPresent": true,
         "dependencyDashboardChecks": {},
         "language": "java",
         "manager": "gradle",
         "packageFile": "build.gradle",
         "datasource": "maven",
         "parentDir": "",
         "packageFileDir": "",
         "depType": "plugin",
         "depName": "at.schrottner.gitlab-repositories",
         "lookupName": "at.schrottner.gitlab-repositories:at.schrottner.gitlab-repositories.gradle.plugin",
         "currentValue": "0.4.0",
         "managerData": {"fileReplacePosition": 41, "packageFile": "build.gradle"},
         "fileReplacePosition": 41,
         "depIndex": 0,
         "currentVersion": "0.4.0",
         "isSingleVersion": true,
         "fixedVersion": "0.4.0",
         "bucket": "non-major",
         "newVersion": "0.5.0",
         "newValue": "0.5.0",
         "newMajor": 0,
         "newMinor": 5,
         "updateType": "minor",
         "isMinor": true,
         "depNameSanitized": "at.schrottner.gitlab-repositories",
         "baseDeps": [
           {
             "depType": "plugin",
             "depName": "at.schrottner.gitlab-repositories",
             "lookupName": "at.schrottner.gitlab-repositories:at.schrottner.gitlab-repositories.gradle.plugin",
             "registryUrls": [
               "https://repo.maven.apache.org/maven2",
               "https://plugins.gradle.org/m2/"
             ],
             "commitMessageTopic": "plugin at.schrottner.gitlab-repositories",
             "currentValue": "0.4.0",
             "managerData": {"fileReplacePosition": 41, "packageFile": "build.gradle"},
             "fileReplacePosition": 41,
             "depIndex": 0,
             "updates": [
               {
                 "bucket": "non-major",
                 "newVersion": "0.5.0",
                 "newValue": "0.5.0",
                 "newMajor": 0,
                 "newMinor": 5,
                 "updateType": "minor",
                 "branchName": "renovate/at.schrottner.gitlab-repositories-0.x"
               }
             ],
             "warnings": [],
             "versioning": "gradle",
             "currentVersion": "0.4.0",
             "isSingleVersion": true,
             "fixedVersion": "0.4.0"
           },
           {
             "depType": "plugin",
             "depName": "com.diffplug.gradle.spotless",
             "lookupName": "com.diffplug.gradle.spotless:com.diffplug.gradle.spotless.gradle.plugin",
             "registryUrls": [
               "https://repo.maven.apache.org/maven2",
               "https://plugins.gradle.org/m2/"
             ],
             "commitMessageTopic": "plugin com.diffplug.gradle.spotless",
             "currentValue": "5.0.0",
             "managerData": {
               "fileReplacePosition": 144,
               "packageFile": "build.gradle"
             },
             "fileReplacePosition": 144,
             "depIndex": 1,
             "updates": [
               {
                 "bucket": "non-major",
                 "newVersion": "5.17.1",
                 "newValue": "5.17.1",
                 "newMajor": 5,
                 "newMinor": 17,
                 "updateType": "minor",
                 "branchName": "renovate/com.diffplug.gradle.spotless-5.x"
               },
               {
                 "bucket": "major",
                 "newVersion": "6.2.0",
                 "newValue": "6.2.0",
                 "newMajor": 6,
                 "newMinor": 2,
                 "updateType": "major",
                 "branchName": "renovate/com.diffplug.gradle.spotless-6.x"
               }
             ],
             "warnings": [],
             "versioning": "gradle",
             "currentVersion": "5.0.0",
             "isSingleVersion": true,
             "fixedVersion": "5.0.0"
           }
         ],
         "logJSON": null,
         "displayFrom": "0.4.0",
         "displayTo": "0.5.0",
         "displayPending": "",
         "prettyDepType": "plugin",
         "isRange": false
       }
 WARN: Error updating branch: update failure (repository=aepfli/renovate-gradle-reproducer, branch=renovate/at.schrottner.gitlab-repositories-0.x)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle plugin version resolving does not work within plugin block with variables
4 participants