Skip to content

Commit 3263e93

Browse files
authored
Add metric for tracking BUNDLED WITH existence (heroku#1707)
Track apps with and without `BUNDLED WITH` in the `Gemfile.lock`. This will show how many apps are using the default bundler version.
1 parent 49ae8e0 commit 3263e93

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Add metric: Track apps with and without `BUNDLED WITH` in the `Gemfile.lock`
56

67
## [v345] - 2026-01-26
78

lib/language_pack/helpers/gemfile_lock.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def initialize(contents:, report: HerokuBuildReport::GLOBAL)
8989
@empty = true
9090
@version = nil
9191
end
92+
93+
report.capture("gemfile_lock.bundled_with.empty" => @empty)
9294
end
9395

9496
def empty?

spec/helpers/gemfile_lock_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
expect(gemfile_lock.bundler.version).to eq(nil)
1717
expect(gemfile_lock.bundler.empty?).to eq(true)
18-
expect(report.data).to be_empty
18+
expect(report.data).to eq({"gemfile_lock.bundled_with.empty" => true})
1919
end
2020

2121
it "records invalid parsing" do

spec/helpers/heroku_ruby_installer_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def ruby_version
8282
"ruby_version_major_minor" => "3.5",
8383
"ruby_version_full" => "3.5.0.preview1",
8484
"ruby_version_origin" => "Gemfile.lock",
85-
"ruby_version_unique" => "ruby-3.5.0.preview1"
85+
"ruby_version_unique" => "ruby-3.5.0.preview1",
86+
"gemfile_lock.bundled_with.empty" => true
8687
}
8788

8889
expect(sort_hash(report.data)).to eq(sort_hash(expected))
@@ -121,7 +122,8 @@ def ruby_version
121122
"jruby_version_major_minor" => "9.4",
122123
"jruby_version_ruby_version" => "3.1.4",
123124
"ruby_version_origin" => "Gemfile.lock",
124-
"ruby_version_unique" => "ruby-3.1.4-jruby-9.4.9.0"
125+
"ruby_version_unique" => "ruby-3.1.4-jruby-9.4.9.0",
126+
"gemfile_lock.bundled_with.empty" => true
125127
}
126128

127129
expect(sort_hash(report.data)).to eq(sort_hash(expected))

0 commit comments

Comments
 (0)