fix: fork inherits source repo's node, not empty FK The fork handler was setting node_did/node_url to empty strings, violating the repos_node_did_fkey constraint. Fork now inherits the source's node placement by default (forks live on the same node). Caught by new fork_creates_new_repo tests.
Author: Aaron Steven White
Commit
f493856be959c3522c6d70066184527553700675Parent: b698a8380b
Structural diff unavailable
These commits were pushed via plain git push, so no pre-parsed
schemas are available. Install git-remote-cospan and re-push via panproto:// to
see scope-level changes, breaking change detection, and semantic diffs.
brew install panproto/tap/git-remote-cospan2 files changed +6 -4
@@ -47,8 +47,8 @@ pub async fn handler(
4747 name: fork_name.clone(), 4848 description: source.description.clone(), 4949 protocol: source.protocol.clone(), 50- node_did: String::new(), 51- node_url: String::new(), 50+ node_did: source.node_did.clone(), 51+ node_url: source.node_url.clone(), 5252 default_branch: source.default_branch.clone(), 5353 visibility: source.visibility.clone(), 5454 source_repo: Some(input.source_repo.clone()),
@@ -224,9 +224,11 @@ async fn fork_creates_new_repo(pool: PgPool) {
224224 .send() 225225 .await 226226 .unwrap(); 227- assert_eq!(resp.status(), 200); 227+ let status = resp.status(); 228+ let body = resp.text().await.unwrap(); 229+ assert_eq!(status, 200, "fork failed: {body}"); 228230 229- let json: serde_json::Value = resp.json().await.unwrap(); 231+ let json: serde_json::Value = serde_json::from_str(&body).unwrap(); 230232 assert_eq!(json["did"].as_str().unwrap(), "did:plc:carol"); 231233 assert_eq!(json["name"].as_str().unwrap(), "test-project"); 232234 assert!(json["uri"].as_str().unwrap().starts_with("at://did:plc:carol/dev.cospan.repo/"));