-
-
Notifications
You must be signed in to change notification settings - Fork 916
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
Prevent yanking of popular gem version #1377
Conversation
852ec18
to
39da34f
Compare
@@ -171,6 +171,10 @@ def platformed? | |||
|
|||
delegate :reorder_versions, to: :rubygem | |||
|
|||
def can_yank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding a ?
to this method? So it becomes can_yank?
? Or maybe yankable?
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I didn't use yankable
is because it isn't an actual word by dictionary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok :-) Can we in that case at the ?
?
Thank you. 😃 |
39da34f
to
2a48903
Compare
IMHO, the current text is not appropriate for failure of cc: @dwradcliffe |
if @deletion.save | ||
StatsD.increment 'yank.success' | ||
render text: "Successfully deleted gem: #{@version.to_title}" | ||
if @version.can_yank? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvanbaarsen Done. :)
I agree with @sonalkr132's suggestion, and I think the error message should come from a validation. I would also like this to show a clear error message with wording like "Gem versions cannot be yanked after they have been downloaded over 15,000 times". @sonalkr132, if you have time now, I would be happy to merge a PR based on this that makes those changes. |
@shlok007 wanted to work on this. I am sure he can make requested change 👌 |
👍💯 |
I have made a separate PR covering those changes. #1396 . Closing this. |
Refers to issue #1226 .