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

bundler: git-refs support, with git tags in form of v1.2.3 wants to upgrade to vv1.2.3 #33807

Open
rarkins opened this issue Jan 23, 2025 · 0 comments
Labels
manager:bundler Bundler (Ruby) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jan 23, 2025

Discussed in #33005

Originally posted by siebertm December 10, 2024

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.

platform=local, version=39.60.0 (but also seen on platform=gitlab, version=>=39.47.0)

Please tell us more about your question or problem

Reproduction repo: https://github.com/siebertm/renovate-bundler-git-refs-issue-repro

We've been waiting for #32362 to arrive, as this was one of the features missing for our workflows. Thanks for implementing that!

Unfortunately, it's not working for us :-/

For a simple reproduction case, create a new folder with the following Gemfile

source "https://rubygems.org"
gem "rails", "~> 7.2.1", git: "https://github.com/rails/rails.git", tag: "v7.2.1"

Run bundle install, which generates a lockfile.

create a renovate.json file to get started

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"]
}

When running renovate on this repo ( LOG_LEVEL=debug npx renovate --platform=local), we'd expect renovate to upgrade rails to v7.2.2 tag. Instead, it finds v7.2.2 version but wants to change the tag to vv7.2.2 (with an additional v prefix).

The relevant log entries for this (see newValue):

DEBUG: semanticCommits: detected "unknown" (repository=local)
DEBUG: semanticCommits: disabled (repository=local)
DEBUG: 2 flattened updates found: rails, rails (repository=local)
DEBUG: Returning 2 branch(es) (repository=local)
DEBUG: config.repoIsOnboarded=true (repository=local)
DEBUG: packageFiles with updates (repository=local)
       "config": {
         "bundler": [
           {
             "registryUrls": ["https://rubygems.org"],
             "deps": [
               {
                 "depName": "ruby",
                 "currentValue": ">= 3.3.3",
                 "datasource": "ruby-version",
                 "registryUrls": null,
                 "updates": [],
                 "packageName": "ruby",
                 "versioning": "ruby",
                 "warnings": [],
                 "sourceUrl": "https://github.com/ruby/ruby",
                 "registryUrl": "https://www.ruby-lang.org/",
                 "homepage": "https://www.ruby-lang.org",
                 "currentVersion": "3.4.0-preview2",
                 "currentVersionTimestamp": "2024-10-07T00:00:00.000Z",
                 "currentVersionAgeInDays": 64
               },
               {
                 "depName": "rails",
                 "managerData": {"lineNumber": 3},
                 "datasource": "git-refs",
                 "currentValue": "v7.2.1",
                 "packageName": "https://github.com/rails/rails.git",
                 "sourceUrl": "https://github.com/rails/rails",
                 "updates": [
                   {
                     "bucket": "non-major",
                     "newVersion": "v7.2.2",
                     "newValue": "vv7.2.2",
                     "newMajor": 7,
                     "newMinor": 2,
                     "newPatch": 2,
                     "updateType": "patch",
                     "isRange": true,
                     "branchName": "renovate/ruby-on-rails-monorepo"
                   },
                   {
                     "bucket": "major",
                     "newVersion": "v8.0.0",
                     "newValue": "vv8.0.0",
                     "newMajor": 8,
                     "newMinor": 0,
                     "newPatch": 0,
                     "updateType": "major",
                     "isRange": true,
                     "branchName": "renovate/major-ruby-on-rails-monorepo"
                   }
                 ],
                 "versioning": "ruby",
                 "warnings": [],
                 "currentVersion": "v7.2.1",
                 "isSingleVersion": false,
                 "fixedVersion": "v7.2.1"
               }
             ],
             "lockFiles": ["Gemfile.lock"],
             "packageFile": "Gemfile"
           }
         ]
       }

I could not find in the code why this would happen, nor any existing report of this issue. Please guide me what to check for!

Logs (if relevant)

Logs

DEBUG: Parsing configs
DEBUG: Checking for config file in config.js
DEBUG: No config file found on disk - skipping
DEBUG: File config
       "config": {}
