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

Add a script to restore a yanked version #1549

Merged
merged 2 commits into from
Mar 8, 2017

Conversation

sonalkr132
Copy link
Member

closes: #1548

RubygemFs::Local does not implement restore method as there is
no way to restore a deleted file locally. This script won't work in
development env.

Restoring a version will remove the yanked version line from our
versions response. compact index clients will end up requesting entire
versions response. It would be best to regenerate `versions.list` file.

`RubygemFs::Local` does not implement `restore` method as there is
no way to restore a deleted file locally. This script won't work in
development env.
def restore!
restore_to_index
restore_to_storage
destroy!
Copy link
Member

Choose a reason for hiding this comment

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

Should we mark as restored, instead of deleting the entry?

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that we want this restored version to be yankable in future, adding a restored flag would introduce two paths for deletion/yanking of a version. One where we create a new deletion record and other where we check if deletion record already exists and mark restored = false. I think it would create unnecessary confusion.
Can you please explain what is the value of marking it restored instead of deleting the record?

Copy link
Member

Choose a reason for hiding this comment

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

Can you please explain what is the value of marking it restored instead of deleting the record?

The value, would be to have a breadcrumb if deleted/restored gems, for future data finds.
However, I don't know how much do we care about that or not.

I agree that adding that flag would add more complexity to the code.

@indirect
Copy link
Member

indirect commented Mar 8, 2017

Thanks for automating this!

@indirect indirect merged commit 2a6d125 into rubygems:master Mar 8, 2017
@sonalkr132 sonalkr132 deleted the script-to-restore branch March 8, 2017 06:37
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.

Restoring a yanked gem
5 participants