Skip to content

Comments

Honor concurrent_downloads from .gemrc in Gem::ConfigFile#9339

Merged
colby-swandale merged 1 commit intoruby:masterfrom
afurm:fix-concurrent-downloads-gemrc
Feb 19, 2026
Merged

Honor concurrent_downloads from .gemrc in Gem::ConfigFile#9339
colby-swandale merged 1 commit intoruby:masterfrom
afurm:fix-concurrent-downloads-gemrc

Conversation

@afurm
Copy link
Member

@afurm afurm commented Feb 18, 2026

What was the end-user or developer problem that led to this PR?

concurrent_downloads values configured in .gemrc were ignored during Gem::ConfigFile initialization.
Even with concurrent_downloads: 2 in config, RubyGems kept using the default value (8).

This made .gemrc behavior inconsistent with other config options (like verbose, update_sources, etc.) that are properly applied.

What is your fix for the problem, implemented in this PR?

I added a regression test to reproduce the issue:

  • test_initialize_concurrent_downloads writes concurrent_downloads: 2 to a config file
  • initializes Gem::ConfigFile
  • asserts @cfg.concurrent_downloads == 2

Before the fix, that test failed (expected 2, got 8).

Root cause:

  • concurrent_downloads was not included in the key normalization list that converts config keys to symbols
  • and it was not assigned from @hash during initialization

Fix implemented:

  • include concurrent_downloads in the transform-to-symbol allowlist
  • assign @concurrent_downloads = @hash[:concurrent_downloads] when present

I chose this approach because it matches the existing pattern used for other RubyGems config options, keeps behavior consistent, and is minimal/risk-contained.

Make sure the following tasks are checked

Copy link
Member

@colby-swandale colby-swandale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and easy! Thanks!

We'll probably need to update https://guides.rubygems.org/command-reference/ also, but that will need to be a separate PR.

@colby-swandale colby-swandale merged commit cac3a78 into ruby:master Feb 19, 2026
90 checks passed
@afurm afurm deleted the fix-concurrent-downloads-gemrc branch February 20, 2026 02:00
@afurm
Copy link
Member Author

afurm commented Feb 20, 2026

Nice and easy! Thanks!

We'll probably need to update https://guides.rubygems.org/command-reference/ also, but that will need to be a separate PR.

Thank you! I have created a separate PR for guides. #9341

colby-swandale added a commit that referenced this pull request Feb 20, 2026
…-reference

Document :concurrent_downloads in gem environment config docs (follow-up to #9339)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants