ruby / ruby/rbs

Updating collection lock is required on `bundle install`

Open
#794 2 comments 1 reaction 1 assignee View on GitHub

@pocke is already working on this.

Since Sep 16, 2021.

Dominant language
Ruby
Stars
2.2k
Forks
256
Avg merge
6d 17h
Merged PRs (30d)
37

Description

Problem

bundle install (and bundle update) requires rbs collection update when it updates Gemfile.lock about gems which have sig/. For example:

  1. Install gem X v1.0.0 with bundler
  2. rbs collection install
    • rbs_collection.lock.yaml has gem X entry with v1.0.0
  3. bundle exec rbs validate or something
    • It works
  4. Update gem X to v1.0.1 with bundler
    • Gemfile.lock is updated
  5. bundle exec rbs validate or something
    • It doesn't work because rbs_collection.lock.yaml specifies gem X v1.0.0 but the version doesn't exist in the Bundler environment.
    • So we need to re-run rbs collection install to update rbs_collection.lock.yaml.

I think it is not a bug, but it takes time. Too strict I guess.

I can imagine this behavior will be a blocker of dependabot. For example:

  1. Dependabot creates a PR to update gem X from v1.0.0 to v1.0.1
  2. CI runs with rbs collection install --freeze and steep check
  3. It fails because rbs_collection.lock.yaml has gem X v1.0.0 but actually v1.0.1 is installed.

Solution idea

Add an option to relax the version specification.
For example

  • The configuration file has an option like prefer_gemfile_lock_version (the naming is tentative)
  • If the option is enabled, rbs collection ignores version in rbs_collection.lock.yaml fi the source is rubygems. Then it uses versions in Gemfile.lock instaed.
  • The problem is solved...?

I got feedback from @ybiquitous. Thanks!
https://twitter.com/ybiquitous/status/1438019865130848258

I guess your problem is the same as mine. If your problem is a different one, feel free comment to on this issue or create a new issue. Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.