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
JAORMX merged 5 commits into
stacklok:mainfrom
JAORMX:soft-deletes
Jan 20, 2025
Merged

Implement basic soft deletion for workspaces#657
JAORMX merged 5 commits into
stacklok:mainfrom
JAORMX:soft-deletes

Conversation

@JAORMX

Copy link
Copy Markdown
Contributor

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 ozz@stacklok.com

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 <ozz@stacklok.com>
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
@JAORMX
JAORMX marked this pull request as ready for review January 20, 2025 14:23
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
@lukehinds
lukehinds self-requested a review January 20, 2025 14:45
Comment threadsrc/codegate/pipeline/cli/commands.py
Comment threadsrc/codegate/workspaces/crud.py Outdated

@aponcedeleonchaponcedeleonch left a comment

Copy link
Copy Markdown
Member

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 <ozz@stacklok.com>

@aponcedeleonchaponcedeleonch left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

I'm getting

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

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
Comment threadsrc/codegate/pipeline/cli/commands.py Outdated
except crud.WorkspaceDoesNotExistError:
return f"Workspace **{workspace_name}** does not exist"
except Exception:
return "An error occurred while removing the workspace"

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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.

Sign up for freeto 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

@JAORMX@aponcedeleonch