[pull] master from ruby:master#861
Merged
pull[bot] merged 14 commits intoturkdevops:masterfrom Mar 18, 2026
Merged
Conversation
…ded via gem sources
GitHub's private gem registry expects the first path segment after the host
to represent the namespace, typically the organization or user name. [1]
When adding a source with
```
gem sources --add https://user:password@rubygems.pkg.github.com/my-org
```
without a trailing slash, the last path segment ("my-org") is interpreted as a
file and removed during relative path resolution. This causes the resulting
URI to become
```
https://user:password@rubygems.pkg.github.com/gems/foo.gem
```
instead of the correct
```
https://user:password@rubygems.pkg.github.com/my-org/gems/foo.gem. [2]
```
Example error:
```
gem source -a https://user:password@rubygems.pkg.github.com/my-org
gem install -rf foo.gem
rubygems/remote_fetcher.rb:238:in `fetch_http': bad response Not Found 404 (https://user:REDACTED@rubygems.pkg.github.com/gems/foo-0.7.1.gem) (Gem::RemoteFetcher::FetchError)
```
Although this behavior complies with RFC 2396, it's incompatible with GitHub's
gem registry requirements.
The remote fetcher is just append a relative path without using ./ [3]
To address this, we automatically append a trailing slash when adding new gem
sources.
As illustrated in [4] and [5], given the base URI
```
http://a/b/c/d;p?q
```
and a relative path
```
g/f
```
the resolution process replaces "d;p?q" and yields
```
http://a/b/c/g/f
```
[1] https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry#authenticating-with-a-personal-access-token
[2] https://github.com/ruby/rubygems/blob/master/lib/rubygems/vendor/uri/lib/uri/generic.rb#L1053
[3] https://github.com/ruby/rubygems/blob/master/lib/rubygems/remote_fetcher.rb#L148
[4] https://www.rfc-editor.org/rfc/rfc2396#section-5.2
[5] https://www.rfc-editor.org/rfc/rfc2396#appendix-C
ruby/rubygems@b1e4fb15ae
- Rename add_trailing_slash to normalize_source_uri to better reflect that it also removes duplicated trailing slashes - Extract build_source and build_new_source to eliminate duplicated source creation pattern across add_source, append_source, prepend_source, and remove_source - Apply URI normalization to remove_source as well - Use \z instead of $ in trailing slash regex for correctness ruby/rubygems@3e81961ef8 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ormalization - Fix setup_fake_source double-slash bug: normalize URI before registering spec data to prevent URL mismatch in load_specs - Fix test_execute_add/append_https_rubygems_org: these tests were incorrectly expecting TermError due to the double-slash bug - Fix test_execute_prepend_without_trailing_slash: correct expected source order (prepend adds to front, not end) - Fix test_execute_remove_redundant_source_trailing_slash: path-less URIs are not modified by normalize_source_uri - Use assert_equal for Gem.sources to improve failure diagnostics ruby/rubygems@da8d622c05 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bumps the github-actions group with 2 updates in the / directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby) and [taiki-e/install-action](https://github.com/taiki-e/install-action). Updates `ruby/setup-ruby` from 1.294.0 to 1.295.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](ruby/setup-ruby@c984c1a...319994f) Updates `taiki-e/install-action` from 2.68.34 to 2.68.35 - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@de6bbd1...94a7388) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.295.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: taiki-e/install-action dependency-version: 2.68.35 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
Set GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM environment variables in the test suite setup to isolate git configuration when Git >= 2.32 is available. This prevents test runs from accidentally polluting the developer's real git config. ruby/rubygems@a9a921bf00 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use RequirementChecker to filter specs tagged with git version requirements (e.g., `git: ">= 2.28.0"`), matching the existing pattern used for rubygems version filtering. ruby/rubygems@d157405217 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PRs filed from branches in ruby/ruby (rather than forks) make it harder to manage the bi-directional mirror with git.ruby-lang.org. Add an auto-review comment asking contributors to re-file from a fork. Refactor #review into separate methods for each review type.
Replace `sleep 0.1` with `Thread.pass until threads.all?(&:stop?)` to ensure all worker threads have entered `condvar.wait` before broadcasting. The fixed sleep was insufficient on slow CI environments (e.g. Windows 2025), causing broadcast to fire before threads were waiting, leading to a deadlock and 60-second timeout failure. This matches the synchronization pattern already used in test_condvar_wait_exception_handling in the same file.
Looking at the profiling results below, we can likely inline `String#!=` similarly to how we already handle `Integer` (and some `BasicObject#!=` cases). As Max mentioned in [the original issue](Shopify#884 (comment)), we may be able to do more once the inliner lands. For now, this seems like a reasonable scope, since `String` is still a meaningful share in these benchmarks. Related discussion: - Shopify#884 - #16057 (comment) --- `BasicObject#!=` receiver/argument profiling results: ``` # railsbench Top-7 BasicObject#!= receiver/argument class buckets (100.0% of total 929,895): Other->Other: 599,324 (64.5%) Integer->Integer: 155,592 (16.7%) String->String: 125,159 (13.5%) NilClass->String: 49,646 ( 5.3%) Integer->Other: 170 ( 0.0%) NilClass->Other: 2 ( 0.0%) # lobsters Top-8 BasicObject#!= receiver/argument class buckets (100.0% of total 452,759): Other->Other: 251,034 (55.4%) Integer->Integer: 165,871 (36.6%) String->String: 29,478 ( 6.5%) NilClass->Other: 5,720 ( 1.3%) NilClass->NilClass: 346 ( 0.1%) Integer->Other: 171 ( 0.0%) String->Other: 138 ( 0.0%) NilClass->Integer: 1 ( 0.0%) ``` String specialization coverage after this change: (the number of successful `String#!=` inlines)) ``` # railsbench basic_object_neq_string_specialized: 125,159 (100.0% of string-typed BasicObject#!=) # lobsters basic_object_neq_string_specialized: 29,478 (99.5% of string-typed BasicObject#!=) ```
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )