From 92182a879b5250b3fee2678e24c857c4991b21cf Mon Sep 17 00:00:00 2001 From: cloudhead Date: Thu, 18 Jan 2024 11:28:22 +0100 Subject: [PATCH] cob: Distinguish between commit parents Previously, COB change commits would not distinguish between their parents. This means that they would try to load source code commits (eg. for patch COBs) and then fail since those commits wouldn't have a manifest or `Rad-Resource`. We introduce a backwards compatible change here which is that parent oids that are not COB commits are accompanied by a commit trailer called `Rad-Related`. This is for all related content that should be pulled in but is not part of the change graph proper. When building the change graph, we simply ignore commits that are marked as "related". --- radicle-httpd/src/api/v1/projects.rs | 6 +++--- radicle-httpd/src/test.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index 16b054325..ac4677fe9 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -2503,7 +2503,7 @@ mod routes { #[tokio::test] async fn test_projects_create_patches() { - const CREATED_PATCH_ID: &str = "e546f1784df29d0ffd424021ebae556cbd950993"; + const CREATED_PATCH_ID: &str = "e21d5b18f8d6c75cfa9c35186b821b1764cb1ab8"; let tmp = tempfile::tempdir().unwrap(); let ctx = contributor(tmp.path()); @@ -2806,7 +2806,7 @@ mod routes { "reviews": [], }, { - "id": "50d760ccbcfadddd81fe32bd94283cbfd80133fa", + "id": "46fc3974dac96255e73daf2e1169cd929e713064", "author": { "id": CONTRIBUTOR_DID, }, @@ -3353,7 +3353,7 @@ mod routes { "summary": "A small review", "comments": [ { - "id": "2ed1c517997d3f1a83c6830ebab069c6e2ee967e", + "id": "9aebcd3b27fabb1700427d8ee7b8958b9a50a8f8", "author": { "id": "did:key:z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8", }, diff --git a/radicle-httpd/src/test.rs b/radicle-httpd/src/test.rs index 744baf98c..7579d9c77 100644 --- a/radicle-httpd/src/test.rs +++ b/radicle-httpd/src/test.rs @@ -39,7 +39,7 @@ pub const SESSION_ID: &str = "u9MGAkkfkMOv0uDDB2WeUHBT7HbsO2Dy"; pub const TIMESTAMP: u64 = 1671125284; pub const CONTRIBUTOR_RID: &str = "rad:z4XaCmN3jLSeiMvW15YTDpNbDHFhG"; pub const CONTRIBUTOR_DID: &str = "did:key:z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8"; -pub const CONTRIBUTOR_PATCH_ID: &str = "0867c6389ee073304da0854a83885f47b1d7f5ed"; +pub const CONTRIBUTOR_PATCH_ID: &str = "89ddf1bf50a6e98f41372e8d554b4ac8e37e7d36"; /// Create a new profile. pub fn profile(home: &Path, seed: [u8; 32]) -> radicle::Profile {