Include detailed dependencies when gemfile and lockfile are conflicts#9332
Open
Include detailed dependencies when gemfile and lockfile are conflicts#9332
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the error message displayed when Bundler detects a mismatch between dependencies specified in a gemspec and those recorded in the lockfile. Instead of showing only the gem name and version, the error now displays detailed information about which dependencies differ between the gemspec and lockfile.
Changes:
- Enhanced
IncorrectLockfileDependencieserror class to accept and display detailed dependency information - Updated the error instantiation in
lazy_specification.rbto pass dependency details - Added comprehensive unit tests for the error class covering all scenarios
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| bundler/lib/bundler/errors.rb | Enhanced IncorrectLockfileDependencies to display detailed dependency differences when available |
| bundler/lib/bundler/lazy_specification.rb | Updated error instantiation to pass actual and lockfile dependencies |
| bundler/spec/bundler/errors_spec.rb | Added comprehensive unit tests for the enhanced error message |
| bundler/spec/install/failure_spec.rb | Added integration test to verify the detailed error message behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was the end-user or developer problem that led to this PR?
When dependabot or people changed constraint of lockfile,
bundle installshows only parent gem name and version now.I enhanced the error message to clearly display differences between gemspec and lockfile dependencies when they don't match.
What is your fix for the problem, implemented in this PR?
Before
After
We easily find json and parser is conflict with rubocop update.
/cc @r7kamura
Make sure the following tasks are checked