[Source::Rubygems] Remove .gem if downloaded package is invalid#6010
[Source::Rubygems] Remove .gem if downloaded package is invalid#6010bundlerbot merged 1 commit intomasterfrom
Conversation
|
How does this work as the end user? Will bundler just try and download the gem again or will this raise an error? |
|
If possible, I'd like to try to re-download one time, and then delete the file again and print an error explaining that we tried to download the gem and the result was corrupted even on retry. 👍🏻 |
Sure! Should be possible. Fair warning, I might not be able to get around to that for few weeks, so someone else is more than welcome to take this over! |
|
Let's merge this for now, so that the cache will be cleared before the error, and hopefully it will work on the second run. I'll create a ticket for improving the UX. @bundlerbot r+ |
|
📌 Commit f420278 has been approved by |
[Source::Rubygems] Remove .gem if downloaded package is invalid ### What was the end-user problem that led to this PR? The problem was the user could (once) have downloaded a `.gem` file that isn't actually a `.gem`, and that package would poison their cache. Closes #5941. ### What was your diagnosis of the problem? My diagnosis was we should remove the `.gem` right after downloading it if we can't open it. ### What is your fix for the problem, implemented in this PR? My fix `rm_rf`'s the `.gem` on failure. ### Why did you choose this fix out of the possible options? I chose this fix because it won't accidentally nuke existing cache entries for a user, but it should help prevent Bundler propagating an issue.
|
💔 Test failed - status-travis |
|
@bundlerbot retry |
[Source::Rubygems] Remove .gem if downloaded package is invalid ### What was the end-user problem that led to this PR? The problem was the user could (once) have downloaded a `.gem` file that isn't actually a `.gem`, and that package would poison their cache. Closes #5941. ### What was your diagnosis of the problem? My diagnosis was we should remove the `.gem` right after downloading it if we can't open it. ### What is your fix for the problem, implemented in this PR? My fix `rm_rf`'s the `.gem` on failure. ### Why did you choose this fix out of the possible options? I chose this fix because it won't accidentally nuke existing cache entries for a user, but it should help prevent Bundler propagating an issue.
|
☀️ Test successful - status-travis |
What was the end-user problem that led to this PR?
The problem was the user could (once) have downloaded a
.gemfile that isn't actually a.gem, and that package would poison their cache.Closes #5941.
What was your diagnosis of the problem?
My diagnosis was we should remove the
.gemright after downloading it if we can't open it.What is your fix for the problem, implemented in this PR?
My fix
rm_rf's the.gemon failure.Why did you choose this fix out of the possible options?
I chose this fix because it won't accidentally nuke existing cache entries for a user, but it should help prevent Bundler propagating an issue.