Replace bundle config subprocess calls with in-process helpers#9435
Open
Replace bundle config subprocess calls with in-process helpers#9435
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Bundler spec suite to avoid spawning bundle config ... subprocesses by writing Bundler settings in-process via the config / global_config test helpers (which persist to .bundle/config).
Changes:
- Replaced
bundle "config set ..."/ legacybundle "config KEY VALUE"calls withconfig "BUNDLE_..." => "..."in many specs. - Replaced global-scope config writes with
global_configwhere appropriate. - Standardized settings keys to the
.bundle/config“BUNDLE_…” YAML key format (e.g.,path.system→BUNDLE_PATH__SYSTEM).
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/update/gemfile_spec.rb | Uses config helper to set BUNDLE_GEMFILE without a subprocess. |
| spec/runtime/setup_spec.rb | Replaces multiple bundle config set calls with config helper writes. |
| spec/runtime/self_management_spec.rb | Uses config helper for self-management-related settings (path, deployment, version). |
| spec/runtime/platform_spec.rb | Uses config helper for force_ruby_platform. |
| spec/runtime/inline_spec.rb | Uses config helper for force_ruby_platform and no_install. |
| spec/runtime/gem_tasks_spec.rb | Uses config helper for BUNDLE_PATH. |
| spec/runtime/executable_spec.rb | Uses config helper for BUNDLE_BIN. |
| spec/plugins/source/example_spec.rb | Uses config helper for BUNDLE_PATH in plugin source specs. |
| spec/plugins/install_spec.rb | Uses config helper for BUNDLE_DEPLOYMENT. |
| spec/other/major_deprecation_spec.rb | Uses config helper for BUNDLE_PATH/BUNDLE_FROZEN in deprecation scenarios. |
| spec/install/yanked_spec.rb | Uses config helper for BUNDLE_FORCE_RUBY_PLATFORM. |
| spec/install/path_spec.rb | Uses config/global_config helpers for path-related settings. |
| spec/install/global_cache_spec.rb | Uses config helper for path.system and local path settings. |
| spec/install/git_spec.rb | Uses config helper for path/without/clean settings. |
| spec/install/gems/standalone_spec.rb | Uses config helper for standalone install path/without settings. |
| spec/install/gems/post_install_spec.rb | Uses config helper for ignore_messages settings. |
| spec/install/gems/native_extensions_spec.rb | Uses config helper for build.* settings (BUNDLE_BUILD__...). |
| spec/install/gems/fund_spec.rb | Uses config helper for ignore_funding_requests. |
| spec/install/gems/flex_spec.rb | Uses config helper for force_ruby_platform. |
| spec/install/gems/dependency_api_spec.rb | Uses config helper for BUNDLE_DEPLOYMENT. |
| spec/install/gems/dependency_api_fallback_spec.rb | Uses config helper for BUNDLE_TIMEOUT. |
| spec/install/gems/compact_index_spec.rb | Uses config helper for deployment/path.system/disable_checksum_validation settings. |
| spec/install/gemfile_spec.rb | Uses config helper for BUNDLE_GEMFILE. |
| spec/install/gemfile/specific_platform_spec.rb | Uses config helper for path/frozen/cache_all_platforms settings. |
| spec/install/gemfile/sources_spec.rb | Uses config helper for deployment/path settings. |
| spec/install/gemfile/platform_spec.rb | Uses config helper for frozen/path/force_ruby_platform settings. |
| spec/install/gemfile/path_spec.rb | Uses config helper for frozen mode. |
| spec/install/gemfile/lockfile_spec.rb | Uses config helper for BUNDLE_PLUGINS. |
| spec/install/gemfile/groups_spec.rb | Uses config/global_config helpers for with/without settings. |
| spec/install/gemfile/git_spec.rb | Uses config/global_config helpers for checksums/frozen/global cache/path/deployment settings. |
| spec/install/gemfile/gemspec_spec.rb | Uses config helper for deployment/force_ruby_platform/without settings. |
| spec/install/gemfile/eval_gemfile_spec.rb | Uses config helper for deployment mode. |
| spec/install/deploy_spec.rb | Uses config helper for deployment/frozen/path/without settings. |
| spec/install/bundler_spec.rb | Uses config helper for force_ruby_platform/path/system/path settings. |
| spec/install/allow_offline_install_spec.rb | Uses config helper for BUNDLE_CLEAN. |
| spec/commands/version_spec.rb | Uses config helper for BUNDLE_SIMULATE_VERSION. |
| spec/commands/update_spec.rb | Uses config/global_config helpers for update/deployment/frozen/path.system/prefer_patch settings. |
| spec/commands/show_spec.rb | Uses config helper for BUNDLE_AUTO_INSTALL. |
| spec/commands/post_bundle_message_spec.rb | Uses config helper for path/path.system/without/force_ruby_platform settings. |
| spec/commands/outdated_spec.rb | Uses config helper for clean/auto_install/deployment settings. |
| spec/commands/open_spec.rb | Uses config helper for BUNDLE_AUTO_INSTALL. |
| spec/commands/newgem_spec.rb | Uses config helper for multiple gem.* settings (test/ci/linter/init_gems_rb). |
| spec/commands/lock_spec.rb | Uses config helper for without/path/force_ruby_platform/lockfile_checksums settings (includes an attempted unset conversion). |
| spec/commands/licenses_spec.rb | Uses config helper for BUNDLE_AUTO_INSTALL. |
| spec/commands/install_spec.rb | Uses config helper for force_ruby_platform/path/deployment/frozen/only settings. |
| spec/commands/init_spec.rb | Uses config helper for BUNDLE_INIT_GEMS_RB. |
| spec/commands/info_spec.rb | Uses config helper for path/without settings. |
| spec/commands/fund_spec.rb | Uses config helper for BUNDLE_WITH. |
| spec/commands/exec_spec.rb | Uses config/global_config helpers for path/path.system/clean/auto_install/disable_exec_load/gemfile settings. |
| spec/commands/console_spec.rb | Uses config helper for console/auto_install settings. |
| spec/commands/clean_spec.rb | Uses config helper for path/clean/without/dry_run/path.system settings. |
| spec/commands/check_spec.rb | Uses config helper for path/without/deployment/path.system settings. |
| spec/commands/cache_spec.rb | Uses config helper for cache_all/cache_all_platforms/without/frozen/path settings. |
| spec/commands/binstubs_spec.rb | Uses config helper for bin/auto_install settings. |
| spec/commands/add_spec.rb | Uses config helper for BUNDLE_FORCE_RUBY_PLATFORM. |
| spec/cache/path_spec.rb | Uses config helper for BUNDLE_CACHE_ALL. |
| spec/cache/git_spec.rb | Uses config helper for cache_all/path/deployment/frozen/global_gem_cache settings. |
| spec/cache/gems_spec.rb | Uses config helper for path.system/path/cache_all_platforms settings. |
| spec/cache/cache_path_spec.rb | Uses config helper for BUNDLE_CACHE_PATH. |
| spec/bundler/cli_spec.rb | Uses config/global_config helpers for default_cli_command/verbose/simulate_version/disable_version_check settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… specs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nfig helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ocess config helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rocess global_config helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ess config helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ess config helper Handle interpolated values, inline calls, and old-style forms that were missed in previous commits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…obal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
This reduced test time about 2-3min each Windows runner. Now, our test time is up to 22min with macOS and Windows. To make testing any faster, I think significant changes would be needed, such as switching from end-to-end (E2E) testing to unit testing. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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's this change?
Replace
bundle "config set --local",bundle "config set --global",bundle "config set"(no scope), and old-stylebundle "config KEY VALUE"subprocess calls with in-processbundle_config/bundle_config_globalhelpers (~385 subprocess eliminations)Motivation
Each
bundle "config set ..."call spawns a Ruby subprocess just to write a config file. Thebundle_configandbundle_config_globalhelpers do the same thing in-process viaBundler::Settings, eliminating the process startup overhead.Make sure the following tasks are checked