Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Implement basic soft deletion for workspaces #657

Merged
merged 5 commits into from
Jan 20, 2025

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Jan 20, 2025

this adds a deleted_at column to workspaces that implements a basic
soft-deletion mechanism. All relevant queries have been modified to reflect this.

At the moment, there is no hard deletion of workspaces; this will be
implemented in the future.

We also have no way of showing "archived" or "soft-deleted" workspaces.
This will come in due time.

Signed-off-by: Juan Antonio Osorio [email protected]

this adds a `deleted_at` column to workspaces that implements a basic
soft-deletion mechanism. All relevant queries have been modified to reflect this.

At the moment, there is no hard deletion of workspaces; this will be
implemented in the future.

We also have no way of showing "archived" or "soft-deleted" workspaces.
This will come in due time.

Signed-off-by: Juan Antonio Osorio <[email protected]>
Signed-off-by: Juan Antonio Osorio <[email protected]>
@JAORMX JAORMX requested a review from aponcedeleonch January 20, 2025 14:23
@JAORMX JAORMX marked this pull request as ready for review January 20, 2025 14:23
Signed-off-by: Juan Antonio Osorio <[email protected]>
@lukehinds lukehinds self-requested a review January 20, 2025 14:45
Copy link
Contributor

@aponcedeleonch aponcedeleonch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments. The one that I would like to get attended is the one about listing the workspaces. I didn't see the query update.

aponcedeleonch
aponcedeleonch previously approved these changes Jan 20, 2025
Signed-off-by: Juan Antonio Osorio <[email protected]>
Copy link
Contributor

@aponcedeleonch aponcedeleonch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a fix

@aponcedeleonch
Copy link
Contributor

I'm getting

 "Workspace._remove_workspace() takes 2 positional arguments but 3 were given"

Signed-off-by: Juan Antonio Osorio <[email protected]>
except crud.WorkspaceDoesNotExistError:
return f"Workspace **{workspace_name}** does not exist"
except Exception:
return "An error occurred while removing the workspace"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should give the user a clearer error message of what's going on. I got this when trying to delete the active workspace. It's ok to fix on a later PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you open a bug about this? I can fix it tomorrow.

@JAORMX JAORMX merged commit c140e65 into stacklok:main Jan 20, 2025
3 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants