`bundle outdated --filter-major --filter-minor --filter-patch` omits 4th-segment and prerelease-to-release updates
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Bắt đầu tại Bundler::CLI::Outdated#update_present_via_semver_portions, được nêu trong issue, và theo dõi cách spec.version.segments được so sánh với từng bộ lọc. Đọc các bài kiểm thử hiện có cho việc lọc bundle outdated và bổ sung kiểm thử cho các bản cập nhật ở phân đoạn thứ tư và từ prerelease lên release. Công việc hoàn tất khi bộ lọc patch báo cáo các bản cập nhật đó và kết hợp cả ba bộ lọc cho kết quả khớp với đầu ra không lọc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the problem as clearly as you can
bundle outdated --filter-patch (and even bundle outdated --filter-major --filter-minor --filter-patch) omits gems whose available update is in a 4th numeric segment (1.2.3 -> 1.2.3.1 or 1.2.3.4 -> 1.2.3.5, common for Rails and Nokogiri security releases) or from a prerelease to its final release (1.0.0.rc1 -> 1.0.0), even though plain bundle outdated lists them and GemVersionPromoter#filter_versions treats updates with matching major and minor segments as patch-level updates. When all outdated gems are of these forms, bundle outdated --filter-patch prints No patch updates to display. and exits 0.
In Bundler::CLI::Outdated#update_present_via_semver_portions, only indices 0, 1, and 2 of spec.version.segments (coerced with .to_i) are compared, so [1, 2, 3] vs [1, 2, 3, 1], [1, 2, 3, 4] vs [1, 2, 3, 5], and [1, 0, 0, "rc", 1] vs [1, 0, 0] all compare equal across major, minor, and patch and match none of the three filters.
Did you try upgrading rubygems & bundler?
Yes. Reproduced on RubyGems / Bundler 4.1.0 (Ruby 4.0.9) and on ruby/rubygems master (5879ffe34b67, 4.2.0.dev).
Post steps to reproduce the problem
mkdir /tmp/repro-outdated-filter && cd /tmp/repro-outdated-filter
mkdir -p repo/gems repo/quick/Marshal.4.8 app
ruby - << 'RUBY'
require "rubygems/package"
require "zlib"
specs = [
["aa", "1.2.3"], ["aa", "1.2.3.1"],
["bb", "1.2.3.4"], ["bb", "1.2.3.5"],
["cc", "1.0.0.rc1"], ["cc", "1.0.0"],
["dd", "1.2.3"], ["dd", "1.2.4"],
].map do |name, ver|
Gem::Specification.new do |s|
s.name = name; s.version = ver; s.summary = name; s.authors = ["test"]
end
end
specs.each do |s|
gem_file = Gem::Package.build(s, true)
File.rename(gem_file, "repo/gems/" + gem_file)
File.binwrite("repo/quick/Marshal.4.8/" + s.original_name + ".gemspec.rz",
Zlib::Deflate.deflate(Marshal.dump(s)))
end
rel, pre = specs.partition { |s| !s.version.prerelease? }
File.binwrite("repo/specs.4.8.gz",
Zlib.gzip(Marshal.dump(rel.map { |s| [s.name, s.version, "ruby"] })))
File.binwrite("repo/prerelease_specs.4.8.gz",
Zlib.gzip(Marshal.dump(pre.map { |s| [s.name, s.version, "ruby"] })))
RUBY
cat > app/Gemfile <<GEMFILE
source "file://$PWD/repo"
gem "aa", "1.2.3"
gem "bb", "1.2.3.4"
gem "cc", "1.0.0.rc1"
gem "dd", "1.2.3"
GEMFILE
cd app
bundle config set --local path vendor/bundle
bundle install
cat > Gemfile <<GEMFILE
source "file://$(dirname "$PWD")/repo"
gem "aa"
gem "bb"
gem "cc", ">= 1.0.0.rc1"
gem "dd"
GEMFILE
bundle outdated
bundle outdated --filter-major --filter-minor --filter-patch
bundle outdated --filter-patch aa bb cc
Which command did you run?
bundle outdated --filter-major --filter-minor --filter-patch and bundle outdated --filter-patch aa bb cc
What were you expecting to happen?
bundle outdated --filter-major --filter-minor --filter-patch should list aa, bb, cc, and dd, matching bundle outdated (bundle-outdated(1) states under FILTERING OUTPUT at https://bundler.io/man/bundle-outdated.1.html that combining all three filter options produces the same result as providing none of them), and bundle outdated --filter-patch aa bb cc should list aa, bb, and cc and exit 1.
What happened instead?
$ bundle outdated
Fetching source index from file:///tmp/repro-outdated-filter/repo/
Resolving dependencies...
Gem Current Latest Requested Groups Release Date
aa 1.2.3 1.2.3.1 >= 0 default
bb 1.2.3.4 1.2.3.5 >= 0 default
cc 1.0.0.rc1 1.0.0 >= 1.0.0.rc1 default
dd 1.2.3 1.2.4 >= 0 default
$ bundle outdated --filter-major --filter-minor --filter-patch
Fetching source index from file:///tmp/repro-outdated-filter/repo/
Resolving dependencies...
Gem Current Latest Requested Groups Release Date
dd 1.2.3 1.2.4 >= 0 default
$ bundle outdated --filter-patch aa bb cc
Fetching source index from file:///tmp/repro-outdated-filter/repo/
Resolving dependencies...
Resolving dependencies...
No patch updates to display.
bundle outdated --filter-patch aa bb cc exits with status 0.
If not included with the output of your command, run bundle env and paste the output below
## Environment
```
Bundler 4.1.0
Platforms ruby, x86_64-linux
Ruby 4.0.9p0 (2026-10-23 revision 3e93b23afcec3433f6aecc34b5d832799d754238) [x86_64-linux]
Full Path /opt/ruby-4.0.9/bin/ruby
Config Dir /opt/ruby-4.0.9/etc
RubyGems 4.1.0
Gem Home /opt/ruby-4.0.9/lib/ruby/gems/4.0.0
Gem Path /home/user/.local/share/gem/ruby/4.0.0:/opt/ruby-4.0.9/lib/ruby/gems/4.0.0
User Home /home/user
User Path /home/user/.local/share/gem/ruby/4.0.0
Bin Dir /opt/ruby-4.0.9/bin
Git 2.39.5
```
## Bundler Build Metadata
```
Timestamp 2026-11-16
Git SHA 9af9267
```
## Bundler settings
```
path
Set for your local app (/tmp/repro-outdated-filter/app/.bundle/config): "vendor/bundle"
```
## Gemfile
### Gemfile
```ruby
source "file:///tmp/repro-outdated-filter/repo"
gem "aa"
gem "bb"
gem "cc", ">= 1.0.0.rc1"
gem "dd"
```
### Gemfile.lock
```
GEM
remote: file:///tmp/repro-outdated-filter/repo/
specs:
aa (1.2.3)
bb (1.2.3.4)
cc (1.0.0.rc1)
dd (1.2.3)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
aa (= 1.2.3)
bb (= 1.2.3.4)
cc (= 1.0.0.rc1)
dd (= 1.2.3)
CHECKSUMS
aa (1.2.3) sha256=f80a3cf7e6036565271104ca8456835abf7e995d5b26b8895868efd36eec990d
bb (1.2.3.4) sha256=c0926288182253e9a7cffeb968d07056925b153d69818ac2597ae2dc0c993e11
cc (1.0.0.rc1) sha256=559e9a26bee896c492de1393b015f46df3390c9cbb3de7bbc7239ac76f8927e5
dd (1.2.3) sha256=3af7e397a5769cc5d58261f4a88d41283b109e1ee4fe7b9fbcb0eb54b92f17ee
BUNDLED WITH
4.1.0
```
Credit: https://ucsbplse.github.io/
- Ngôn ngữ chính
- Ruby
- Star
- 4k
- Fork
- 2k
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 73
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby/rubygems
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
RubyGems
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ruby/rubygems
Issue tương tự
-
Tools Page has Invalid LinksĐang mởPROJECT: website-redesign
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
thewca/worldcubeassociation.org#16617 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs: 1 broken linkĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
alphagov/govuk_app_config#654 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
voxpupuli/puppet-rabbitmq#1102 ·
-
Payment details dialog shows "Did not pass" for AVS/CVV results that mean the check wasn't performedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100