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

feat: add ability to not "clean" target directory during retrieve #217

Open
techfg opened this issue Sep 18, 2024 · 0 comments
Open

feat: add ability to not "clean" target directory during retrieve #217

techfg opened this issue Sep 18, 2024 · 0 comments

Comments

@techfg
Copy link

techfg commented Sep 18, 2024

Currently, when executing a retrieve, the target directory is cleaned entirely prior to the writing the retrieved files. This has several shortcomings especially when a filter (e.g., app name) is applied.

I think there are a few options:

  1. Make the default behavior to not do a clean unless a flag is passed (e.g., --clean)
  2. Leave the default behavior and add a flag to not clean (e.g., --no-clean)
  3. Make the default behavior to do a clean when no filter is specified and not do a clean when a filter is applied providing a flag to override the default behavior as appropriate (e.g., --mode [clean | no-clean]`

Generally speaking, performing destructive operations by default is not a good thing. That said, if you retrieve, then delete something on the server via web ui, then deploy (without doing another retrieve), the entity you deleted will be created again.

I think it really comes down to what perspective the CLI is intended to operate in - is it to "make the state of my local match the server" or is it to "update/merge my local state with the state of the server". The answer to this would likely come from usage statistics, user persona's etc. in terms of what the "default" would be based on the most common usage scenarios.

Regardless of answers to what the default behavior is, the user should have the ability to either clean or not clean to provide the appropriate amount of flexibility for all scenarios.

techfg added a commit to techfg/skuid-cli that referenced this issue Sep 18, 2024
I considered a few different options here including naming the flag `overwrite` instead of `no-clean` or making it an enum with `replace` | `overwrite`.  Also considered changing the default behavior to not `clean`.  In the end, the only real way to know what the default should be is to know more about the "average" user persona and their use cases so for now, just leaving the existing default to avoid any breaking changes and adding a `no-clean` option since `replace/overwrite` could be a little ambiguous.

This is easy enough to change so input is welcomed and happy to make adjustments.

Resolves skuid#217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant