flyteorg / flyte

Scalable and flexible workflow orchestration platform that seamlessly unifies data, ML and analytics stacks.
https://flyte.org
Apache License 2.0
5.76k stars 656 forks source link

[FlyteCTL Feature] Require a user ACK or --force flag for update commands #3986

Open andrewwdye opened 1 year ago

andrewwdye commented 1 year ago

Describe the feature/command for FlyteCTL

For update commands like flytectl update cluster-resource-attribute it's really easy to inadvertently override existing values. For commands that are mutating/destructive where update acts as an insert or an upsert, we should require an interactive user ACK or --force flag to ensure these changes are explicit.

For scope, see commands at https://github.com/flyteorg/flytectl/tree/master/cmd/update

Note, this is a breaking change for non-interactive scripts. They would need to be updated to pass --force.

Expected work

  1. Identify subset of commands that act as insert or upsert and require an ACK
  2. For each, query the current value, and if one exists, request positive confirmation of the change from the user
  3. Add an optional --force flag to bypass the interactive confirmation in (2). This allows for usage of flytectl in scripts

Provide a possible output or UX example

> flytectl update cluster-resource-attribute --attrFile cra.yaml
Found existing cluster resource attribute for project 'flytesnacks', domain 'development'.
Are you sure you want to overwrite [y/N]?

y
> flytectl update cluster-resource-attribute --attrFile cra.yaml --force

Are you sure this issue hasn't been raised already?

Have you read the Code of Conduct?

github-actions[bot] commented 4 months ago

Hello 👋, this issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will engage on it to decide if it is still applicable. Thank you for your contribution and understanding! 🙏