Avoid deleting data without prompt #325
Labels
No Label
abra
abra-gandi
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
democracy
design
documentation
duplicate
enhancement
finance
funding
good first issue
help wanted
installer
kadabra
performance
proposal
question
recipes.coopcloud.tech
security
test
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/organising#325
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If you already have a directory for a server and then try to
abra server add
it deletes it and the files inside:INFO[0004] /Users/me/.abra/servers/example.bonfire.cafe already exists
WARN[0013] cleaning up context for example.bonfire.cafe
WARN[0013] cleaning up server directory for example.bonfire.cafe
Oh damn, hope you didn't lose any data @mayel 😱
This logic was implemented to clean up failed server add attempts.
I think a fix might be "check if files in server directory, delete context / directory if not" logic? I'd rather not add an additional prompt for an internal logic and I guess people won't want to delete the context & directory if they have files inside it! Lemme know if that sounds weird.
No data loss don't worry :)
Here's how I came across this issue, I wanted to create several new instances similar to an existing one (with similar env keys), so duplicated it's folder, renamed each copy and renamed/edited the config files within. Then doing
abra server ls
showed that the servers didn't have a host/user/port associated and I assumed thatabra server add
would allow me to add those and used the ready-made folder.Weird workflow maybe, and I'm not suggesting that you support it (I ended up just doing
abra server add
and copying the configs into the blank directories after). But yeah, maybe just aborting if it exists?Ran into this again.
Our internal Autonomic workflow goes like this: we have a single "coop-cloud-apps" repository with every server directory in it with all the
.env
files. We use a Makefile to symlink the stuff into~/.abra/servers/...
but thenabra server ls
shows that none of them have any connections details connected.@knoflook has suggested that this ticket is related and we could solve this inside
abra
itself.So, it seems we need to 1. not delete server directory 2. if we detect a directory that has no server details, error / warning out with a "you need to
abra server add
this thing to get a connection" going?Finally handled in coop-cloud/abra#262.