Skip to content

Conversation

@kimago
Copy link
Member

@kimago kimago commented Feb 3, 2026

TNZ-67131

Authored-by: Kim Bassett kim.bassett@broadcom.com

Thanks for opening a PR. Please make sure you've read and followed the Contributing guide, including signing the Contributor License Agreement.

Feature or Bug Description

What does this PR change?

Motivation

Tell us about the problem you are facing, with context, that this PR solves.

Related Issue

If this PR was first opened as an issue, please provide the link to that issue here.

@abg
Copy link
Member

abg commented Feb 5, 2026

@kimago I don't think you actually need this. You can override the mirror with existing features in the ruby ecosystem.

Here is an example using the BUNDLE_* environment variables.

## Old pxc-release Gemfile
# grep source Gemfile
source "https://rubygems.org"

## Break rubygems.org so we HAVE to use a mirror to prove the below suggestion works 
# cat >> /etc/hosts <<EOF
127.0.0.1 rubygems.org
127.0.0.1 index.rubygems.org
EOF 

# bundle install
...
Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to rubygems.org:443 (Connection refused - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)>
...


# export BUNDLE_MIRROR__RUBYGEMS__ORG="https://your.mirror/ruby/gems/endpoint" # <- url
# export BUNDLE_YOUR__DOMAIN__COM="$USERNAME:$PASSWORD" # <- credentials, usually via a secret
# bundle install --verbose
...
The definition is missing ["bosh-template-2.4.0", ...]
HTTP GET https://$USERNAME@your.mirror/ruby/gems/endpoint/versions
HTTP 200  https://$USERNAME@your.mirror/ruby/gems/endpoint/versions
...

# bundle exec rspec spec
......................................................................................................

Finished in 3.73 seconds (files took 0.63424 seconds to load)
102 examples, 0 failures

Can you let us know if this works for you?

@colins
Copy link
Member

colins commented Feb 5, 2026

Using the bundler mirror settings will fallback to the rubygems.org (or whatever is in the Gemfile) if the mirror doesn't respond.
https://bundler.io/man/bundle-config.1.html#MIRRORS-OF-GEM-SOURCE

@abg
Copy link
Member

abg commented Feb 5, 2026

Using the bundler mirror settings will fallback to the rubygems.org (or whatever is in the Gemfile) if the mirror doesn't respond.

That's fair. I withdraw my suggestion.

I went back and tested this behavior, but I didn't really see the fallback. Looks like if you do not set a fallback timeout or set it to zero, bundle install still just fails. Maybe a thin contract to rely on still.

Regardless, I approved this change.

@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Feb 5, 2026
@kimago kimago merged commit a8d22e7 into support/1.1.x Feb 12, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Feb 12, 2026
@kimago kimago deleted the chore/broadcom-ruby-mirrors-supportbranch-TNZ-67131 branch February 12, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants