Skip to content

add vlab manager and delete projects scripts - #188

Open
bilalesi wants to merge 1 commit into
mainfrom
chore/management-scripts
Open

add vlab manager and delete projects scripts#188
bilalesi wants to merge 1 commit into
mainfrom
chore/management-scripts

Conversation

@bilalesi

Copy link
Copy Markdown
Collaborator

No description provided.

@bilalesi bilalesi self-assigned this Jun 16, 2026
@github-actions

Copy link
Copy Markdown

/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/safety/auth/main.py:6: AuthlibDeprecationWarning: authlib.jose module is deprecated, please use joserfc instead.
It will be compatible before version 2.0.0.
from authlib.jose import jwt

poetry audit report

Loading...
Scanning 106 packages...

No vulnerabilities found ✨✨

@bilalesi
bilalesi requested review from g-bar and pgetta June 30, 2026 08:02

@pgetta pgetta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving — the two admin scripts are careful (FK-ordered deletes, dry-run by default, per-project rollback, confirmation gates), the hard-delete covers all four tables referencing project.id, the project delete is scoped by virtual_lab_id, and all inspector attribute reads match the models.

One non-blocking warning to address before relying on this in production:

⚠️ scripts/delete_projects.py:907 — keep-mode treats unrecognized keep-IDs as a warning, not an abort.

delete_ids = sorted(all_ids - keep_ids). If the supplied --keep-ids don't match any active project in the lab (wrong VL's IDs, trailing characters, copy-paste error), keep_ids & all_ids is empty, unknown_keep only logs a warning, and the script proceeds to target all active projects for deletion. The audit + confirmation gates mitigate this, but on an irreversible --hard --apply run the only signal that "keep 3 of 50" silently became "delete all 50" is a log line that scrolls past. Suggest aborting (or requiring an extra confirmation) when none / too few of the supplied keep-IDs resolve to real projects.

Two minor follow-ups (optional): hard-delete "dry-run" issues real DELETE/UPDATE statements (rolled back) so it isn't strictly read-only and takes row locks; and each phase creates/disposes its own async engine rather than sharing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants