GoogleCloudPlatform / GoogleCloudPlatform/gsutil

gsutil rm -r should have a guardrail for versioned objects

Open
#1,630 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

I'm bothered that the specified behavior for `gsutil rm -r` is to also remove old versions of a current versioned object. I understand there is a workaround using `**`, for the conscious user. But a favorite versioning use case (or would be, if it worked) is as protection against someone fat-fingering a `rm -r`, currently handily and (I'd say) surprisingly defeated by this ignore-versioning behavior.

If one has gone the extra step to enable versioning, perhaps requiring an extra effort to remove all versions is a good thing. Might we have a guardrail, requiring `-r -a` to clobber old versions of versioned objects?

If the old behavior needs to be preserved for someone who does a lot of versioned deleting and hates extra flags, might we make this dont-lose behavior a configurable preference?

(asking for a friend...)

Contributor guide

Open the contributing guide

Research direction

The issue concerns gsutil rm -r handling of versioned objects and proposes requiring -a for recursive deletion of old versions, with a configurable preference as an alternative. Start by tracing the rm command's option handling and deletion behavior; done means choosing and documenting one guardrail policy and covering the relevant versioned-delete cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, python
Domain
cli, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.