Skip to content

Retry a full clone when git server does not support shallow capabilities#7649

Merged
martinemde merged 2 commits into
ruby:masterfrom
llenk:fix_http_depth_fetching
May 22, 2024
Merged

Retry a full clone when git server does not support shallow capabilities#7649
martinemde merged 2 commits into
ruby:masterfrom
llenk:fix_http_depth_fetching

Conversation

@llenk
Copy link
Copy Markdown
Contributor

@llenk llenk commented May 10, 2024

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

#7547

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

The depth arguments in the git command were causing the problem. If we get the error on the first try, we remove the depth arguments from the command and try again.

Make sure the following tasks are checked

@welcome
Copy link
Copy Markdown

welcome Bot commented May 10, 2024

Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality.

We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below.

If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack.

For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide

@martinemde
Copy link
Copy Markdown
Contributor

@llenk thank you! It was great working with you at RailsConf.

Comment thread bundler/lib/bundler/source/git/git_proxy.rb Outdated
@deivid-rodriguez deivid-rodriguez linked an issue May 13, 2024 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Added a minor style comment but looks good to me other than that.

Copy link
Copy Markdown
Contributor

@martinemde martinemde left a comment

Choose a reason for hiding this comment

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

I like the revisions. Looks more general now. Maybe even a pattern to follow if there's other ways to back off the command when it doesn't work.

Copy link
Copy Markdown

@simi simi left a comment

Choose a reason for hiding this comment

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

🤔 IMHO best would be to be able to check if remote supports "shallow capabilities", but I wasn't able to find out generic way to find out.

@simi
Copy link
Copy Markdown

simi commented May 16, 2024

@llenk would you mind to squash commits please before merge?

@deivid-rodriguez
Copy link
Copy Markdown
Contributor

🤔 IMHO best would be to be able to check if remote supports "shallow capabilities", but I wasn't able to find out generic way to find out.

I was considering that, but (in addition to not being obvious how to do it) since most servers these days support them, it felt better to optimize for that case, and react when servers don't support it, instead of detecting support upfront.

Copy link
Copy Markdown
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Thanks for the great work here!

@martinemde martinemde merged commit 72635d3 into ruby:master May 22, 2024
@martinemde
Copy link
Copy Markdown
Contributor

Oops, I didn't notice it wasn't squashed yet. It's only 1 extra commit so I won't feel too bad 😉

@deivid-rodriguez deivid-rodriguez changed the title Fix for gems not downloading from git via http Retry a full clone when git server does not support shallow capabilities May 28, 2024
deivid-rodriguez pushed a commit that referenced this pull request May 28, 2024
Fix gems not downloading when shallow clone unavailable

(cherry picked from commit 72635d3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.4 breaks dumb (http) git repo support (for no good reason?)

4 participants