DEBUG: CLI config
       "config": {"platform": "local"}
DEBUG: Env config
       "config": {"hostRules": []}
DEBUG: Combined config
       "config": {"hostRules": [], "platform": "local"}
DEBUG: Enabling forkProcessing while in non-autodiscover mode
DEBUG: Enabling onboardingNoDeps while in non-autodiscover mode
DEBUG: Found valid git version: 2.43.0
DEBUG: Setting global hostRules
DEBUG: Using baseDir: /tmp/renovate
DEBUG: Using cacheDir: /tmp/renovate/cache
DEBUG: Using containerbaseDir: /tmp/renovate/cache/containerbase
DEBUG: Initializing Renovate internal cache into /tmp/renovate/cache/renovate/renovate-cache-v1
DEBUG: Commits limit = null
DEBUG: Setting global hostRules
DEBUG: validatePresets()
DEBUG: Reinitializing hostRules for repo
DEBUG: Clearing hostRules
 INFO: Repository started (repository=local)
       "renovateVersion": "39.60.0"
DEBUG: Using localDir: /home/siebert/code/renovate-debug (repository=local)
DEBUG: PackageFiles.clear() - Package files deleted (repository=local)
DEBUG: Resetting npmrc (repository=local)
DEBUG: Resetting npmrc (repository=local)
DEBUG: checkOnboarding() (repository=local)
DEBUG: isOnboarded() (repository=local)
DEBUG: findFile(renovate.json) (repository=local)
fatal: not a git repository (or any of the parent directories): .git
DEBUG: Could not get file list using git, using glob instead (repository=local)
DEBUG: Config file exists, fileName: renovate.json (repository=local)
DEBUG: Repo is onboarded (repository=local)
fatal: not a git repository (or any of the parent directories): .git
DEBUG: Could not get file list using git, using glob instead (repository=local)
DEBUG: Found renovate.json config file (repository=local)
DEBUG: Repository config (repository=local)
       "fileName": "renovate.json",
       "config": {
         "$schema": "https://docs.renovatebot.com/renovate-schema.json",
         "extends": ["config:recommended"]
       }
DEBUG: migrateAndValidate() (repository=local)
DEBUG: No config migration necessary (repository=local)
DEBUG: Found repo ignorePaths (repository=local)
       "ignorePaths": [
         "**/node_modules/**",
         "**/bower_components/**",
         "**/vendor/**",
         "**/examples/**",
         "**/__tests__/**",
         "**/test/**",
         "**/tests/**",
         "**/__fixtures__/**"
       ]
