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

Dependabot doesn't recognize Gemfile "file:" directive for Ruby version #8539

Closed
1 task done
bewuethr opened this issue Dec 6, 2023 · 6 comments
Closed
1 task done
Labels
L: ruby:bundler RubyGems via bundler T: bug 🐞 Something isn't working

Comments

@bewuethr
Copy link

bewuethr commented Dec 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Package ecosystem

Bundler

Package manager version

Bundler 2.4.22

Language version

Ruby 3.2.2

Manifest location and content before the Dependabot update

/Gemfile, contents:

source "https://rubygems.org"

ruby file: ".tool-versions"

gem "jekyll"
gem "jekyll-feed"
gem "jekyll-include-cache"
gem "jekyll-last-modified-at"
gem "jekyll-paginate-v2"
gem "jekyll-redirect-from"
gem "jekyll-remote-theme"
gem "jekyll-sitemap"
gem "jemoji"

dependabot.yml content

version: 2

updates:
  # GitHub Actions
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: daily
      time: '08:00'  # yamllint disable-line rule:quoted-strings
      timezone: America/Toronto

  # Ruby Gems
  - package-ecosystem: bundler
    directory: /
    schedule:
      interval: daily
      time: '08:00'  # yamllint disable-line rule:quoted-strings
      timezone: America/Toronto

Updated dependency

n/a

What you expected to see, versus what you actually saw

Dependabot update jobs fail with this message:

Bundler::Dsl::DSLError with message: [!] There was an error parsing `Gemfile`: No such file or directory @ rb_sysopen - dependabot_tmp_dir/.tool-versions. Bundler cannot continue.

 #  from dependabot_tmp_dir/Gemfile:3
 #  -------------------------------------------
 #  
 >  ruby file: ".tool-versions"
 #  
 #  -------------------------------------------

Native package manager behavior

Bundler accesses the specified file .tool-versions to extract the Ruby version.

Images of the diff or a link to the PR, issue, or logs

Smallest manifest that reproduces the issue

Gemfile:

source "https://rubygems.org"

ruby file: ".tool-versions"

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:

PLATFORMS
  x86_64-linux

DEPENDENCIES

RUBY VERSION
   ruby 3.2.2p53

BUNDLED WITH
   2.4.22

.tool-versions:

ruby 3.2.2
@bewuethr
Copy link
Author

bewuethr commented Dec 6, 2023

It looks like if this method

def ruby_version_file
return unless gemfile
return unless gemfile.content.include?(".ruby-version")
@ruby_version_file ||=
fetch_file_if_present(".ruby-version")
&.tap { |f| f.support_file = true }
end

also checked for .tool-versions, things might work?

@deivid-rodriguez deivid-rodriguez added the L: ruby:bundler RubyGems via bundler label Dec 6, 2023
@deivid-rodriguez
Copy link
Contributor

Yeah, that sounds like it might work. Would you be willing to open a PR for it?

@bewuethr
Copy link
Author

bewuethr commented Dec 6, 2023

Yeah, that sounds like it might work. Would you be willing to open a PR for it?

I can try! I'll take a crack this weekend.

@grzuy
Copy link

grzuy commented Mar 24, 2024

I suspect this will be fixed by #9070

@bewuethr
Copy link
Author

bewuethr commented Mar 24, 2024

I suspect this will be fixed by #9070

Looks like it! Excellent 😃 My "crack" ended in the middle of trying to understand the docker setup 😅

@bewuethr
Copy link
Author

I think #9070 fixed this! Thanks @kpumuk 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: ruby:bundler RubyGems via bundler T: bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@grzuy @deivid-rodriguez @bewuethr and others