GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Add command line flag to disable confirmation prompt for setting retention lock

Open Beginner friendly
#1,483 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

If you run `gsutil retention lock gs://my-bucket` you will get a confirmation prompt like:
```
This will PERMANENTLY set the Retention Policy on gs://my-bucket to:

Retention Policy (UNLOCKED):
Duration: 3 Day(s)
Effective Time: Tue, 22 Mar 2022 16:53:19 GMT

This setting cannot be reverted! Continue? [y|N]:
```
This requires interactive input. I can't do it in an automated script. Please add a `--force` flag that bypasses the prompt.

Contributor guide

Open the contributing guide

Research direction

Start at the command-line entry point for `gsutil retention lock` and trace how its confirmation prompt is handled. Add a `--force` option that bypasses the prompt while preserving the default confirmation behavior, then verify the command works in automated use.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.