DEBUG: No vulnerability alerts found (repository=local)
DEBUG: No baseBranches (repository=local)
DEBUG: extract() (repository=local)
fatal: not a git repository (or any of the parent directories): .git
DEBUG: Could not get file list using git, using glob instead (repository=local)
DEBUG: Using file match: (^|/)tasks/[^/]+\.ya?ml$ for manager ansible (repository=local)
DEBUG: Using file match: (^|/)(galaxy|requirements)(\.ansible)?\.ya?ml$ for manager ansible-galaxy (repository=local)
DEBUG: Using file match: (^|/)\.tool-versions$ for manager asdf (repository=local)
DEBUG: Using file match: (^|/).azuredevops/.+\.ya?ml$ for manager azure-pipelines (repository=local)
DEBUG: Using file match: azure.*pipelines?.*\.ya?ml$ for manager azure-pipelines (repository=local)
DEBUG: Using file match: (^|/)batect(-bundle)?\.ya?ml$ for manager batect (repository=local)
DEBUG: Using file match: (^|/)batect$ for manager batect-wrapper (repository=local)
DEBUG: Using file match: (^|/)WORKSPACE(|\.bazel|\.bzlmod)$ for manager bazel (repository=local)
DEBUG: Using file match: \.WORKSPACE\.bazel$ for manager bazel (repository=local)
DEBUG: Using file match: \.bzl$ for manager bazel (repository=local)
DEBUG: Using file match: (^|/)MODULE\.bazel$ for manager bazel-module (repository=local)
DEBUG: Using file match: (^|/)\.bazelversion$ for manager bazelisk (repository=local)
DEBUG: Using file match: \.bicep$ for manager bicep (repository=local)
DEBUG: Using file match: (^|/)\.?bitbucket-pipelines\.ya?ml$ for manager bitbucket-pipelines (repository=local)
DEBUG: Using file match: (^|/)bitrise\.ya?ml$ for manager bitrise (repository=local)
DEBUG: Using file match: buildkite\.ya?ml for manager buildkite (repository=local)
DEBUG: Using file match: \.buildkite/.+\.ya?ml$ for manager buildkite (repository=local)
DEBUG: Using file match: (^|/)project\.toml$ for manager buildpacks (repository=local)
DEBUG: Using file match: (^|/)bun\.lockb$ for manager bun (repository=local)
DEBUG: Using file match: (^|/)\.bun-version$ for manager bun-version (repository=local)
DEBUG: Using file match: (^|/)Gemfile$ for manager bundler (repository=local)
DEBUG: Using file match: \.cake$ for manager cake (repository=local)
DEBUG: Using file match: (^|/)Cargo\.toml$ for manager cargo (repository=local)
DEBUG: Using file match: (^|/)\.circleci/.+\.ya?ml$ for manager circleci (repository=local)
DEBUG: Using file match: (^|/)cloudbuild\.ya?ml for manager cloudbuild (repository=local)
DEBUG: Using file match: (^|/)Podfile$ for manager cocoapods (repository=local)
DEBUG: Using file match: (^|/)([\w-]*)composer\.json$ for manager composer (repository=local)
DEBUG: Using file match: (^|/)conanfile\.(txt|py)$ for manager conan (repository=local)
DEBUG: Using file match: (^|/)\.copier-answers(\..+)?\.ya?ml for manager copier (repository=local)
DEBUG: Using file match: (^|/)cpanfile$ for manager cpanfile (repository=local)
DEBUG: Using file match: (^|/)(?:deps|bb)\.edn$ for manager deps-edn (repository=local)
DEBUG: Using file match: ^.devcontainer/devcontainer.json$ for manager devcontainer (repository=local)
DEBUG: Using file match: ^.devcontainer.json$ for manager devcontainer (repository=local)
DEBUG: Using file match: (^|/)(?:docker-)?compose[^/]*\.ya?ml$ for manager docker-compose (repository=local)
DEBUG: Using file match: (^|/|\.)([Dd]ocker|[Cc]ontainer)file$ for manager dockerfile (repository=local)
DEBUG: Using file match: (^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$ for manager dockerfile (repository=local)
DEBUG: Using file match: (^|/)\.drone\.yml$ for manager droneci (repository=local)
DEBUG: Using file match: (^|/)fleet\.ya?ml for manager fleet (repository=local)
DEBUG: Using file match: (?:^|/)gotk-components\.ya?ml$ for manager flux (repository=local)
DEBUG: Using file match: (^|/)\.fvm/fvm_config\.json$ for manager fvm (repository=local)
DEBUG: Using file match: (^|/)\.fvmrc$ for manager fvm (repository=local)
DEBUG: Using file match: (^|/)\.gitmodules$ for manager git-submodules (repository=local)
DEBUG: Using file match: (^|/)(workflow-templates|\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\.ya?ml$ for manager github-actions (repository=local)
DEBUG: Using file match: (^|/)action\.ya?ml$ for manager github-actions (repository=local)
DEBUG: Using file match: \.gitlab-ci\.ya?ml$ for manager gitlabci (repository=local)
DEBUG: Using file match: \.gitlab-ci\.ya?ml$ for manager gitlabci-include (repository=local)
DEBUG: Using file match: (^|/)gleam.toml$ for manager gleam (repository=local)
DEBUG: Using file match: (^|/)go\.mod$ for manager gomod (repository=local)
DEBUG: Using file match: \.gradle(\.kts)?$ for manager gradle (repository=local)
DEBUG: Using file match: (^|/)gradle\.properties$ for manager gradle (repository=local)
DEBUG: Using file match: (^|/)gradle/.+\.toml$ for manager gradle (repository=local)
DEBUG: Using file match: (^|/)buildSrc/.+\.kt$ for manager gradle (repository=local)
DEBUG: Using file match: \.versions\.toml$ for manager gradle (repository=local)
DEBUG: Using file match: (^|/)versions.props$ for manager gradle (repository=local)
DEBUG: Using file match: (^|/)versions.lock$ for manager gradle (repository=local)
DEBUG: Using file match: (^|/)gradle/wrapper/gradle-wrapper\.properties$ for manager gradle-wrapper (repository=local)
DEBUG: Using file match: (^|/)requirements\.ya?ml$ for manager helm-requirements (repository=local)
DEBUG: Using file match: (^|/)values\.ya?ml$ for manager helm-values (repository=local)
DEBUG: Using file match: (^|/)helmfile\.ya?ml(?:\.gotmpl)?$ for manager helmfile (repository=local)
DEBUG: Using file match: (^|/)Chart\.ya?ml$ for manager helmv3 (repository=local)
DEBUG: Using file match: (^|/)bin/hermit$ for manager hermit (repository=local)
DEBUG: Using file match: ^Formula/[^/]+[.]rb$ for manager homebrew (repository=local)
DEBUG: Using file match: \.html?$ for manager html (repository=local)
DEBUG: Using file match: (^|/)plugins\.(txt|ya?ml)$ for manager jenkins (repository=local)
DEBUG: Using file match: (^|/)jsonnetfile\.json$ for manager jsonnet-bundler (repository=local)
DEBUG: Using file match: ^.+\.main\.kts$ for manager kotlin-script (repository=local)
DEBUG: Using file match: (^|/)kustomization\.ya?ml$ for manager kustomize (repository=local)
DEBUG: Using file match: (^|/)project\.clj$ for manager leiningen (repository=local)
DEBUG: Using file match: (^|/|\.)pom\.xml$ for manager maven (repository=local)
DEBUG: Using file match: ^(((\.mvn)|(\.m2))/)?settings\.xml$ for manager maven (repository=local)
DEBUG: Using file match: (^|/)\.mvn/extensions\.xml$ for manager maven (repository=local)
DEBUG: Using file match: (^|\/).mvn/wrapper/maven-wrapper.properties$ for manager maven-wrapper (repository=local)
DEBUG: Using file match: (^|/)package\.js$ for manager meteor (repository=local)
DEBUG: Using file match: (^|/)Mintfile$ for manager mint (repository=local)
DEBUG: Using file match: (^|/)\.?mise\.toml$ for manager mise (repository=local)
DEBUG: Using file match: (^|/)\.?mise/config\.toml$ for manager mise (repository=local)
DEBUG: Using file match: (^|/)mix\.exs$ for manager mix (repository=local)
DEBUG: Using file match: (^|/)flake\.nix$ for manager nix (repository=local)
DEBUG: Using file match: (^|/)\.node-version$ for manager nodenv (repository=local)
DEBUG: Using file match: (^|/)package\.json$ for manager npm (repository=local)
DEBUG: Using file match: \.(?:cs|fs|vb)proj$ for manager nuget (repository=local)
DEBUG: Using file match: \.(?:props|targets)$ for manager nuget (repository=local)
DEBUG: Using file match: (^|/)dotnet-tools\.json$ for manager nuget (repository=local)
DEBUG: Using file match: (^|/)global\.json$ for manager nuget (repository=local)
DEBUG: Using file match: (^|/)\.nvmrc$ for manager nvm (repository=local)
DEBUG: Using file match: (^|/)src/main/features/.+\.json$ for manager osgi (repository=local)
DEBUG: Using file match: (^|/)pyproject\.toml$ for manager pep621 (repository=local)
DEBUG: Using file match: (^|/)[\w-]*requirements([-.]\w+)?\.(txt|pip)$ for manager pip_requirements (repository=local)
DEBUG: Using file match: (^|/)setup\.py$ for manager pip_setup (repository=local)
DEBUG: Using file match: (^|/)Pipfile$ for manager pipenv (repository=local)
DEBUG: Using file match: (^|/)pyproject\.toml$ for manager poetry (repository=local)
DEBUG: Using file match: (^|/)\.pre-commit-config\.ya?ml$ for manager pre-commit (repository=local)
DEBUG: Using file match: (^|/)pubspec\.ya?ml$ for manager pub (repository=local)
DEBUG: Using file match: (^|/)Puppetfile$ for manager puppet (repository=local)
DEBUG: Using file match: (^|/)\.python-version$ for manager pyenv (repository=local)
DEBUG: Using file match: (^|/)\.ruby-version$ for manager ruby-version (repository=local)
DEBUG: Using file match: (^|/)runtime.txt$ for manager runtime-version (repository=local)
DEBUG: Using file match: \.sbt$ for manager sbt (repository=local)
DEBUG: Using file match: project/[^/]*\.scala$ for manager sbt (repository=local)
DEBUG: Using file match: project/build\.properties$ for manager sbt (repository=local)
DEBUG: Using file match: (^|/)repositories$ for manager sbt (repository=local)
DEBUG: Using file match: (^|/)\.scalafmt.conf$ for manager scalafmt (repository=local)
DEBUG: Using file match: (^|/)setup\.cfg$ for manager setup-cfg (repository=local)
DEBUG: Using file match: (^|/)Package\.swift for manager swift (repository=local)
DEBUG: Using file match: \.tf$ for manager terraform (repository=local)
DEBUG: Using file match: (^|/)\.terraform-version$ for manager terraform-version (repository=local)
DEBUG: Using file match: (^|/)terragrunt\.hcl$ for manager terragrunt (repository=local)
DEBUG: Using file match: (^|/)\.terragrunt-version$ for manager terragrunt-version (repository=local)
DEBUG: Using file match: \.tflint\.hcl$ for manager tflint-plugin (repository=local)
DEBUG: Using file match: ^\.travis\.ya?ml$ for manager travis (repository=local)
DEBUG: Using file match: (^|/)\.vela\.ya?ml$ for manager velaci (repository=local)
DEBUG: Using file match: (^|/)vendir\.yml$ for manager vendir (repository=local)
DEBUG: Using file match: ^\.woodpecker(?:/[^/]+)?\.ya?ml$ for manager woodpecker (repository=local)
DEBUG: Matched 1 file(s) for manager bundler: Gemfile (repository=local)
DEBUG: Lockfile for Gemfile found in Gemfile.lock (repository=local)
DEBUG: Found lock file Gemfile.lock for packageFile: Gemfile (repository=local)
DEBUG: manager extract durations (ms) (repository=local)
       "managers": {"bundler": 2}
DEBUG: Found bundler package files (repository=local)
DEBUG: Found 1 package file(s) (repository=local)
 INFO: Dependency extraction complete (repository=local)
       "stats": {
         "managers": {"bundler": {"fileCount": 1, "depCount": 2}},
         "total": {"fileCount": 1, "depCount": 2}
       }
DEBUG: Starting package releases lookups (repository=local)
 WARN: Custom registries are not allowed for this datasource and will be ignored (repository=local)
       "datasource": "git-refs",
       "registryUrls": ["https://rubygems.org"],
       "defaultRegistryUrls": null,
       "additionalRegistryUrls": undefined
DEBUG: PackageFiles.add() - Package file saved for base branch (repository=local)
DEBUG: Package releases lookups complete (repository=local)
DEBUG: branchifyUpgrades (repository=local)
DEBUG: detectSemanticCommits() (repository=local)
DEBUG: getCommitMessages (repository=local)
DEBUG: semanticCommits: detected "unknown" (repository=local)
DEBUG: semanticCommits: disabled (repository=local)
DEBUG: 2 flattened updates found: rails, rails (repository=local)
DEBUG: Returning 2 branch(es) (repository=local)
DEBUG: config.repoIsOnboarded=true (repository=local)
DEBUG: packageFiles with updates (repository=local)
       "config": {
         "bundler": [
           {
             "registryUrls": ["https://rubygems.org"],
             "deps": [
               {
                 "depName": "ruby",
                 "currentValue": ">= 3.3.3",
                 "datasource": "ruby-version",
                 "registryUrls": null,
                 "updates": [],
                 "packageName": "ruby",
                 "versioning": "ruby",
                 "warnings": [],
                 "sourceUrl": "https://github.com/ruby/ruby",
                 "registryUrl": "https://www.ruby-lang.org/",
                 "homepage": "https://www.ruby-lang.org",
                 "currentVersion": "3.4.0-preview2",
                 "currentVersionTimestamp": "2024-10-07T00:00:00.000Z",
                 "currentVersionAgeInDays": 64
               },
               {
                 "depName": "rails",
                 "managerData": {"lineNumber": 3},
                 "datasource": "git-refs",
                 "currentValue": "v7.2.1",
                 "packageName": "https://github.com/rails/rails.git",
                 "sourceUrl": "https://github.com/rails/rails",
                 "updates": [
                   {
                     "bucket": "non-major",
                     "newVersion": "v7.2.2",
                     "newValue": "vv7.2.2",
                     "newMajor": 7,
                     "newMinor": 2,
                     "newPatch": 2,
                     "updateType": "patch",
                     "isRange": true,
                     "branchName": "renovate/ruby-on-rails-monorepo"
                   },
                   {
                     "bucket": "major",
                     "newVersion": "v8.0.0",
                     "newValue": "vv8.0.0",
                     "newMajor": 8,
                     "newMinor": 0,
                     "newPatch": 0,
                     "updateType": "major",
                     "isRange": true,
                     "branchName": "renovate/major-ruby-on-rails-monorepo"
                   }
                 ],
                 "versioning": "ruby",
                 "warnings": [],
                 "currentVersion": "v7.2.1",
                 "isSingleVersion": false,
                 "fixedVersion": "v7.2.1"
               }
             ],
             "lockFiles": ["Gemfile.lock"],
             "packageFile": "Gemfile"
           }
         ]
       }
DEBUG: detectSemanticCommits() (repository=local)
DEBUG: semanticCommits: returning "disabled" from cache (repository=local)
DEBUG: repository problems (repository=local)
       "repoProblems": [
         "WARN: Custom registries are not allowed for this datasource and will be ignored"
       ]
DEBUG: Repository timing splits (milliseconds) (repository=local)
       "splits": {"init": 388, "extract": 161, "lookup": 242},
       "total": 791
DEBUG: Package cache statistics (repository=local)
       "get": {"count": 2, "avgMs": 34, "medianMs": 64, "maxMs": 64, "totalMs": 68},
       "set": {"count": 0, "avgMs": 0, "medianMs": 0, "maxMs": 0, "totalMs": 0}
DEBUG: HTTP statistics (repository=local)
       "hosts": {},
       "requests": 0
DEBUG: HTTP cache statistics (repository=local)
DEBUG: Lookup statistics (repository=local)
       "ruby-version": {"count": 1, "avgMs": 65, "medianMs": 65, "maxMs": 65, "totalMs": 65},
       "git-refs": {"count": 1, "avgMs": 180, "medianMs": 180, "maxMs": 180, "totalMs": 180}
 INFO: Repository finished (repository=local)
       "cloned": undefined,
       "durationMs": 791
DEBUG: Checking file package cache for expired items
DEBUG: Deleted 0 of 28 file cached entries in 18ms

https://github.com/renovate-reproductions/33005

@rarkins rarkins added manager:bundler Bundler (Ruby) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:bundler Bundler (Ruby) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant