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

Ruby: Gemfile.lock lockfile maintenance removes locked platforms #14156

Closed
jgraichen opened this issue Feb 10, 2022 · 6 comments · Fixed by #14159
Closed

Ruby: Gemfile.lock lockfile maintenance removes locked platforms #14156

jgraichen opened this issue Feb 10, 2022 · 6 comments · Fixed by #14159
Assignees
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

@jgraichen
Copy link
Contributor

How are you running Renovate?

WhiteSource Renovate hosted app on github.com

If you're self-hosting Renovate, tell us what version of Renovate you run.

No response

Please select which platform you are using if self-hosting.

No response

If you're self-hosting Renovate, tell us what version of the platform you run.

No response

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

Renovatebot seems to remove additional platforms from the Gemfile.lock when doing lockfile maintenance.

See the following example PR: https://github.com/jgraichen/test-renovate-gemfile-platform/pull/2/files

This does not happen on regular version bumps: https://github.com/jgraichen/test-renovate-gemfile-platform/pull/3/files

I saw that in a few projects. Platforms were removed at least since Feb 7, and it appears to have worked at least before Jan 31:

I'd suspect that #14005 changed the behavior. This is quite an issue for multi-platform ruby projects, as renovate basically removes all platforms on every Gemfile.lock maintenance.

With bundler, extra platforms can be added by developers (e.g. bundle lock --add-platform x86_64-darwin-19). The lock file will contain all resolved gems for all platforms, as they can have different dependencies.

For example, see here. The "ruby" platform (no native gems) has more dependencies, as it will need to compile nokogiri (libxml bindings) locally. Other platforms, such as x86_64-linux, can download the precompiled gems from rubygems.org.

As far as I understood #14005, this restores the behavior of removing the Gemfile.lock before running bundle lock again. Unfortunately, this will throw away all added platforms and will generate new Gemfile.lock for only the local platform (x86_64-linux as renovate is running on Linux).

When doing lock file maintenance with a Gemfile.lock, the lock file probably should not be deleted. Instead, bundle lock --update (without arguments) can be used to update all gems in an existing Gemfile.lock. That will not install any gems, but only update the lock file.

Relevant debug logs

Logs

