Skip to content

Commit c9685ff

Browse files
Merge pull request #7794 from dependabot/deivid-rodriguez/run-group-vendor-tests
Make sure Bundler group vendoring smoke tests get actually run, and pass
2 parents 9f53299 + a16f201 commit c9685ff

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/smoke.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ jobs:
8484
- 'common/**'
8585
- 'updater/**'
8686
- 'bundler/**'
87+
bundler-group-vendoring:
88+
- .github/workflows/smoke.yml
89+
- .dockerignore
90+
- Dockerfile.updater-core
91+
- 'common/**'
92+
- 'updater/**'
93+
- 'bundler/**'
8794
cargo:
8895
- .github/workflows/smoke.yml
8996
- .dockerignore

bundler/helpers/v2/lib/functions/lockfile_updater.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,17 @@ def cache_vendored_gems(definition)
9292
def prune_gem_cache(resolve, cache_path, updated_gems)
9393
cached_gems = Dir["#{cache_path}/*.gem"]
9494

95-
outdated_gems = cached_gems.reject do |path|
95+
outdated_gems = cached_gems.select do |path|
9696
spec = Bundler.rubygems.spec_from_gem path
9797

98-
!updated_gems.include?(spec.name) || resolve.any? do |s|
98+
caused_by_update = updated_gems.include?(spec.name) && resolve.none? do |s|
9999
s.name == spec.name && s.version == spec.version &&
100100
!s.source.is_a?(Bundler::Source::Git)
101101
end
102+
103+
caused_by_removal = resolve.none? { |s| s.name == spec.name }
104+
105+
caused_by_update || caused_by_removal
102106
end
103107

104108
return unless outdated_gems.any?

0 commit comments

Comments
 (0)