Use commit oid for COB parent

We were using the blob oid, which was causing the commit tree to
be invalid.
This commit is contained in:
Alexis Sellier
2023-03-06 15:39:34 +01:00
parent 1535149dd0
commit 11ea75f0ca
2 changed files with 17 additions and 16 deletions
+13 -11
View File
@@ -617,9 +617,11 @@ mod routes {
use pretty_assertions::assert_eq;
use serde_json::json;
use crate::test::{self, get, patch, post, HEAD, HEAD_1, ISSUE_ID, PATCH_ID, SESSION_ID};
use crate::test::{
self, get, patch, post, HEAD, HEAD_1, ISSUE_ID, PATCH_ID, SESSION_ID, TIMESTAMP,
};
const CREATED_ISSUE_ID: &str = "745052a1603000b9566445753d7e2fee1ff5041f";
const CREATED_ISSUE_ID: &str = "7596e4b788c37d633a8bd665e4d3a5a632c90eab";
#[tokio::test]
async fn test_projects_root() {
@@ -1105,7 +1107,7 @@ mod routes {
},
"body": "Change 'hello world' to 'hello everyone'",
"reactions": [],
"timestamp": 1673001014,
"timestamp": TIMESTAMP,
"replyTo": null
}
],
@@ -1167,7 +1169,7 @@ mod routes {
},
"body": "Change 'hello world' to 'hello everyone'",
"reactions": [],
"timestamp": 1673001014,
"timestamp": TIMESTAMP,
"replyTo": null,
}],
"tags": [
@@ -1228,7 +1230,7 @@ mod routes {
},
"body": "Change 'hello world' to 'hello everyone'",
"reactions": [],
"timestamp": 1673001014,
"timestamp": TIMESTAMP,
"replyTo": null,
},
{
@@ -1238,7 +1240,7 @@ mod routes {
},
"body": "This is first-level comment",
"reactions": [],
"timestamp": 1673001014,
"timestamp": TIMESTAMP,
"replyTo": null,
},
],
@@ -1298,7 +1300,7 @@ mod routes {
},
"body": "Change 'hello world' to 'hello everyone'",
"reactions": [],
"timestamp": 1673001014,
"timestamp": TIMESTAMP,
"replyTo": null,
},
{
@@ -1308,7 +1310,7 @@ mod routes {
},
"body": "This is a reply to the first comment",
"reactions": [],
"timestamp": 1673001014,
"timestamp": TIMESTAMP,
"replyTo": "f0afe34f5bf4248df432f6b6a8818bcae360bbc2",
},
],
@@ -1408,14 +1410,14 @@ mod routes {
json!(
{
"success": true,
"id": "cd370c8a263e8b0c9836d6a5dd3bf7a633d69acf",
"id": "48d6d96e1f80b3ccd5bd9675d407e09e7bbaa7ab",
}
)
);
let response = get(
&app,
"/projects/rad:z4FucBZHZMCsxTyQE1dfE2YR59Qbp/patches/cd370c8a263e8b0c9836d6a5dd3bf7a633d69acf",
"/projects/rad:z4FucBZHZMCsxTyQE1dfE2YR59Qbp/patches/48d6d96e1f80b3ccd5bd9675d407e09e7bbaa7ab",
)
.await;
@@ -1424,7 +1426,7 @@ mod routes {
response.json().await,
json!(
{
"id": "cd370c8a263e8b0c9836d6a5dd3bf7a633d69acf",
"id": "48d6d96e1f80b3ccd5bd9675d407e09e7bbaa7ab",
"author": {
"id": "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"
},
+4 -5
View File
@@ -22,9 +22,10 @@ use crate::api::{auth, Context};
pub const HEAD: &str = "1e978d19f251cd9821d9d9a76d1bd436bf0690d5";
pub const HEAD_1: &str = "f604ce9fd5b7cc77b7609beda45ea8760bee78f7";
pub const PATCH_ID: &str = "afb3063f8f0343fa31d2a0d55bac2a6f4a77125e";
pub const ISSUE_ID: &str = "331569cd5e4dcc55104363ebce92c78b0e5d67d4";
pub const PATCH_ID: &str = "3cccb7ac7325215731c62c9c5aef2ec51ba91317";
pub const ISSUE_ID: &str = "dc368184c379a7802c78b729ed631d2712ce22ab";
pub const SESSION_ID: &str = "u9MGAkkfkMOv0uDDB2WeUHBT7HbsO2Dy";
pub const TIMESTAMP: u64 = 1671125284;
const PASSWORD: &str = "radicle";
@@ -32,6 +33,7 @@ pub fn seed(dir: &Path) -> Context {
let workdir = dir.join("hello-world");
let rad_home = dir.join("radicle");
env::set_var("RAD_COMMIT_TIME", TIMESTAMP.to_string());
env::set_var("RAD_PASSPHRASE", PASSWORD);
env::set_var(
"RAD_SEED",
@@ -103,9 +105,6 @@ pub fn seed(dir: &Path) -> Context {
)
.unwrap();
// eq. rad issue new
env::set_var("RAD_COMMIT_TIME", "1673001014");
let signer = MemorySigner::load(&profile.keystore, PASSWORD.to_owned().into()).unwrap();
let storage = &profile.storage;
let (_, id) = radicle::rad::repo(&workdir).unwrap();