You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have no way to know if we are going to overwrite local or remote changes when pushing or pulling from the vault. This is annoying when teammates forget to check for changes before syncing. I am not yet a regular user, I'm beginning to use the project, so I may be wrong. Please correct me if it is so.
Solution
Logic
dotenv-vault pull
Get the last local update date
Get the last remote update date
Throw an error on pull if last_local_update > last_remote_update
⇒ this means changes occurred locally between our last pull from the repo and our local edits.
dotenv-vault push
Get the last remote update date
Get the penultimate local update date
Throw an error on push if last_remote_update > penultimate_local_update
⇒ this means changes occurred on the remote between our last push to the repo and our local edits.
Modification to the CLI
You could either provide:
A new check-conflicts command. This would display if there is a discrepancy between the remote and the local changes, exit with error if there is, else exit successfully so that we can use it in scripts. This would not break default behaviour.
A new --check-conflicts flag to dotenv-vault push and dotenv-vault pull to exit with an error when pulling/pushing if changes were detected. This would not break default behaviour.
A new --ignore-conflicts flag to dotenv-vault push and dotenv-vault pull to ignore conflicts when pulling/pushing and override local state. This would break default behaviour, the new default would check for conflicts. I think this should be the default anyway, we should ask for input to be sure the user wants to override.
The text was updated successfully, but these errors were encountered:
Issue
We have no way to know if we are going to overwrite local or remote changes when pushing or pulling from the vault. This is annoying when teammates forget to check for changes before syncing. I am not yet a regular user, I'm beginning to use the project, so I may be wrong. Please correct me if it is so.
Solution
Logic
dotenv-vault pull
last_local_update
>last_remote_update
⇒ this means changes occurred locally between our last pull from the repo and our local edits.
dotenv-vault push
last_remote_update
>penultimate_local_update
⇒ this means changes occurred on the remote between our last push to the repo and our local edits.
Modification to the CLI
You could either provide:
check-conflicts
command. This would display if there is a discrepancy between the remote and the local changes, exit with error if there is, else exit successfully so that we can use it in scripts. This would not break default behaviour.--check-conflicts
flag todotenv-vault push
anddotenv-vault pull
to exit with an error when pulling/pushing if changes were detected. This would not break default behaviour.--ignore-conflicts
flag todotenv-vault push
anddotenv-vault pull
to ignore conflicts when pulling/pushing and override local state. This would break default behaviour, the new default would check for conflicts. I think this should be the default anyway, we should ask for input to be sure the user wants to override.The text was updated successfully, but these errors were encountered: