add vlab manager and delete projects scripts - #188
Conversation
|
/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. poetry audit reportLoading... No vulnerabilities found ✨✨ |
pgetta
left a comment
There was a problem hiding this comment.
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.
No description provided.