Skip to content

Commit 8744257

Browse files
authored
Merge pull request #9363 from Shopify/ec-dependency-spec-size
Add a new Bundler config to control how many specs are fetched
2 parents 99a5b40 + 77def7f commit 8744257

34 files changed

Lines changed: 58 additions & 32 deletions

bundler/lib/bundler/fetcher/dependency.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def dependency_specs(gem_names)
5050

5151
def unmarshalled_dep_gems(gem_names)
5252
gem_list = []
53-
gem_names.each_slice(Source::Rubygems::API_REQUEST_SIZE) do |names|
53+
gem_names.each_slice(api_request_size) do |names|
5454
marshalled_deps = downloader.fetch(dependency_api_uri(names)).body
5555
gem_list.concat(Bundler.safe_load_marshal(marshalled_deps))
5656
end
@@ -74,6 +74,12 @@ def dependency_api_uri(gem_names = [])
7474
uri.query = "gems=#{CGI.escape(gem_names.sort.join(","))}" if gem_names.any?
7575
uri
7676
end
77+
78+
private
79+
80+
def api_request_size
81+
Bundler.settings[:api_request_size]&.to_i || Source::Rubygems::API_REQUEST_SIZE
82+
end
7783
end
7884
end
7985
end

bundler/lib/bundler/man/bundle-add.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-ADD" "1" "February 2026" ""
3+
.TH "BUNDLE\-ADD" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-binstubs.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-BINSTUBS" "1" "February 2026" ""
3+
.TH "BUNDLE\-BINSTUBS" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-cache.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CACHE" "1" "February 2026" ""
3+
.TH "BUNDLE\-CACHE" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-check.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CHECK" "1" "February 2026" ""
3+
.TH "BUNDLE\-CHECK" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-clean.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CLEAN" "1" "February 2026" ""
3+
.TH "BUNDLE\-CLEAN" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-config.1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CONFIG" "1" "February 2026" ""
3+
.TH "BUNDLE\-CONFIG" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-config\fR \- Set bundler configuration options
66
.SH "SYNOPSIS"
@@ -70,6 +70,9 @@ Any periods in the configuration keys must be replaced with two underscores when
7070
.SH "LIST OF AVAILABLE KEYS"
7171
The following is a list of all configuration keys and their purpose\. You can learn more about their operation in bundle install(1) \fIbundle\-install\.1\.html\fR\.
7272
.TP
73+
\fBapi_request_size\fR (\fBBUNDLE_API_REQUEST_SIZE\fR)
74+
Configure how many dependencies to fetch when resolving the specifications\. This configuration is only used when fetchig specifications from RubyGems servers that didn't implement the Compact Index API\. Defaults to 100\.
75+
.TP
7376
\fBauto_install\fR (\fBBUNDLE_AUTO_INSTALL\fR)
7477
Automatically run \fBbundle install\fR when gems are missing\.
7578
.TP

bundler/lib/bundler/man/bundle-config.1.ronn

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ the environment variable `BUNDLE_LOCAL__RACK`.
106106
The following is a list of all configuration keys and their purpose. You can
107107
learn more about their operation in [bundle install(1)](bundle-install.1.html).
108108

109+
* `api_request_size` (`BUNDLE_API_REQUEST_SIZE`):
110+
Configure how many dependencies to fetch when resolving the specifications.
111+
This configuration is only used when fetchig specifications from RubyGems
112+
servers that didn't implement the Compact Index API.
113+
Defaults to 100.
109114
* `auto_install` (`BUNDLE_AUTO_INSTALL`):
110115
Automatically run `bundle install` when gems are missing.
111116
* `bin` (`BUNDLE_BIN`):

bundler/lib/bundler/man/bundle-console.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CONSOLE" "1" "February 2026" ""
3+
.TH "BUNDLE\-CONSOLE" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-console\fR \- Open an IRB session with the bundle pre\-loaded
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-doctor.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-DOCTOR" "1" "February 2026" ""
3+
.TH "BUNDLE\-DOCTOR" "1" "March 2026" ""
44
.SH "NAME"
55
\fBbundle\-doctor\fR \- Checks the bundle for common problems
66
.SH "SYNOPSIS"

0 commit comments

Comments
 (0)