refactor: rip out the legacy TrackedRepository / repositories path (#161)
CI / Check (push) Has been skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Agent (push) Successful in 8m20s
CI / Deploy Dashboard (push) Successful in 3m13s
CI / Deploy Docs (push) Has been skipped
CI / Deploy MCP (push) Successful in 2m7s

This commit was merged in pull request #161.
This commit is contained in:
2026-07-16 07:25:45 +00:00
parent 87f240b26f
commit a981311413
46 changed files with 386 additions and 2123 deletions
@@ -113,15 +113,16 @@ async fn delete_repo_cascades_to_dast_and_pentest_data() {
// Create a repo
let resp = server
.post(
"/api/v1/repositories",
"/api/v1/targets",
&json!({
"name": "cascade-test",
"git_url": "https://github.com/example/cascade-test.git",
"target_type": "web_app",
"artifacts": [{ "kind": "git_repo", "source_ref": "https://github.com/example/cascade-test.git", "branch": "main" }],
}),
)
.await;
let body: serde_json::Value = resp.json().await.unwrap();
let repo_id = body["data"]["id"].as_str().unwrap().to_string();
let repo_id = body["data"]["_id"]["$oid"].as_str().unwrap().to_string();
// Insert DAST target linked to repo
let target_id = insert_dast_target(&server, &repo_id, "cascade-target").await;
@@ -140,9 +141,7 @@ async fn delete_repo_cascades_to_dast_and_pentest_data() {
assert_eq!(count_docs(&server, "dast_findings").await, 1);
// Delete the repo
let resp = server
.delete(&format!("/api/v1/repositories/{repo_id}"))
.await;
let resp = server.delete(&format!("/api/v1/targets/{repo_id}")).await;
assert_eq!(resp.status(), 200);
// All downstream data should be gone
@@ -161,15 +160,16 @@ async fn delete_repo_cascades_sast_findings_and_sbom() {
// Create a repo
let resp = server
.post(
"/api/v1/repositories",
"/api/v1/targets",
&json!({
"name": "sast-cascade",
"git_url": "https://github.com/example/sast-cascade.git",
"target_type": "web_app",
"artifacts": [{ "kind": "git_repo", "source_ref": "https://github.com/example/sast-cascade.git", "branch": "main" }],
}),
)
.await;
let body: serde_json::Value = resp.json().await.unwrap();
let repo_id = body["data"]["id"].as_str().unwrap().to_string();
let repo_id = body["data"]["_id"]["$oid"].as_str().unwrap().to_string();
// Insert SAST finding and SBOM entry
let mongodb_uri = std::env::var("TEST_MONGODB_URI")
@@ -209,9 +209,7 @@ async fn delete_repo_cascades_sast_findings_and_sbom() {
assert_eq!(count_docs(&server, "sbom_entries").await, 1);
// Delete repo
server
.delete(&format!("/api/v1/repositories/{repo_id}"))
.await;
server.delete(&format!("/api/v1/targets/{repo_id}")).await;
// Both should be gone
assert_eq!(count_docs(&server, "findings").await, 0);