Avoid deleting data without prompt #325

Closed
opened 2022-05-30 07:57:39 +00:00 by mayel · 4 comments
Member

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

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
mayel added the
bug
abra
labels 2022-05-30 07:57:39 +00:00
Owner

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.

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.
Author
Member

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 that abra 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?

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 that `abra 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?
Owner

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 then abra 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?

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 then `abra 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?
decentral1se added this to the (deleted) project 2022-10-22 12:29:23 +00:00
decentral1se added the
good first issue
label 2022-10-22 12:34:16 +00:00
decentral1se self-assigned this 2023-01-23 11:28:02 +00:00
Owner

Finally handled in coop-cloud/abra#262.

Finally handled in https://git.coopcloud.tech/coop-cloud/abra/pulls/262.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#325
No description provided.