fix: cascade-delete DAST targets, pentests, and downstream data on repo delete #50

Merged
sharang merged 1 commits from fix/cascade-delete-repo into main 2026-03-30 07:11:24 +00:00

1 Commits

Author SHA1 Message Date
Sharang Parnerkar
f8eb4ea84d fix: cascade-delete DAST targets, pentests, and all downstream data when repo is deleted
All checks were successful
CI / Check (pull_request) Successful in 9m33s
CI / Detect Changes (pull_request) Has been skipped
CI / Deploy Agent (pull_request) Has been skipped
CI / Deploy Dashboard (pull_request) Has been skipped
CI / Deploy Docs (pull_request) Has been skipped
CI / Deploy MCP (pull_request) Has been skipped
Previously, deleting a repository only cleaned up SAST findings, SBOM,
scan runs, CVEs, tracker issues, graph data, and embeddings — but left
orphaned DAST targets, scan runs, DAST findings, pentest sessions,
attack chain nodes, and pentest messages in the database.

Now the delete handler follows the full cascade chain:
  repo → dast_targets → dast_scan_runs → dast_findings
  repo → dast_targets → pentest_sessions → attack_chain_nodes
  repo → dast_targets → pentest_sessions → pentest_messages
  repo → pentest_sessions (direct repo_id link) → downstream

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:28:26 +02:00