Copied from (https://app.renovatebot.com/dashboard).

DEBUG: No dangling containers to remove
INFO: Repository started
{
  "renovateVersion": "31.74.1"
}
DEBUG: Using localDir: /mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform
DEBUG: Repository cache is valid
DEBUG: initRepo("jgraichen/test-renovate-gemfile-platform")
DEBUG: Overriding default GitHub endpoint
{
  "endpoint": "https://api.github.com/"
}
DEBUG: jgraichen/test-renovate-gemfile-platform default branch = main
DEBUG: Using app token for git init
DEBUG: resetMemCache()
DEBUG: Resetting npmrc
DEBUG: detectSemanticCommits()
DEBUG: checkOnboarding()
DEBUG: isOnboarded()
DEBUG: Checking cached config file name
DEBUG: Existing config file confirmed
DEBUG: Repo is onboarded
DEBUG: migrateAndValidate()
DEBUG: No config migration necessary
DEBUG: massaged config
{
  "config": {
    "$schema": "https://docs.renovatebot.com/renovate-schema.json",
    "extends": [
      "github>whitesource/merge-confidence:beta",
      "config:base",
      "schedule:weekly",
      ":maintainLockFilesWeekly"
    ],
    "dependencyDashboard": true,
    "dependencyDashboardAutoclose": true
  }
}
DEBUG: migrated config
{
  "config": {
    "$schema": "https://docs.renovatebot.com/renovate-schema.json",
    "extends": [
      "github>whitesource/merge-confidence:beta",
      "config:base",
      "schedule:weekly",
      ":maintainLockFilesWeekly"
    ],
    "dependencyDashboard": true,
    "dependencyDashboardAutoclose": true
  }
}
DEBUG: Setting hostRules from config
DEBUG: Found repo ignorePaths
{
  "ignorePaths": [
    "**/node_modules/**",
    "**/bower_components/**",
    "**/vendor/**",
    "**/examples/**",
    "**/__tests__/**",
    "**/test/**",
    "**/tests/**",
    "**/__fixtures__/**"
  ]
}
DEBUG: No vulnerability alerts found
DEBUG: No vulnerability alerts found
DEBUG: findIssue(Dependency Dashboard)
DEBUG: Retrieving issueList
DEBUG: Retrieved 1 issues
DEBUG: Found issue 1
DEBUG: No baseBranches
DEBUG: extract()
DEBUG: Setting current branch to main
DEBUG: Initializing git repository into /mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform
DEBUG: Performing blobless clone
DEBUG: git clone completed
{
  "durationMs": 838
}
DEBUG: latest repository commit
{
  "latestCommit": {
    "hash": "2aae156aed5192f493d18e07e456d855bf117db8",
    "date": "2022-02-10T20:08:30+01:00",
    "message": "Set up renovatebot",
    "refs": "HEAD -> main, origin/main, origin/HEAD",
    "body": "",
    "author_name": "Jan Graichen",
    "author_email": "[email protected]"
  }
}
DEBUG: latest commit
{
  "branchName": "main",
  "latestCommitDate": "2022-02-10T20:08:30+01:00"
}
DEBUG: Using file match: (^|/)tasks/[^/]+\.ya?ml$ for manager ansible
DEBUG: Using file match: (^|/)requirements\.ya?ml$ for manager ansible-galaxy
DEBUG: Using file match: (^|/)galaxy\.ya?ml$ for manager ansible-galaxy
DEBUG: Using file match: azure.*pipelines?.*\.ya?ml$ for manager azure-pipelines
DEBUG: Using file match: (^|/)batect(-bundle)?\.yml$ for manager batect
DEBUG: Using file match: (^|/)batect$ for manager batect-wrapper
DEBUG: Using file match: (^|/)WORKSPACE(|\.bazel)$ for manager bazel
DEBUG: Using file match: \.bzl$ for manager bazel
DEBUG: Using file match: (^|/)\.?bitbucket-pipelines\.ya?ml$ for manager bitbucket-pipelines
DEBUG: Using file match: buildkite\.ya?ml for manager buildkite
DEBUG: Using file match: \.buildkite/.+\.ya?ml$ for manager buildkite
DEBUG: Using file match: (^|/)Gemfile$ for manager bundler
DEBUG: Using file match: \.cake$ for manager cake
DEBUG: Using file match: (^|/)Cargo.toml$ for manager cargo
DEBUG: Using file match: (^|/).circleci/config.yml$ for manager circleci
DEBUG: Using file match: (^|/)cloudbuild.ya?ml for manager cloudbuild
DEBUG: Using file match: (^|/)Podfile$ for manager cocoapods
DEBUG: Using file match: (^|/)([\w-]*)composer.json$ for manager composer
DEBUG: Using file match: (^|/)deps\.edn$ for manager deps-edn
DEBUG: Using file match: (^|/)docker-compose[^/]*\.ya?ml$ for manager docker-compose
DEBUG: Using file match: (^|/|\.)Dockerfile$ for manager dockerfile
DEBUG: Using file match: (^|/)Dockerfile\.[^/]*$ for manager dockerfile
DEBUG: Using file match: (^|/).drone.yml$ for manager droneci
DEBUG: Using file match: (^|/)flux-system/gotk-components\.yaml$ for manager flux
DEBUG: Using file match: (^|/).gitmodules$ for manager git-submodules
DEBUG: Using file match: (^workflow-templates|\.github\/workflows)\/[^/]+\.ya?ml$ for manager github-actions
DEBUG: Using file match: (^|\/)action\.ya?ml$ for manager github-actions
DEBUG: Using file match: \.gitlab-ci\.yml$ for manager gitlabci
DEBUG: Using file match: \.gitlab-ci\.yml$ for manager gitlabci-include
DEBUG: Using file match: (^|/)go.mod$ for manager gomod
DEBUG: Using file match: \.gradle(\.kts)?$ for manager gradle
DEBUG: Using file match: (^|\/)gradle\.properties$ for manager gradle
DEBUG: Using file match: (^|\/)gradle\/.+\.toml$ for manager gradle
DEBUG: Using file match: \.versions\.toml$ for manager gradle
DEBUG: Using file match: (^|/)gradle/wrapper/gradle-wrapper.properties$ for manager gradle-wrapper
DEBUG: Using file match: (^|/)requirements\.yaml$ for manager helm-requirements
DEBUG: Using file match: (^|/)values.yaml$ for manager helm-values
DEBUG: Using file match: (^|/)helmfile.yaml$ for manager helmfile
DEBUG: Using file match: (^|/)Chart.yaml$ for manager helmv3
DEBUG: Using file match: ^Formula/[^/]+[.]rb$ for manager homebrew
DEBUG: Using file match: \.html?$ for manager html
DEBUG: Using file match: (^|/)plugins\.(txt|ya?ml)$ for manager jenkins
DEBUG: Using file match: (^|/)jsonnetfile.json$ for manager jsonnet-bundler
DEBUG: Using file match: (^|/)kustomization\.yaml for manager kustomize
DEBUG: Using file match: (^|/)project\.clj$ for manager leiningen
DEBUG: Using file match: (^|/|\.)pom\.xml$ for manager maven
DEBUG: Using file match: ^(((\.mvn)|(\.m2))/)?settings\.xml$ for manager maven
DEBUG: Using file match: (^|/)package.js$ for manager meteor
DEBUG: Using file match: (^|/)mix\.exs$ for manager mix
DEBUG: Using file match: (^|/).node-version$ for manager nodenv
DEBUG: Using file match: (^|/)package.json$ for manager npm
DEBUG: Using file match: \.(?:cs|fs|vb)proj$ for manager nuget
DEBUG: Using file match: \.(?:props|targets)$ for manager nuget
DEBUG: Using file match: (^|\/)dotnet-tools\.json$ for manager nuget
DEBUG: Using file match: (^|\/)global\.json$ for manager nuget
DEBUG: Using file match: (^|/)\.nvmrc$ for manager nvm
DEBUG: Using file match: (^|/)([\w-]*)requirements\.(txt|pip)$ for manager pip_requirements
DEBUG: Using file match: (^|/)setup.py$ for manager pip_setup
DEBUG: Using file match: (^|/)Pipfile$ for manager pipenv
DEBUG: Using file match: (^|/)pyproject\.toml$ for manager poetry
DEBUG: Using file match: (^|/)\.pre-commit-config\.yaml$ for manager pre-commit
DEBUG: Using file match: (^|/)pubspec\.ya?ml$ for manager pub
DEBUG: Using file match: (^|/).python-version$ for manager pyenv
DEBUG: Using file match: (^|/)\.ruby-version$ for manager ruby-version
DEBUG: Using file match: \.sbt$ for manager sbt
DEBUG: Using file match: project/[^/]*.scala$ for manager sbt
DEBUG: Using file match: (^|/)setup\.cfg$ for manager setup-cfg
DEBUG: Using file match: (^|/)Package\.swift for manager swift
DEBUG: Using file match: \.tf$ for manager terraform
DEBUG: Using file match: (^|/)\.terraform-version$ for manager terraform-version
DEBUG: Using file match: (^|/)terragrunt\.hcl$ for manager terragrunt
DEBUG: Using file match: (^|/)\.terragrunt-version$ for manager terragrunt-version
DEBUG: Using file match: ^.travis.yml$ for manager travis
DEBUG: Matched 1 file(s) for manager bundler: Gemfile
DEBUG: Found Gemfile.lock file(packageFile="Gemfile")
DEBUG: Found bundler package files
DEBUG: Found 1 package file(s)
INFO: Dependency extraction complete
{
  "baseBranch": "main",
  "stats": {
    "managers": {
      "bundler": {
        "fileCount": 1,
        "depCount": 1
      }
    },
    "total": {
      "fileCount": 1,
      "depCount": 1
    }
  }
}
DEBUG: Package releases lookups complete
{
  "baseBranch": "main"
}
DEBUG: branchifyUpgrades
DEBUG: 2 flattened updates found: nokogiri
DEBUG: Returning 2 branch(es)
DEBUG: config.repoIsOnboarded=true
DEBUG: packageFiles with updates
{
  "config": {
    "bundler": [
      {
        "packageFile": "Gemfile",
        "registryUrls": [
          "https://rubygems.org"
        ],
        "deps": [
          {
            "depName": "nokogiri",
            "managerData": {
              "lineNumber": 4
            },
            "currentValue": "1.13.0",
            "datasource": "rubygems",
            "lockedVersion": "1.13.0",
            "depIndex": 0,
            "updates": [
              {
                "bucket": "non-major",
                "newVersion": "1.13.1",
                "newValue": "1.13.1",
                "newMajor": 1,
                "newMinor": 13,
                "updateType": "patch",
                "branchName": "renovate/nokogiri-1.x"
              }
            ],
            "warnings": [],
            "versioning": "ruby",
            "currentVersion": "1.13.0",
            "isSingleVersion": true,
            "fixedVersion": "1.13.0"
          }
        ],
        "lockFiles": [
          "Gemfile.lock"
        ],
        "constraints": {
          "bundler": "2.3.6"
        }
      }
    ]
  }
}
DEBUG: processRepo()
DEBUG: Processing 2 branches: renovate/lock-file-maintenance, renovate/nokogiri-1.x
DEBUG: Calculating hourly PRs remaining
DEBUG: Retrieving PR list
DEBUG: Retrieved 0 Pull Requests
DEBUG: currentHourStart=2022-02-10T19:00:00.000+00:00
DEBUG: PR hourly limit remaining: 2
DEBUG: Calculating prConcurrentLimit (10)
DEBUG: getBranchPr(renovate/nokogiri-1.x)
DEBUG: findPr(renovate/nokogiri-1.x, undefined, open)
DEBUG: findPr(renovate/nokogiri-1.x, undefined, closed)
DEBUG: getBranchPr(renovate/lock-file-maintenance)
DEBUG: findPr(renovate/lock-file-maintenance, undefined, open)
DEBUG: findPr(renovate/lock-file-maintenance, undefined, closed)
DEBUG: 0 PRs are currently open
DEBUG: PR concurrent limit remaining: 10
DEBUG: Calculated maximum PRs remaining this run
{
  "prsRemaining": 2
}
DEBUG: PullRequests limit = 2
DEBUG: Calculating hourly PRs remaining
DEBUG: currentHourStart=2022-02-10T19:00:00.000+00:00
DEBUG: PR hourly limit remaining: 2
DEBUG: Calculating branchConcurrentLimit (10)
DEBUG: 0 already existing branches found:
DEBUG: Branch concurrent limit remaining: 10
DEBUG: Calculated maximum branches remaining this run
{
  "branchesRemaining": 2
}
DEBUG: Branches limit = 2
DEBUG: Setting current branch to main(branch="renovate/nokogiri-1.x")
DEBUG: latest commit(branch="renovate/nokogiri-1.x")
{
  "branchName": "main",
  "latestCommitDate": "2022-02-10T20:08:30+01:00"
}
DEBUG: getBranchPr(renovate/nokogiri-1.x)(branch="renovate/nokogiri-1.x")
DEBUG: findPr(renovate/nokogiri-1.x, undefined, open)(branch="renovate/nokogiri-1.x")
DEBUG: findPr(renovate/nokogiri-1.x, undefined, closed)(branch="renovate/nokogiri-1.x")
DEBUG: branchExists=false(branch="renovate/nokogiri-1.x")
DEBUG: dependencyDashboardCheck=undefined(branch="renovate/nokogiri-1.x")
DEBUG: recreateClosed is false(branch="renovate/nokogiri-1.x")
DEBUG: findPr(renovate/nokogiri-1.x, Update dependency nokogiri to v1.13.1, !open)(branch="renovate/nokogiri-1.x")
DEBUG: prAlreadyExisted=false(branch="renovate/nokogiri-1.x")
DEBUG: Checking schedule(before 3am on Monday, null)(branch="renovate/nokogiri-1.x")
DEBUG: Checking 1 schedule(s)(branch="renovate/nokogiri-1.x")
DEBUG: Checking schedule "before 3am on Monday"(branch="renovate/nokogiri-1.x")
{
  "parsedSchedule": {
    "schedules": [
      {
        "t_b": [
          10800
        ],
        "d": [
          2
        ]
      }
    ],
    "exceptions": [],
    "error": -1
  }
}
DEBUG: Package not scheduled(branch="renovate/nokogiri-1.x")
DEBUG: Skipping branch creation as not within schedule(branch="renovate/nokogiri-1.x")
DEBUG: Setting current branch to main(branch="renovate/lock-file-maintenance")
DEBUG: latest commit(branch="renovate/lock-file-maintenance")
{
  "branchName": "main",
  "latestCommitDate": "2022-02-10T20:08:30+01:00"
}
DEBUG: getBranchPr(renovate/lock-file-maintenance)(branch="renovate/lock-file-maintenance")
DEBUG: findPr(renovate/lock-file-maintenance, undefined, open)(branch="renovate/lock-file-maintenance")
DEBUG: findPr(renovate/lock-file-maintenance, undefined, closed)(branch="renovate/lock-file-maintenance")
DEBUG: branchExists=false(branch="renovate/lock-file-maintenance")
DEBUG: dependencyDashboardCheck=unschedule(branch="renovate/lock-file-maintenance")
DEBUG: recreateClosed is true(branch="renovate/lock-file-maintenance")
DEBUG: Checking schedule(before 3am on Monday, null)(branch="renovate/lock-file-maintenance")
DEBUG: Checking 1 schedule(s)(branch="renovate/lock-file-maintenance")
DEBUG: Checking schedule "before 3am on Monday"(branch="renovate/lock-file-maintenance")
{
  "parsedSchedule": {
    "schedules": [
      {
        "t_b": [
          10800
        ],
        "d": [
          2
        ]
      }
    ],
    "exceptions": [],
    "error": -1
  }
}
DEBUG: Package not scheduled(branch="renovate/lock-file-maintenance")
DEBUG: Branch needs creating(branch="renovate/lock-file-maintenance")
DEBUG: Using reuseExistingBranch: false(branch="renovate/lock-file-maintenance")
DEBUG: manager.getUpdatedPackageFiles() reuseExistinbranch=false(branch="renovate/lock-file-maintenance")
DEBUG: bundler.updateArtifacts(Gemfile)(branch="renovate/lock-file-maintenance")
DEBUG: Using docker to execute(branch="renovate/lock-file-maintenance")
{
  "image": "ruby"
}
DEBUG: No tag or tagConstraint specified(branch="renovate/lock-file-maintenance")
{
  "image": "docker.io/renovate/ruby"
}
DEBUG: Fetching Docker image: docker.io/renovate/ruby(branch="renovate/lock-file-maintenance")
DEBUG: Finished fetching Docker image(branch="renovate/lock-file-maintenance")
DEBUG: Executing command(branch="renovate/lock-file-maintenance")
{
  "command": "docker run --rm --name=renovate_ruby --label=renovate_child -v \"/mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform\":\"/mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e GEM_HOME -w \"/mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform\" docker.io/renovate/ruby bash -l -c \"install-tool bundler 2.3.6 && ruby --version && bundler lock\""
}
DEBUG: exec completed(branch="renovate/lock-file-maintenance")
{
  "cmd": "docker run --rm --name=renovate_ruby --label=renovate_child -v \"/mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform\":\"/mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e GEM_HOME -w \"/mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform\" docker.io/renovate/ruby bash -l -c \"install-tool bundler 2.3.6 && ruby --version && bundler lock\"",
  "durationMs": 9410,
  "stdout": "Installing legacy tool bundler v2.3.6\nSuccessfully installed bundler-2.3.6\n1 gem installed\nBundler version 2.3.6\nruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]\nFetching gem metadata from https://rubygems.org/.......\nResolving dependencies...\nWriting lockfile to /mnt/renovate/gh/jgraichen/test-renovate-gemfile-platform/Gemfile.lock\n",
  "stderr": ""
}
DEBUG: Returning updated Gemfile.lock(branch="renovate/lock-file-maintenance")
DEBUG: No package files need updating(branch="renovate/lock-file-maintenance")
DEBUG: Updated 1 lock files(branch="renovate/lock-file-maintenance")
{
  "updatedArtifacts": [
    "Gemfile.lock"
  ]
}
DEBUG: 1 file(s) to commit(branch="renovate/lock-file-maintenance")
DEBUG: Preparing files for committing to branch renovate/lock-file-maintenance(branch="renovate/lock-file-maintenance")
DEBUG: Setting git author name(branch="renovate/lock-file-maintenance")
{
  "gitAuthorName": "Renovate Bot"
}
DEBUG: Setting git author email(branch="renovate/lock-file-maintenance")
{
  "gitAuthorEmail": "[email protected]"
}
DEBUG: git commit(branch="renovate/lock-file-maintenance")
{
  "deletedFiles": [],
  "ignoredFiles": [],
  "result": {
    "author": null,
    "branch": "renovate/lock-file-maintenance",
    "commit": "b76e7e6",
    "root": false,
    "summary": {
      "changes": 1,
      "insertions": 0,
      "deletions": 10
    }
  }
}
DEBUG: Pushing branch renovate/lock-file-maintenance(branch="renovate/lock-file-maintenance")
DEBUG: git push(branch="renovate/lock-file-maintenance")
{
  "result": {
    "pushed": [
      {
        "deleted": false,
        "tag": false,
        "branch": true,
        "new": true,
        "alreadyUpdated": false,
        "local": "refs/heads/renovate/lock-file-maintenance",
        "remote": "refs/heads/renovate/lock-file-maintenance"
      }
    ],
    "branch": {
      "local": "renovate/lock-file-maintenance",
      "remote": "renovate/lock-file-maintenance",
      "remoteName": "origin"
    },
    "ref": {
      "local": "refs/remotes/origin/renovate/lock-file-maintenance"
    },
    "remoteMessages": {
      "all": [
        "Create a pull request for 'renovate/lock-file-maintenance' on GitHub by visiting:",
        "https://github.com/jgraichen/test-renovate-gemfile-platform/pull/new/renovate/lock-file-maintenance"
      ],
      "pullRequestUrl": "https://github.com/jgraichen/test-renovate-gemfile-platform/pull/new/renovate/lock-file-maintenance"
    }
  }
}
DEBUG: Fetching branch renovate/lock-file-maintenance(branch="renovate/lock-file-maintenance")
INFO: Branch created(branch="renovate/lock-file-maintenance")
{
  "commitSha": "b76e7e669a6e7c6e2adf4888b1e8ea69bfd83374"
}
DEBUG: Ensuring PR(branch="renovate/lock-file-maintenance")
DEBUG: There are 0 errors and 0 warnings(branch="renovate/lock-file-maintenance")
DEBUG: getBranchPr(renovate/lock-file-maintenance)(branch="renovate/lock-file-maintenance")
DEBUG: findPr(renovate/lock-file-maintenance, undefined, open)(branch="renovate/lock-file-maintenance")
DEBUG: findPr(renovate/lock-file-maintenance, undefined, closed)(branch="renovate/lock-file-maintenance")
DEBUG: Creating PR(branch="renovate/lock-file-maintenance")
{
  "prTitle": "Lock file maintenance"
}
DEBUG: Creating PR(branch="renovate/lock-file-maintenance")
{
  "title": "Lock file maintenance",
  "head": "jgraichen:renovate/lock-file-maintenance",
  "base": "main",
  "draft": false
}
DEBUG: PR created(branch="renovate/lock-file-maintenance")
{
  "pr": 2,
  "draft": false
}
DEBUG: Adding labels '' to #2(branch="renovate/lock-file-maintenance")
INFO: PR created(branch="renovate/lock-file-maintenance")
{
  "pr": 2,
  "prTitle": "Lock file maintenance"
}
DEBUG: addAssigneesReviewers(pr=2)(branch="renovate/lock-file-maintenance")
DEBUG: Created Pull Request #2(branch="renovate/lock-file-maintenance")
DEBUG: PR is not configured for automerge(branch="renovate/lock-file-maintenance")
DEBUG: getBranchPr(renovate/lock-file-maintenance)
DEBUG: findPr(renovate/lock-file-maintenance, undefined, open)
DEBUG: Found PR #2
DEBUG: Returning from graphql open PR list
DEBUG: Ensuring Dependency Dashboard
DEBUG: ensureIssue(Dependency Dashboard)
DEBUG: Patching issue
DEBUG: Issue updated
DEBUG: Removing any stale branches
DEBUG: config.repoIsOnboarded=true
DEBUG: Branch lists
{
  "branchList": [
    "renovate/lock-file-maintenance",
    "renovate/nokogiri-1.x"
  ],
  "renovateBranches": [
    "renovate/lock-file-maintenance"
  ]
}
DEBUG: remainingBranches=
DEBUG: No branches to clean up
DEBUG: Repository timing splits (milliseconds)
{
  "splits": {
    "init": 1923,
    "extract": 2240,
    "lookup": 935,
    "update": 34552
  },
  "total": 40860
}
DEBUG: http statistics
{
  "urls": {
    "https://api.github.com/graphql (POST)": 4,
    "https://api.github.com/repos/jgraichen/test-renovate-gemfile-platform/contents/renovate.json5 (GET)": 1,
    "https://api.github.com/repos/jgraichen/test-renovate-gemfile-platform/issues/1 (GET)": 2,
    "https://api.github.com/repos/jgraichen/test-renovate-gemfile-platform/issues/1 (PATCH)": 1,
    "https://api.github.com/repos/jgraichen/test-renovate-gemfile-platform/pulls (GET)": 1,
    "https://api.github.com/repos/jgraichen/test-renovate-gemfile-platform/pulls (POST)": 1,
    "https://api.github.com/repos/whitesource/merge-confidence/contents/beta.json (GET)": 1
  },
  "hostStats": {
    "api.github.com": {
      "requestCount": 11,
      "requestAvgMs": 308,
      "queueAvgMs": 0
    }
  },
  "totalRequests": 11
}
INFO: Repository finished
{
  "durationMs": 40860
}

Have you created a minimal reproduction repository?

I have linked to a minimal reproduction repository in the bug description

@jgraichen jgraichen added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels Feb 10, 2022
@rarkins
Copy link
Collaborator

rarkins commented Feb 10, 2022

In general, Renovate's approach with Renovate's lock file maintenance is:

  • Delete the existing lock file
  • Run install or lock command as appropriate
  • Commit the new lock file

If bundle lock --update can achieve a full update then let's do that instead, and remove any logic in the bundler artifacts code to remove the existing lock file first.

@jgraichen
Copy link
Contributor Author

I am already working on a PR. I also will investigate a bit how new that flag in bundler is. Are there any constraints on what bundler versions must be supported?

@rarkins
Copy link
Collaborator

rarkins commented Feb 10, 2022

We try to keep supporting older versions of package managers if there's little impact to us, but otherwise if it's a burden then we fall back to supporting whatever the package manager's own support or LTS policy is.

@rarkins rarkins added manager:bundler Bundler (Ruby) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready and removed priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started labels Feb 10, 2022
@jgraichen
Copy link
Contributor Author

bundle lock --update is already used for updating specific gems. Therefore, that shouldn't matter when it was added to bundler.

I am first trying to get a reproducible test case, but I never worked with jest or snapshots. I'll open a PR and try to add everything there.

jgraichen added a commit to jgraichen/renovate that referenced this issue Feb 10, 2022
The bundler manager drops the Gemfile.lock before doing lock file
maintenance but bundler stores additional platforms for resolving only
in the lock file, such as `x86_64-darwin-20`. These additional platforms
and the resolved gems for these platforms are lost when the lock file
deleted. The newly generated platform will only contain the
`x86_64-linux` (or whatever the current platform is when renovate is
run).

This commit stops the manager from removing the lock file and instead
calls `bundler lock --update` to update the existing lock file
in-place.

Fixes renovatebot#14156
@jgraichen
Copy link
Contributor Author

I created #14159 with the necessary changes, and tested in a real repository. I wasn't able to find any test to extend, to ensure the platforms in the Gemfile.lock are preserved.

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 31.80.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

jgraichen added a commit to openmensa/openmensa that referenced this issue Feb 13, 2022
The platform was removed by renovatebot. See [1].

[1]: renovatebot/renovate#14156
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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

Successfully merging a pull request may close this issue.

3 participants