Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to override raw github sources #1992

Open
glyh opened this issue Aug 18, 2024 · 5 comments
Open

Allow user to override raw github sources #1992

glyh opened this issue Aug 18, 2024 · 5 comments
Assignees

Comments

@glyh
Copy link

glyh commented Aug 18, 2024

As title, access to raw.githubusercontent.com is an issue for Chinese users, and when running bundle exec tapioca init, I got the following:

$ bundle exec tapioca init
   identical  sorbet/config
   identical  sorbet/tapioca/config.yml
   identical  sorbet/tapioca/require.rb
       force  bin/tapioca
Retrieving index from central repository... 
Can't fetch file `index.json` from https://raw.githubusercontent.com/Shopify/rbi-central/main (Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443))

Tapioca can't access the annotations at https://raw.githubusercontent.com/Shopify/rbi-central/main.

Are you trying to access a private repository?
If so, please specify your Github credentials in your ~/.netrc file or by specifying the --auth option.

See https://github.com/Shopify/tapioca#using-a-netrc-file for more details.
Can't fetch annotations without sources (no index fetched)
@glyh
Copy link
Author

glyh commented Aug 18, 2024

Okay I figure it out:

bundle exec tapioca configure
bundle exec tapioca annotations --sources https://raw.kkgithub.com/Shopify/rbi-central/main
bundle exec tapioca gem

@glyh
Copy link
Author

glyh commented Aug 18, 2024

I think we'd better have a way to configure the raw sources from the init command, the above fix seems hacky.

@glyh
Copy link
Author

glyh commented Aug 18, 2024

Looks like there's just no way I can get it work as I don't have srb exectuable. Having a system proxy also won't make it work, as I still get the SSL error from the proxy. No clue.

@amomchilov
Copy link
Contributor

Hey @glyh

This isn't something we have capacity to tackle at the moment, but this looks like a really good "first issue" for community contribution, if that's something you'd be interested in.

Some thoughts:

  1. We wouldn't want to add configuration flags to tapioca init. After all, users are just getting started with Tapioca, we'd be making a bad first impression if we require them to dive into man pages right from square 1.

  2. It sounds reasonable to me that tapioca init should try to fetch annotations from the default source, but not "give up completely" if it can't connect.

  3. Instead, it'd be nice if it just said something along the lines of:

    $ bundle exec tapioca init
    identical  sorbet/config
    identical  sorbet/tapioca/config.yml
    identical  sorbet/tapioca/require.rb
        force  bin/tapioca
    Retrieving index from central repository... 
    Can't fetch file `index.json` from https://raw.githubusercontent.com/Shopify/rbi-central/main (Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443))
    
    Tapioca can't access the annotations at https://raw.githubusercontent.com/Shopify/rbi-central/main.
    
    Here are some things you can try:
        1. Check that your internet connection is online.
    
        2. Are trying to access a private repository?
           If so, please specify your Github credentials in your ~/.netrc file or by specifying the --auth option.
    
        3. Is GitHub available in your region?
    
           If not, you'll need to use an alternative source for RBI annotations.
           You can rerun this with:
    
           bundle exec tapioca annotations --sources https://example.com/your/source/here
    
    <... continue on with the rest of the init command>
    

@glyh
Copy link
Author

glyh commented Aug 29, 2024

I already said the hack I gave above won't fix this issue.

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

No branches or pull requests

2 participants