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

Update vendored gems when updating with bundler #11004

Open
jdelStrother opened this issue Jul 28, 2021 · 7 comments
Open

Update vendored gems when updating with bundler #11004

jdelStrother opened this issue Jul 28, 2021 · 7 comments
Labels
manager:bundler Bundler (Ruby) package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@jdelStrother
Copy link

What would you like Renovate to be able to do?

When submitting a PR to update a bundler dependency, it would be nice if Renovate updated the vendored gems in cache_path in addition to just tweaking the version numbers in Gemfile & Gemfile.lock

I set up https://github.com/jdelStrother/renovate-gem-caching as a test case, which caches its gems here - https://github.com/jdelStrother/renovate-gem-caching/tree/main/vendor/cache

Here's Renovate's PR, which bumps the Gemfile version, but doesn't touch vendor/cache.

And for comparison here's Dependabot's PR, which bumps the Gemfile version, and includes the updated gems. (You can opt in to this with vendor:true in dependabot's settings)

Tell us what requirements you need solving, and be sure to mention too if this is part of any "bigger" problem you're trying to solve

I'm running tests with github actions and an installation step like:

      - uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
          ruby-version: 2.7

which fails with Some gems seem to be missing from your vendor/cache directory during bundle install if the cache directory isn't kept up-to-date with new gem versions.

@jdelStrother jdelStrother added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality) labels Jul 28, 2021
@HonkingGoose HonkingGoose added manager:bundler Bundler (Ruby) package manager reproduction:provided labels Jul 29, 2021
@github-actions
Copy link
Contributor

Thank you for providing a reproduction! 🎉 🚀

The Renovate team will take a look at the reproduction repository.

@rarkins
Copy link
Collaborator

rarkins commented Jul 29, 2021

We will want to do this automatically without needing it to be opted into. i.e. if vendored files are detected then we commit any updates to them.

The question is: how to detect if they're pre-existing? e.g. presence of vendor/cache directory or some other single source of truth?

Should be similar to how we do it in Composer/PHP

@rarkins rarkins added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed priority-5-triage labels Jul 29, 2021
@booleanbetrayal
Copy link

We would also like this functionality and cache to the standard vendor/cache path, in case it helps. We've been bitten by CDN outages in the past so prefer to commit these in our repo.

@barillax
Copy link

barillax commented Nov 7, 2022

@rarkins I agree that simply checking for the existance of any .gem files in the /vendor/cache directory should be sufficient to understand if the project is vendoring gems. That said, I could imagine it would make sense to have an override flag for explicitly toggling the behavior, if that's a common pattern.

@booleanbetrayal
Copy link

Just checking to see if anyone is actively looking / prioritizing this issue.

@rarkins
Copy link
Collaborator

rarkins commented Feb 1, 2023

I'm not aware of anyone working on it, but considering we have a few other managers doing similar/same things, it should not be particularly complex for a community contribution.

@rarkins rarkins added status:ready and removed reproduction:provided status:requirements Full requirements are not yet known, so implementation should not be started labels Sep 26, 2023
@siebertm
Copy link

siebertm commented Sep 10, 2024

FYI, I was able to solve this using postUpdateTasks configuration:

In the repository config, I have

{
  "packageRules": [
    {
      "matchManagers": ["bundler"],
      "postUpgradeTasks": {
        "commands": ["bundle package --all --all-platforms"],
        "fileFilters": ["vendor/cache/**/*"],
        "executionMode": "branch"
      }
    }]
}

In order to allow executing the postUpgradeTask, it has to be enabled in self-hosted config:

{
  "allowedPostUpgradeCommands": ["^bundle package"]
}

Now, we have updated vendor/cache in our MRs. Profit!

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:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

6 participants