rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwood222e53c358dd9d87894ec64e8181b8353a5c517e
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Updated",
"patch": {
"id": "e500399b3e1db5fe7bcf6d7661d5a42dfa49d4d5",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": "fintohaps"
},
"title": "radicle: improve inline comments",
"state": {
"status": "open",
"conflicts": []
},
"before": "2a47bc0c7dd6238ce3416e19d2ba57f3a7626f64",
"after": "222e53c358dd9d87894ec64e8181b8353a5c517e",
"commits": [
"222e53c358dd9d87894ec64e8181b8353a5c517e",
"78b41239ea8f2eafa9eecac8298bfd29dca38f9f",
"b455c819807cd7a7543d03215570c72b7cb452d7",
"e67a8f4d32c830c24ed68ea21707923480830511"
],
"target": "efeefd0daa35682a3ff07bd6c24d73248252149f",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "e500399b3e1db5fe7bcf6d7661d5a42dfa49d4d5",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": "fintohaps"
},
"description": "The previous `CodeLocation` type did not correctly represent the semantics of an\ninline code location, for the following reasons:\n\n1. If it is for lines within a file pertaining to the commit, then there should\n be no `old` or `new` ranges, only a single range.\n2. If it is for a patch created by diffing the commit with another commit, then\n the other commit is missing.\n\nIt could be argued that the semantics of these two cases could be retrieved by:\n\n1. In the first case, just use one of the ranges.\n2. In the second case, infer the commit from the context, e.g. always use\n `Revision::base` for locations used in the `ReviewComment`.\n\nInstead, the type is renamed to `PartialLocation` to represent these semantics\nbetter, and only remains for backwards-compatibility when deserializing existing\ndata.\n\nTwo new types are introduced `CommitLocation` and `DiffLocation`, which more\naccurately describe the two cases.\n\nEach of these is used in a `Patch`'s `Revision` and `Review` thread\nrespectively. These are created with new actions `RevisionCommitComment` and\n`ReviewDiffComment`, while deprecating the use of `RevisionComment` and\n`ReviewComment` \u2013 they can no longer be constructed outside of the module.\n\nThe final part is to ensure that clients can calculate stable diffs for patches\n\u2013 to allow them to display the `DiffLocation`s correctly \u2013 the relevant diff\noptions are recorded for each patch. Sane defaults are used if the options are\nmissing.",
"base": "3b5fac178eaf9bca639fbd0c1df0c68619a7f51f",
"oid": "3679d0fbeb6123e7bed99bd3ddd05fea9ac83790",
"timestamp": 1741364575
},
{
"id": "687497ce5855e549e237de665e684772dbc28f76",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": "fintohaps"
},
"description": "Changes:\n- Split up the patch into separate commits\n- Optional selection for file-level comments\n- Rename actions to use `V1` suffix, keeping the latest version of actions using\n their regular names. As well as this, the enum tag renames use `.v2` suffix.\n- Refactor `diff::Options` methods to return `git2::DiffOptions` directly.\n- Add `FindOptions` to the `diff::Options`.",
"base": "3b5fac178eaf9bca639fbd0c1df0c68619a7f51f",
"oid": "17713eab9565df332bb3ce40d3cf78f282d86050",
"timestamp": 1742995065
},
{
"id": "b168b283a23c3ca2457abf8b185d2b09eabe56af",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": "fintohaps"
},
"description": "Changes:\n- Remove `all` from `FindOptions` \u2013 I found that it is worse at detecting\n renames\n- Remove `exact_match`, because I believe this will only look at SHAs and not\n return renames",
"base": "3b5fac178eaf9bca639fbd0c1df0c68619a7f51f",
"oid": "ff6cb4a3633bf31513824282628a4a3d19e6fbd9",
"timestamp": 1743007134
},
{
"id": "0a74e306857f4e907324fdb1b4c4c1f09d7fb691",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": "fintohaps"
},
"description": "Changes:\n- Rebased\n- Document code\n- Removed `CodeRange::Chars` \u2013 I believe that no one actually used this and I'd\n prefer not support it until it's needed.",
"base": "5553a147523778574c1671d4706d34f723138632",
"oid": "e7cab63866450f40069dbe2038a9806f6878dd63",
"timestamp": 1746615901
},
{
"id": "8ac7f35519a868d1c0ff63d626ab7b5a382cfebb",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": "fintohaps"
},
"description": "Backwards-compatible Approach\n\nThis approach extends the way we implemented changes to `Review` in a previous\npatch. The change is two-fold.\n\nThe first thing we do is separate out the effected `Action` variants into the\n`actions` module. While doing this, we version them, and guard the way they are\nconstructed and how they affect a `Patch` when being applied. We also ensure\nthat we can deserialize.\n\nThe second part is to separate the \"encoding\" of a `Revision`. Since `Revision`\nis changing by changing the type of the code locations from `PartialLocation`\n(previously named `CodeLocation`) to `DiffLocation`. The `encoding::Revision`\ntype can deserialize any existing revision JSON that exists, and it does this be\n\"decoding\" the previous version of the data into the newer version. Note that to\ndo this effectively, we need to provide the `DiffLocation` with the `base: Oid`.\nWe, safely, assume that this is the `Revision::base` and use that as the\ncontextual information for building the `DiffLocation`. Note that this means\n`encoding::Review** will no longer implement `Deserialize**, but it does have a\nmethod `decode**. This method takes the contextual `base: Oid** to convert any\nfound `PartialLocation`s into `DiffLocation`s.\n\n**NOTE**: when converting a `PartialLocation` to a `DiffLocation`, there is no\nway to get the hunk selection from the line selection. This would require a\n`Repository` handle to compute. We set the `selection` to `None` as a minor\nsacrifice in the name of backwards-compatibility (almost).\n\n**Aside**: One can imagine that we might end up changing some field in `Patch`\nin the future, and this exact process will have to be done again and introduce\nan `encoding::Patch`, which provides a way to migrate from the previous encoding\nto the latest encoding.",
"base": "2a47bc0c7dd6238ce3416e19d2ba57f3a7626f64",
"oid": "222e53c358dd9d87894ec64e8181b8353a5c517e",
"timestamp": 1753287978
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "e55d28f4-5318-4922-808d-c3044aaf4bd5"
},
"info_url": "https://cci.rad.levitte.org//e55d28f4-5318-4922-808d-c3044aaf4bd5.html"
}
Started at: 2025-07-23 18:26:21.675644+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFq…bS9wzpT
✓ Remote cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW added
✓ Remote-tracking branch cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW/master created for z6MktaN…hzPZRZW
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6Mkire…SQZ3voM
✓ Remote erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz added
✓ Remote-tracking branch erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz/master created for z6MkgFq…FGAnBGz
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPv…WX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 112 issues · 8 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout e500399b3e1db5fe7bcf6d7661d5a42dfa49d4d5
✓ Switched to branch patch/e500399 at revision 8ac7f35
✓ Branch patch/e500399 setup to track rad/patches/e500399b3e1db5fe7bcf6d7661d5a42dfa49d4d5
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout 222e53c358dd9d87894ec64e8181b8353a5c517e
HEAD is now at 222e53c3 radicle: use diff options in Patch
Exit code: 0
$ git show 222e53c358dd9d87894ec64e8181b8353a5c517e
commit 222e53c358dd9d87894ec64e8181b8353a5c517e
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Fri Feb 28 09:14:49 2025 +0000
radicle: use diff options in Patch
Introduce the use of the `diff::Options` in `Patch`'s.
The diff configuration options are stored alongside a `Patch` so that when
reproducing comments in clients, they can accurately locate the `DiffLocation`.
diff --git a/crates/radicle-cli/examples/rad-cob-show.md b/crates/radicle-cli/examples/rad-cob-show.md
index 673f8878..c930cb8c 100644
--- a/crates/radicle-cli/examples/rad-cob-show.md
+++ b/crates/radicle-cli/examples/rad-cob-show.md
@@ -72,7 +72,7 @@ We can show the patch COB too.
```
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch --object d1f7f869fde9fac19c1779c4c2e77e8361333f91
-{"title":"Start drafting peace treaty","author":{"id":"did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"},"state":{"status":"open"},"target":"delegates","labels":[],"merges":{},"revisions":{"d1f7f869fde9fac19c1779c4c2e77e8361333f91":{"id":"d1f7f869fde9fac19c1779c4c2e77e8361333f91","author":{"id":"did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"},"description":[{"author":"z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi","timestamp":1671125284000,"body":"See details.","embeds":[]}],"base":"f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354","oid":"575ed68c716d6aae81ea6b718fd9ac66a8eae532","discussion":{"comments":{},"timeline":[]},"reviews":{},"timestamp":1671125284000,"resolves":[],"reactions":[]}},"assignees":[],"timeline":["d1f7f869fde9fac19c1779c4c2e77e8361333f91"],"reviews":{}}
+{"title":"Start drafting peace treaty","author":{"id":"did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"},"state":{"status":"open"},"target":"delegates","labels":[],"merges":{},"revisions":{"d1f7f869fde9fac19c1779c4c2e77e8361333f91":{"id":"d1f7f869fde9fac19c1779c4c2e77e8361333f91","author":{"id":"did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"},"description":[{"author":"z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi","timestamp":1671125284000,"body":"See details.","embeds":[]}],"base":"f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354","oid":"575ed68c716d6aae81ea6b718fd9ac66a8eae532","discussion":{"comments":{},"timeline":[]},"reviews":{},"timestamp":1671125284000,"resolves":[],"reactions":[]}},"assignees":[],"timeline":["d1f7f869fde9fac19c1779c4c2e77e8361333f91"],"reviews":{},"diffOptions":{"algorithm":"Histogram","skipBinary":false,"contextLines":3,"interhunkLines":0,"find":{"exact_match":false,"renames":{"limit":200,"rename_threshold":50}}}}
```
Finally let's update the issue and see the output of `rad cob show` also changes.
diff --git a/crates/radicle-remote-helper/src/push.rs b/crates/radicle-remote-helper/src/push.rs
index dab29ac2..9e9193d8 100644
--- a/crates/radicle-remote-helper/src/push.rs
+++ b/crates/radicle-remote-helper/src/push.rs
@@ -494,6 +494,7 @@ where
patch::MergeTarget::default(),
base,
head,
+ None,
&[],
signer,
)
@@ -504,6 +505,7 @@ where
patch::MergeTarget::default(),
base,
head,
+ None,
&[],
signer,
)
diff --git a/crates/radicle/src/cob/patch.rs b/crates/radicle/src/cob/patch.rs
index abbadf2a..bbaa884e 100644
--- a/crates/radicle/src/cob/patch.rs
+++ b/crates/radicle/src/cob/patch.rs
@@ -234,6 +234,11 @@ pub enum Action {
/// Review comments resolved by this revision.
#[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
resolves: BTreeSet<(EntryId, CommentId)>,
+ /// The diff options for the patch.
+ ///
+ /// **N.B**: Only relevant for the initial revision creation.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ diff_options: Option<diff::Options>,
},
#[serde(rename = "revision.edit")]
RevisionEdit {
@@ -428,11 +433,64 @@ pub struct Patch {
pub(super) timeline: Vec<EntryId>,
/// Reviews index. Keeps track of reviews for better performance.
pub(super) reviews: BTreeMap<ReviewId, Option<(RevisionId, ActorId)>>,
+ /// The options used to provide the diff of the [`Patch`].
+ #[serde(default)]
+ pub(super) diff_options: diff::Options,
+}
+
+/// Data to create a new [`Patch`].
+///
+/// A new request can be constructed with [`CreatePatchRequest::new`]. The
+/// [`MergeTarget`] and [`diff::Options`] can be set for the request by using
+/// [`CreatePatchRequest::with_target`] and
+/// [`CreatePatchRequest::with_diff_options`], respectively.
+///
+/// To use the [`CreatePatchRequest`], see [`Patch::new`].
+pub struct CreatePatchRequest {
+ title: String,
+ target: MergeTarget,
+ id: RevisionId,
+ revision: Revision,
+ diff_options: diff::Options,
+}
+
+impl CreatePatchRequest {
+ /// Construct a new `CreatePatch` using default for `target`and
+ /// `diff_options`.
+ pub fn new(title: String, id: RevisionId, revision: Revision) -> Self {
+ Self {
+ title,
+ target: MergeTarget::default(),
+ id,
+ revision,
+ diff_options: diff::Options::default(),
+ }
+ }
+
+ /// Set the `target`.
+ pub fn with_target(self, target: MergeTarget) -> Self {
+ Self { target, ..self }
+ }
+
+ /// Set the `diff_options`.
+ pub fn with_diff_options(self, diff_options: diff::Options) -> Self {
+ Self {
+ diff_options,
+ ..self
+ }
+ }
}
impl Patch {
- /// Construct a new patch object from a revision.
- pub fn new(title: String, target: MergeTarget, (id, revision): (RevisionId, Revision)) -> Self {
+ /// Construct a new patch object from a [`CreatePatchRequest`].
+ pub fn new(create: CreatePatchRequest) -> Self {
+ let CreatePatchRequest {
+ title,
+ target,
+ id,
+ revision,
+ diff_options,
+ } = create;
Self {
title,
author: revision.author.clone(),
@@ -444,6 +502,7 @@ impl Patch {
assignees: BTreeSet::default(),
timeline: vec![id.into_inner()],
reviews: BTreeMap::default(),
+ diff_options,
}
}
@@ -845,6 +904,8 @@ impl Patch {
base,
oid,
resolves,
+ // ignored for new revisions
+ diff_options: _,
} => {
debug_assert!(!self.revisions.contains_key(&entry));
let id = RevisionId(entry);
@@ -1136,6 +1197,7 @@ impl store::Cob for Patch {
base,
oid,
resolves,
+ diff_options,
}) = actions.next()
else {
return Err(Error::Init("the first action must be of type `revision`"));
@@ -1152,7 +1214,11 @@ impl store::Cob for Patch {
op.timestamp,
resolves,
);
- let mut patch = Patch::new(title, target, (RevisionId(op.id), revision));
+
+ let create = CreatePatchRequest::new(title, RevisionId(op.id), revision)
+ .with_target(target)
+ .with_diff_options(diff_options.unwrap_or_default());
+ let mut patch = Patch::new(create);
for action in actions {
match patch.authorization(&action, &op.author, &doc)? {
@@ -1914,6 +1980,22 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
self.push(Action::Merge { revision, commit })
}
+ fn initial_revision(
+ &mut self,
+ description: impl ToString,
+ base: impl Into<git::Oid>,
+ oid: impl Into<git::Oid>,
+ opts: Option<diff::Options>,
+ ) -> Result<(), store::Error> {
+ self.push(Action::Revision {
+ description: description.to_string(),
+ base: base.into(),
+ oid: oid.into(),
+ resolves: BTreeSet::new(),
+ diff_options: opts,
+ })
+ }
+
/// Update a patch with a new revision.
pub fn revision(
&mut self,
@@ -1926,6 +2008,7 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
base: base.into(),
oid: oid.into(),
resolves: BTreeSet::new(),
+ diff_options: None,
})
}
@@ -2599,6 +2682,7 @@ where
target: MergeTarget,
base: impl Into<git::Oid>,
oid: impl Into<git::Oid>,
+ opts: Option<diff::Options>,
labels: &[Label],
cache: &'g mut C,
signer: &Device<G>,
@@ -2613,6 +2697,7 @@ where
target,
base,
oid,
+ opts,
labels,
Lifecycle::default(),
cache,
@@ -2628,6 +2713,7 @@ where
target: MergeTarget,
base: impl Into<git::Oid>,
oid: impl Into<git::Oid>,
+ opts: Option<diff::Options>,
labels: &[Label],
cache: &'g mut C,
signer: &Device<G>,
@@ -2642,6 +2728,7 @@ where
target,
base,
oid,
+ opts,
labels,
Lifecycle::Draft,
cache,
@@ -2676,6 +2763,7 @@ where
target: MergeTarget,
base: impl Into<git::Oid>,
oid: impl Into<git::Oid>,
+ opts: Option<diff::Options>,
labels: &[Label],
state: Lifecycle,
cache: &'g mut C,
@@ -2686,7 +2774,7 @@ where
G: crypto::signature::Signer<crypto::Signature>,
{
let (id, patch) = Transaction::initial("Create patch", &mut self.raw, signer, |tx, _| {
- tx.revision(description, base, oid)?;
+ tx.initial_revision(description, base, oid, opts)?;
tx.edit(title, target)?;
if !labels.is_empty() {
@@ -2862,6 +2950,7 @@ mod test {
target,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -2902,6 +2991,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -2935,6 +3025,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -2966,6 +3057,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3018,6 +3110,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3058,6 +3151,7 @@ mod test {
base,
oid,
resolves: Default::default(),
+ diff_options: None,
},
Action::Edit {
title: String::from("My patch"),
@@ -3069,6 +3163,7 @@ mod test {
base,
oid,
resolves: Default::default(),
+ diff_options: None,
}]);
let a3 = alice.op::<Patch>([Action::RevisionRedact {
revision: RevisionId(a2.id()),
@@ -3109,6 +3204,7 @@ mod test {
base,
oid,
resolves: Default::default(),
+ diff_options: None,
},
Action::Edit {
title: String::from("Some patch"),
@@ -3124,6 +3220,7 @@ mod test {
base,
oid,
resolves: Default::default(),
+ diff_options: None,
},
&alice,
);
@@ -3169,6 +3266,7 @@ mod test {
base,
oid,
resolves: Default::default(),
+ diff_options: None,
},
Action::Edit {
title: String::from("My patch"),
@@ -3206,6 +3304,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3251,6 +3350,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3282,6 +3382,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3333,6 +3434,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3380,6 +3482,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3435,6 +3538,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
@@ -3484,6 +3588,7 @@ mod test {
MergeTarget::Delegates,
branch.base,
branch.oid,
+ None,
&[],
&alice.signer,
)
diff --git a/crates/radicle/src/cob/patch/cache.rs b/crates/radicle/src/cob/patch/cache.rs
index ea10869d..9e9aa056 100644
--- a/crates/radicle/src/cob/patch/cache.rs
+++ b/crates/radicle/src/cob/patch/cache.rs
@@ -11,11 +11,12 @@ use crate::cob::store;
use crate::cob::{Label, ObjectId, TypeName};
use crate::git;
use crate::node::device::Device;
+use crate::node::NodeId;
use crate::prelude::RepoId;
use crate::storage::{HasRepoId, ReadRepository, RepositoryError, SignRepository, WriteRepository};
use super::{
- ByRevision, MergeTarget, NodeId, Patch, PatchCounts, PatchId, PatchMut, Revision, RevisionId,
+ diff, ByRevision, MergeTarget, Patch, PatchCounts, PatchId, PatchMut, Revision, RevisionId,
State, Status,
};
@@ -115,6 +116,7 @@ impl<'a, R, C> Cache<super::Patches<'a, R>, C> {
target: MergeTarget,
base: impl Into<git::Oid>,
oid: impl Into<git::Oid>,
+ opts: Option<diff::Options>,
labels: &[Label],
signer: &Device<G>,
) -> Result<PatchMut<'a, 'g, R, C>, super::Error>
@@ -129,6 +131,7 @@ impl<'a, R, C> Cache<super::Patches<'a, R>, C> {
target,
base,
oid,
+ opts,
labels,
&mut self.cache,
signer,
@@ -145,6 +148,7 @@ impl<'a, R, C> Cache<super::Patches<'a, R>, C> {
target: MergeTarget,
base: impl Into<git::Oid>,
oid: impl Into<git::Oid>,
+ opts: Option<diff::Options>,
labels: &[Label],
signer: &Device<G>,
) -> Result<PatchMut<'a, 'g, R, C>, super::Error>
@@ -159,6 +163,7 @@ impl<'a, R, C> Cache<super::Patches<'a, R>, C> {
target,
base,
oid,
+ opts,
labels,
&mut self.cache,
signer,
@@ -714,7 +719,8 @@ mod tests {
use crate::cob::thread::{Comment, Thread};
use crate::cob::Author;
use crate::patch::{
- ByRevision, MergeTarget, Patch, PatchCounts, PatchId, Revision, RevisionId, State, Status,
+ ByRevision, CreatePatchRequest, Patch, PatchCounts, PatchId, Revision, RevisionId, State,
+ Status,
};
use crate::prelude::Did;
use crate::profile::env;
@@ -767,13 +773,15 @@ mod tests {
let mut cache = memory(repo);
assert!(cache.is_empty().unwrap());
- let patch = Patch::new("Patch #1".to_string(), MergeTarget::Delegates, revision());
+ let (id, rev) = revision();
+ let patch = Patch::new(CreatePatchRequest::new("Patch #1".to_string(), id, rev));
let id = ObjectId::from_str("47799cbab2eca047b6520b9fce805da42b49ecab").unwrap();
cache.update(&cache.rid(), &id, &patch).unwrap();
+ let (id, rev) = revision();
let patch = Patch {
state: State::Archived,
- ..Patch::new("Patch #2".to_string(), MergeTarget::Delegates, revision())
+ ..Patch::new(CreatePatchRequest::new("Patch #2".to_string(), id, rev))
};
let id = ObjectId::from_str("ae981ded6ed2ed2cdba34c8603714782667f18a3").unwrap();
cache.update(&cache.rid(), &id, &patch).unwrap();
@@ -803,16 +811,18 @@ mod tests {
.collect::<BTreeSet<PatchId>>();
for id in open_ids.iter() {
- let patch = Patch::new(id.to_string(), MergeTarget::Delegates, revision());
+ let (rev_id, rev) = revision();
+ let patch = Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev));
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
.unwrap();
}
for id in draft_ids.iter() {
+ let (rev_id, rev) = revision();
let patch = Patch {
state: State::Draft,
- ..Patch::new(id.to_string(), MergeTarget::Delegates, revision())
+ ..Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev))
};
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
@@ -820,9 +830,10 @@ mod tests {
}
for id in archived_ids.iter() {
+ let (rev_id, rev) = revision();
let patch = Patch {
state: State::Archived,
- ..Patch::new(id.to_string(), MergeTarget::Delegates, revision())
+ ..Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev))
};
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
@@ -830,12 +841,13 @@ mod tests {
}
for id in merged_ids.iter() {
+ let (rev_id, rev) = revision();
let patch = Patch {
state: State::Merged {
revision: arbitrary::oid().into(),
commit: arbitrary::oid(),
},
- ..Patch::new(id.to_string(), MergeTarget::Delegates, revision())
+ ..Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev))
};
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
@@ -869,7 +881,8 @@ mod tests {
let mut patches = Vec::with_capacity(ids.len());
for id in ids.iter() {
- let patch = Patch::new(id.to_string(), MergeTarget::Delegates, revision());
+ let (rev_id, rev) = revision();
+ let patch = Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev));
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
.unwrap();
@@ -897,11 +910,11 @@ mod tests {
.iter()
.next()
.expect("at least one revision should have been created");
- let mut patch = Patch::new(
+ let mut patch = Patch::new(CreatePatchRequest::new(
patch_id.to_string(),
- MergeTarget::Delegates,
- (*rev_id, rev.clone()),
- );
+ *rev_id,
+ rev.clone(),
+ ));
let timeline = revisions.keys().copied().collect::<Vec<_>>();
patch
.timeline
@@ -937,7 +950,8 @@ mod tests {
let mut patches = Vec::with_capacity(ids.len());
for id in ids.iter() {
- let patch = Patch::new(id.to_string(), MergeTarget::Delegates, revision());
+ let (rev_id, rev) = revision();
+ let patch = Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev));
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
.unwrap();
@@ -964,7 +978,8 @@ mod tests {
let mut patches = Vec::with_capacity(ids.len());
for id in ids.iter() {
- let patch = Patch::new(id.to_string(), MergeTarget::Delegates, revision());
+ let (rev_id, rev) = revision();
+ let patch = Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev));
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
.unwrap();
@@ -990,7 +1005,8 @@ mod tests {
.collect::<BTreeSet<PatchId>>();
for id in ids.iter() {
- let patch = Patch::new(id.to_string(), MergeTarget::Delegates, revision());
+ let (rev_id, rev) = revision();
+ let patch = Patch::new(CreatePatchRequest::new(id.to_string(), rev_id, rev));
cache
.update(&cache.rid(), &PatchId::from(*id), &patch)
.unwrap();
diff --git a/crates/radicle/src/cob/test.rs b/crates/radicle/src/cob/test.rs
index c2fb701c..548bbc6a 100644
--- a/crates/radicle/src/cob/test.rs
+++ b/crates/radicle/src/cob/test.rs
@@ -237,6 +237,7 @@ impl<G: Signer> Actor<G> {
base,
oid,
resolves: Default::default(),
+ diff_options: None,
},
patch::Action::Edit {
title: title.to_string(),
diff --git a/radicle/src/cob/patch.rs b/radicle/src/cob/patch.rs
deleted file mode 100644
index dfb2818e..00000000
--- a/radicle/src/cob/patch.rs
+++ /dev/null
@@ -1,3736 +0,0 @@
-<<<<<<< Conflict 1 of 1
-%%%%%%% Changes from base to side #2
- pub mod cache;
- pub mod diff;
-
- use std::collections::btree_map;
- use std::collections::{BTreeMap, BTreeSet, HashMap};
- use std::fmt;
- use std::ops::Deref;
- use std::str::FromStr;
-
- use amplify::Wrapper;
- use nonempty::NonEmpty;
- use once_cell::sync::Lazy;
- use serde::{Deserialize, Serialize};
- use storage::{HasRepoId, RepositoryError};
- use thiserror::Error;
-
- use crate::cob;
--use crate::cob::common::{Author, Authorization, CodeLocation, Label, Reaction, Timestamp};
-+use crate::cob::common::{
-+ Author, Authorization, DiffLocation, Label, PartialLocation, Reaction, Timestamp,
-+};
- use crate::cob::store::Transaction;
- use crate::cob::store::{Cob, CobAction};
- use crate::cob::thread;
- use crate::cob::thread::Thread;
- use crate::cob::thread::{Comment, CommentId, Edit, Reactions};
- use crate::cob::{op, store, ActorId, Embed, EntryId, ObjectId, TypeName, Uri};
- use crate::crypto::{PublicKey, Signer};
- use crate::git;
- use crate::identity::doc::{DocAt, DocError};
- use crate::identity::PayloadError;
- use crate::prelude::*;
- use crate::storage;
-
- pub use cache::Cache;
-
- /// Type name of a patch.
- pub static TYPENAME: Lazy<TypeName> =
- Lazy::new(|| FromStr::from_str("xyz.radicle.patch").expect("type name is valid"));
-
- /// Patch operation.
- pub type Op = cob::Op<Action>;
-
- /// Identifier for a patch.
- pub type PatchId = ObjectId;
-
- /// Unique identifier for a patch revision.
- #[derive(
- Wrapper,
- Debug,
- Clone,
- Copy,
- Serialize,
- Deserialize,
- PartialEq,
- Eq,
- PartialOrd,
- Ord,
- Hash,
- From,
- Display,
- )]
- #[display(inner)]
- #[wrap(Deref)]
- pub struct RevisionId(EntryId);
-
- /// Unique identifier for a patch review.
- #[derive(
- Wrapper,
- Debug,
- Clone,
- Copy,
- Serialize,
- Deserialize,
- PartialEq,
- Eq,
- PartialOrd,
- Ord,
- Hash,
- From,
- Display,
- )]
- #[display(inner)]
- #[wrapper(Deref)]
- pub struct ReviewId(EntryId);
-
- /// Index of a revision in the revisions list.
- pub type RevisionIx = usize;
-
- /// Error applying an operation onto a state.
- #[derive(Debug, Error)]
- pub enum Error {
- /// Causal dependency missing.
- ///
- /// This error indicates that the operations are not being applied
- /// in causal order, which is a requirement for this CRDT.
- ///
- /// For example, this can occur if an operation references another operation
- /// that hasn't happened yet.
- #[error("causal dependency {0:?} missing")]
- Missing(EntryId),
- /// Error applying an op to the patch thread.
- #[error("thread apply failed: {0}")]
- Thread(#[from] thread::Error),
- /// Error loading the identity document committed to by an operation.
- #[error("identity doc failed to load: {0}")]
- Doc(#[from] DocError),
- /// Identity document is missing.
- #[error("missing identity document")]
- MissingIdentity,
- /// Review is empty.
- #[error("empty review; verdict or summary not provided")]
- EmptyReview,
- /// Duplicate review.
- #[error("review {0} of {1} already exists by author {2}")]
- DuplicateReview(ReviewId, RevisionId, NodeId),
- /// Error loading the document payload.
- #[error("payload failed to load: {0}")]
- Payload(#[from] PayloadError),
- /// Git error.
- #[error("git: {0}")]
- Git(#[from] git::ext::Error),
- /// Store error.
- #[error("store: {0}")]
- Store(#[from] store::Error),
- #[error("op decoding failed: {0}")]
- Op(#[from] op::OpEncodingError),
- /// Action not authorized by the author
- #[error("{0} not authorized to apply {1:?}")]
- NotAuthorized(ActorId, Action),
- /// An illegal action.
- #[error("action is not allowed: {0}")]
- NotAllowed(EntryId),
- /// Revision not found.
- #[error("revision not found: {0}")]
- RevisionNotFound(RevisionId),
- /// Initialization failed.
- #[error("initialization failed: {0}")]
- Init(&'static str),
- #[error("failed to update patch {id} in cache: {err}")]
- CacheUpdate {
- id: PatchId,
- #[source]
- err: Box<dyn std::error::Error + Send + Sync + 'static>,
- },
- #[error("failed to remove patch {id} from cache: {err}")]
- CacheRemove {
- id: PatchId,
- #[source]
- err: Box<dyn std::error::Error + Send + Sync + 'static>,
- },
- #[error("failed to remove patches from cache: {err}")]
- CacheRemoveAll {
- #[source]
- err: Box<dyn std::error::Error + Send + Sync + 'static>,
- },
- }
-
- /// Patch operation.
- #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
- #[serde(tag = "type", rename_all = "camelCase")]
- pub enum Action {
- //
- // Actions on patch.
- //
- #[serde(rename = "edit")]
- Edit { title: String, target: MergeTarget },
- #[serde(rename = "label")]
- Label { labels: BTreeSet<Label> },
- #[serde(rename = "lifecycle")]
- Lifecycle { state: Lifecycle },
- #[serde(rename = "assign")]
- Assign { assignees: BTreeSet<Did> },
- #[serde(rename = "merge")]
- Merge {
- revision: RevisionId,
- commit: git::Oid,
- },
-
- //
- // Review actions
- //
- #[serde(rename = "review")]
- Review {
- revision: RevisionId,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- summary: Option<String>,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- verdict: Option<Verdict>,
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
- labels: Vec<Label>,
- },
- #[serde(rename = "review.edit")]
- ReviewEdit {
- review: ReviewId,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- summary: Option<String>,
- #[serde(default, skip_serializing_if = "Option::is_none")]
- verdict: Option<Verdict>,
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
- labels: Vec<Label>,
- },
- #[serde(rename = "review.redact")]
- ReviewRedact { review: ReviewId },
-+ /// **DEPRECATED**
-+ ///
-+ /// We do not construct this variant anymore. Use [`Action::ReviewComment`]
-+ /// instead.
- #[serde(rename = "review.comment")]
-+ ReviewCommentV1(ReviewComment),
-+ #[serde(rename = "review.comment.v2")]
- ReviewComment {
- review: ReviewId,
- body: String,
- #[serde(default, skip_serializing_if = "Option::is_none")]
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- /// Comment this is a reply to.
- /// Should be [`None`] if it's the first comment.
- /// Should be [`Some`] otherwise.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- reply_to: Option<CommentId>,
- /// Embeded content.
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
- embeds: Vec<Embed<Uri>>,
- },
- #[serde(rename = "review.comment.edit")]
- ReviewCommentEdit {
- review: ReviewId,
- comment: EntryId,
- body: String,
- embeds: Vec<Embed<Uri>>,
- },
- #[serde(rename = "review.comment.redact")]
- ReviewCommentRedact { review: ReviewId, comment: EntryId },
- #[serde(rename = "review.comment.react")]
- ReviewCommentReact {
- review: ReviewId,
- comment: EntryId,
- reaction: Reaction,
- active: bool,
- },
- #[serde(rename = "review.comment.resolve")]
- ReviewCommentResolve { review: ReviewId, comment: EntryId },
- #[serde(rename = "review.comment.unresolve")]
- ReviewCommentUnresolve { review: ReviewId, comment: EntryId },
-
- //
- // Revision actions
- //
- #[serde(rename = "revision")]
- Revision {
- description: String,
- base: git::Oid,
- oid: git::Oid,
- /// Review comments resolved by this revision.
- #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
- resolves: BTreeSet<(EntryId, CommentId)>,
- },
- #[serde(rename = "revision.edit")]
- RevisionEdit {
- revision: RevisionId,
- description: String,
- /// Embeded content.
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
- embeds: Vec<Embed<Uri>>,
- },
-+ /// **DEPRECATED**
-+ ///
-+ /// We do not construct this variant anymore. Use
-+ /// [`Action::RevisionReact`] instead.
-+ #[serde(rename = "revision.react")]
-+ RevisionReactV1(RevisionReact),
- /// React to the revision.
-- #[serde(rename = "revision.react")]
-+ #[serde(rename = "revision.react.v2")]
- RevisionReact {
- revision: RevisionId,
- #[serde(default, skip_serializing_if = "Option::is_none")]
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- reaction: Reaction,
- active: bool,
- },
- #[serde(rename = "revision.redact")]
- RevisionRedact { revision: RevisionId },
-- #[serde(rename_all = "camelCase")]
-+ /// **DEPRECATED**
-+ ///
-+ /// We do not construct this variant anymore. Use
-+ /// [`Action::RevisionComment`] instead.
- #[serde(rename = "revision.comment")]
-+ RevisionCommentV1(RevisionComment),
-+ #[serde(rename = "revision.comment.v2")]
- RevisionComment {
- /// The revision to comment on.
- revision: RevisionId,
- /// For comments on the revision code.
- #[serde(default, skip_serializing_if = "Option::is_none")]
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- /// Comment body.
- body: String,
- /// Comment this is a reply to.
- /// Should be [`None`] if it's the top-level comment.
- /// Should be the root [`CommentId`] if it's a top-level comment.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- reply_to: Option<CommentId>,
- /// Embeded content.
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
- embeds: Vec<Embed<Uri>>,
- },
- /// Edit a revision comment.
- #[serde(rename = "revision.comment.edit")]
- RevisionCommentEdit {
- revision: RevisionId,
- comment: CommentId,
- body: String,
- embeds: Vec<Embed<Uri>>,
- },
- /// Redact a revision comment.
- #[serde(rename = "revision.comment.redact")]
- RevisionCommentRedact {
- revision: RevisionId,
- comment: CommentId,
- },
- /// React to a revision comment.
- #[serde(rename = "revision.comment.react")]
- RevisionCommentReact {
- revision: RevisionId,
- comment: CommentId,
- reaction: Reaction,
- active: bool,
- },
- }
-
-+/// Deliberately cannot be constructed outside of this module, so that it is no
-+/// longer used.
-
-+
-+/// Deliberately cannot be constructed outside of this module, so that it is no
-+/// longer used.
-+#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
-+#[serde(rename_all = "camelCase")]
-+pub struct RevisionComment {
-+ /// The revision to comment on.
-+ revision: RevisionId,
-+ /// For comments on the revision code.
-+ #[serde(default, skip_serializing_if = "Option::is_none")]
-+ location: Option<PartialLocation>,
-+ /// Comment body.
-+ body: String,
-+ /// Comment this is a reply to.
-+ /// Should be [`None`] if it's the top-level comment.
-+ /// Should be the root [`CommentId`] if it's a top-level comment.
-+ #[serde(default, skip_serializing_if = "Option::is_none")]
-+ reply_to: Option<CommentId>,
-+ /// Embeded content.
-+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
-+ embeds: Vec<Embed<Uri>>,
-+}
-+
-+#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
-+#[serde(rename_all = "camelCase")]
-+pub struct RevisionReact {
-+ revision: RevisionId,
-+ #[serde(default, skip_serializing_if = "Option::is_none")]
-+ location: Option<PartialLocation>,
-+ reaction: Reaction,
-+ active: bool,
-+}
-+
- impl CobAction for Action {
- fn parents(&self) -> Vec<git::Oid> {
- match self {
- Self::Revision { base, oid, .. } => {
- vec![*base, *oid]
- }
- Self::Merge { commit, .. } => {
- vec![*commit]
- }
- _ => vec![],
- }
- }
-
- fn produces_identifier(&self) -> bool {
- matches!(
- self,
- Self::Revision { .. }
- | Self::RevisionComment { .. }
- | Self::Review { .. }
- | Self::ReviewComment { .. }
- )
- }
- }
-
- /// Output of a merge.
- #[derive(Debug)]
- #[must_use]
- pub struct Merged<'a, R> {
- pub patch: PatchId,
- pub entry: EntryId,
-
- stored: &'a R,
- }
-
- impl<R: WriteRepository> Merged<'_, R> {
- /// Cleanup after merging a patch.
- ///
- /// This removes Git refs relating to the patch, both in the working copy,
- /// and the stored copy; and updates `rad/sigrefs`.
- pub fn cleanup<G: Signer>(
- self,
- working: &git::raw::Repository,
- signer: &G,
- ) -> Result<(), storage::RepositoryError> {
- let nid = signer.public_key();
- let stored_ref = git::refs::patch(&self.patch).with_namespace(nid.into());
- let working_ref = git::refs::workdir::patch_upstream(&self.patch);
-
- working
- .find_reference(&working_ref)
- .and_then(|mut r| r.delete())
- .ok();
-
- self.stored
- .raw()
- .find_reference(&stored_ref)
- .and_then(|mut r| r.delete())
- .ok();
- self.stored.sign_refs(signer)?;
-
- Ok(())
- }
- }
-
- /// Where a patch is intended to be merged.
- #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase")]
- pub enum MergeTarget {
- /// Intended for the default branch of the project delegates.
- /// Note that if the delegations change while the patch is open,
- /// this will always mean whatever the "current" delegation set is.
- /// If it were otherwise, patches could become un-mergeable.
- #[default]
- Delegates,
- }
-
- impl MergeTarget {
- /// Get the head of the target branch.
- pub fn head<R: ReadRepository>(&self, repo: &R) -> Result<git::Oid, RepositoryError> {
- match self {
- MergeTarget::Delegates => {
- let (_, target) = repo.head()?;
- Ok(target)
- }
- }
- }
- }
-
- /// Patch state.
- #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase")]
- pub struct Patch {
- /// Title of the patch.
- pub(super) title: String,
- /// Patch author.
- pub(super) author: Author,
- /// Current state of the patch.
- pub(super) state: State,
- /// Target this patch is meant to be merged in.
- pub(super) target: MergeTarget,
- /// Associated labels.
- /// Labels can be added and removed at will.
- pub(super) labels: BTreeSet<Label>,
- /// Patch merges.
- ///
- /// Only one merge is allowed per user.
- ///
- /// Merges can be removed and replaced, but not modified. Generally, once a revision is merged,
- /// it stays that way. Being able to remove merges may be useful in case of force updates
- /// on the target branch.
- pub(super) merges: BTreeMap<ActorId, Merge>,
- /// List of patch revisions. The initial changeset is part of the
- /// first revision.
- ///
- /// Revisions can be redacted, but are otherwise immutable.
- pub(super) revisions: BTreeMap<RevisionId, Option<Revision>>,
- /// Users assigned to review this patch.
- pub(super) assignees: BTreeSet<ActorId>,
- /// Timeline of operations.
- pub(super) timeline: Vec<EntryId>,
- /// Reviews index. Keeps track of reviews for better performance.
- pub(super) reviews: BTreeMap<ReviewId, Option<(RevisionId, ActorId)>>,
- }
-
- impl Patch {
- /// Construct a new patch object from a revision.
- pub fn new(title: String, target: MergeTarget, (id, revision): (RevisionId, Revision)) -> Self {
- Self {
- title,
- author: revision.author.clone(),
- state: State::default(),
- target,
- labels: BTreeSet::default(),
- merges: BTreeMap::default(),
- revisions: BTreeMap::from_iter([(id, Some(revision))]),
- assignees: BTreeSet::default(),
- timeline: vec![id.into_inner()],
- reviews: BTreeMap::default(),
- }
- }
-
- /// Title of the patch.
- pub fn title(&self) -> &str {
- self.title.as_str()
- }
-
- /// Current state of the patch.
- pub fn state(&self) -> &State {
- &self.state
- }
-
- /// Target this patch is meant to be merged in.
- pub fn target(&self) -> MergeTarget {
- self.target
- }
-
- /// Timestamp of the first revision of the patch.
- pub fn timestamp(&self) -> Timestamp {
- self.updates()
- .next()
- .map(|(_, r)| r)
- .expect("Patch::timestamp: at least one revision is present")
- .timestamp
- }
-
- /// Associated labels.
- pub fn labels(&self) -> impl Iterator<Item = &Label> {
- self.labels.iter()
- }
-
- /// Patch description.
- pub fn description(&self) -> &str {
- let (_, r) = self.root();
- r.description()
- }
-
- /// Patch embeds.
- pub fn embeds(&self) -> &[Embed<Uri>] {
- let (_, r) = self.root();
- r.embeds()
- }
-
- /// Author of the first revision of the patch.
- pub fn author(&self) -> &Author {
- &self.author
- }
-
- /// All revision authors.
- pub fn authors(&self) -> BTreeSet<&Author> {
- self.revisions
- .values()
- .filter_map(|r| r.as_ref())
- .map(|r| &r.author)
- .collect()
- }
-
- /// Get the `Revision` by its `RevisionId`.
- ///
- /// None is returned if the `Revision` has been redacted (deleted).
- pub fn revision(&self, id: &RevisionId) -> Option<&Revision> {
- self.revisions.get(id).and_then(|o| o.as_ref())
- }
-
- /// List of patch revisions by the patch author. The initial changeset is part of the
- /// first revision.
- pub fn updates(&self) -> impl DoubleEndedIterator<Item = (RevisionId, &Revision)> {
- self.revisions_by(self.author().public_key())
- }
-
- /// List of all patch revisions by all authors.
- pub fn revisions(&self) -> impl DoubleEndedIterator<Item = (RevisionId, &Revision)> {
- self.timeline.iter().filter_map(move |id| {
- self.revisions
- .get(id)
- .and_then(|o| o.as_ref())
- .map(|rev| (RevisionId(*id), rev))
- })
- }
-
- /// List of patch revisions by the given author.
- pub fn revisions_by<'a>(
- &'a self,
- author: &'a PublicKey,
- ) -> impl DoubleEndedIterator<Item = (RevisionId, &'a Revision)> {
- self.revisions()
- .filter(move |(_, r)| (r.author.public_key() == author))
- }
-
- /// List of patch reviews of the given revision.
- pub fn reviews_of(&self, rev: RevisionId) -> impl Iterator<Item = (&ReviewId, &Review)> {
- self.reviews.iter().filter_map(move |(review_id, t)| {
- t.and_then(|(rev_id, pk)| {
- if rev == rev_id {
- self.revision(&rev_id)
- .and_then(|r| r.review_by(&pk))
- .map(|r| (review_id, r))
- } else {
- None
- }
- })
- })
- }
-
- /// List of patch assignees.
- pub fn assignees(&self) -> impl Iterator<Item = Did> + '_ {
- self.assignees.iter().map(Did::from)
- }
-
- /// Get the merges.
- pub fn merges(&self) -> impl Iterator<Item = (&ActorId, &Merge)> {
- self.merges.iter()
- }
-
- /// Reference to the Git object containing the code on the latest revision.
- pub fn head(&self) -> &git::Oid {
- &self.latest().1.oid
- }
-
- /// Get the commit of the target branch on which this patch is based.
- /// This can change via a patch update.
- pub fn base(&self) -> &git::Oid {
- &self.latest().1.base
- }
-
- /// Get the merge base of this patch.
- pub fn merge_base<R: ReadRepository>(&self, repo: &R) -> Result<git::Oid, git::ext::Error> {
- repo.merge_base(self.base(), self.head())
- }
-
- /// Get the commit range of this patch.
- pub fn range(&self) -> Result<(git::Oid, git::Oid), git::ext::Error> {
- Ok((*self.base(), *self.head()))
- }
-
- /// Index of latest revision in the revisions list.
- pub fn version(&self) -> RevisionIx {
- self.revisions
- .len()
- .checked_sub(1)
- .expect("Patch::version: at least one revision is present")
- }
-
- /// Root revision.
- ///
- /// This is the revision that was created with the patch.
- pub fn root(&self) -> (RevisionId, &Revision) {
- self.updates()
- .next()
- .expect("Patch::root: there is always a root revision")
- }
-
- /// Latest revision by the patch author.
- pub fn latest(&self) -> (RevisionId, &Revision) {
- self.latest_by(self.author().public_key())
- .expect("Patch::latest: there is always at least one revision")
- }
-
- /// Latest revision by the given author.
- pub fn latest_by<'a>(&'a self, author: &'a PublicKey) -> Option<(RevisionId, &'a Revision)> {
- self.revisions_by(author).next_back()
- }
-
- /// Time of last update.
- pub fn updated_at(&self) -> Timestamp {
- self.latest().1.timestamp()
- }
-
- /// Check if the patch is merged.
- pub fn is_merged(&self) -> bool {
- matches!(self.state(), State::Merged { .. })
- }
-
- /// Check if the patch is open.
- pub fn is_open(&self) -> bool {
- matches!(self.state(), State::Open { .. })
- }
-
- /// Check if the patch is archived.
- pub fn is_archived(&self) -> bool {
- matches!(self.state(), State::Archived)
- }
-
- /// Check if the patch is a draft.
- pub fn is_draft(&self) -> bool {
- matches!(self.state(), State::Draft)
- }
-
- /// Apply authorization rules on patch actions.
- pub fn authorization(
- &self,
- action: &Action,
- actor: &ActorId,
- doc: &Doc,
- ) -> Result<Authorization, Error> {
- if doc.is_delegate(&actor.into()) {
- // A delegate is authorized to do all actions.
- return Ok(Authorization::Allow);
- }
- let author = self.author().id().as_key();
- let outcome = match action {
- // The patch author can edit the patch and change its state.
- Action::Edit { .. } => Authorization::from(actor == author),
- Action::Lifecycle { state } => Authorization::from(match state {
- Lifecycle::Open { .. } => actor == author,
- Lifecycle::Draft { .. } => actor == author,
- Lifecycle::Archived { .. } => actor == author,
- }),
- // Only delegates can carry out these actions.
- Action::Label { labels } => {
- if labels == &self.labels {
- // No-op is allowed for backwards compatibility.
- Authorization::Allow
- } else {
- Authorization::Deny
- }
- }
- Action::Assign { .. } => Authorization::Deny,
- Action::Merge { .. } => match self.target() {
- MergeTarget::Delegates => Authorization::Deny,
- },
- // Anyone can submit a review.
- Action::Review { .. } => Authorization::Allow,
- Action::ReviewRedact { review, .. } | Action::ReviewEdit { review, .. } => {
- if let Some((_, review)) = lookup::review(self, review)? {
- Authorization::from(actor == review.author.public_key())
- } else {
- // Redacted.
- Authorization::Unknown
- }
- }
- // Anyone can comment on a review.
-+ Action::ReviewCommentV1 { .. } => Authorization::Allow,
- Action::ReviewComment { .. } => Authorization::Allow,
- // The comment author can edit and redact their own comment.
- Action::ReviewCommentEdit {
- review, comment, ..
- }
- | Action::ReviewCommentRedact { review, comment } => {
- if let Some((_, review)) = lookup::review(self, review)? {
- if let Some(comment) = review.comments.comment(comment) {
- return Ok(Authorization::from(*actor == comment.author()));
- }
- }
- // Redacted.
- Authorization::Unknown
- }
- // Anyone can react to a review comment.
- Action::ReviewCommentReact { .. } => Authorization::Allow,
- // The reviewer, commenter or revision author can resolve and unresolve review comments.
- Action::ReviewCommentResolve { review, comment }
- | Action::ReviewCommentUnresolve { review, comment } => {
- if let Some((revision, review)) = lookup::review(self, review)? {
- if let Some(comment) = review.comments.comment(comment) {
- return Ok(Authorization::from(
- actor == &comment.author()
- || actor == review.author.public_key()
- || actor == revision.author.public_key(),
- ));
- }
- }
- // Redacted.
- Authorization::Unknown
- }
- // Anyone can propose revisions.
- Action::Revision { .. } => Authorization::Allow,
- // Only the revision author can edit or redact their revision.
- Action::RevisionEdit { revision, .. } | Action::RevisionRedact { revision, .. } => {
- if let Some(revision) = lookup::revision(self, revision)? {
- Authorization::from(actor == revision.author.public_key())
- } else {
- // Redacted.
- Authorization::Unknown
- }
- }
- // Anyone can react to or comment on a revision.
-+ Action::RevisionReactV1 { .. } => Authorization::Allow,
- Action::RevisionReact { .. } => Authorization::Allow,
-+ Action::RevisionCommentV1 { .. } => Authorization::Allow,
- Action::RevisionComment { .. } => Authorization::Allow,
- // Only the comment author can edit or redact their comment.
- Action::RevisionCommentEdit {
- revision, comment, ..
- }
- | Action::RevisionCommentRedact {
- revision, comment, ..
- } => {
- if let Some(revision) = lookup::revision(self, revision)? {
- if let Some(comment) = revision.discussion.comment(comment) {
- return Ok(Authorization::from(actor == &comment.author()));
- }
- }
- // Redacted.
- Authorization::Unknown
- }
- // Anyone can react to a revision.
- Action::RevisionCommentReact { .. } => Authorization::Allow,
- };
- Ok(outcome)
- }
- }
-
- impl Patch {
- /// Apply an action after checking if it's authorized.
- fn op_action<R: ReadRepository>(
- &mut self,
- action: Action,
- id: EntryId,
- author: ActorId,
- timestamp: Timestamp,
- concurrent: &[&cob::Entry],
- doc: &DocAt,
- repo: &R,
- ) -> Result<(), Error> {
- match self.authorization(&action, &author, doc)? {
- Authorization::Allow => {
- self.action(action, id, author, timestamp, concurrent, doc, repo)
- }
- Authorization::Deny => Err(Error::NotAuthorized(author, action)),
- Authorization::Unknown => {
- // In this case, since there is not enough information to determine
- // whether the action is authorized or not, we simply ignore it.
- // It's likely that the target object was redacted, and we can't
- // verify whether the action would have been allowed or not.
- Ok(())
- }
- }
- }
-
- /// Apply a single action to the patch.
- fn action<R: ReadRepository>(
- &mut self,
- action: Action,
- entry: EntryId,
- author: ActorId,
- timestamp: Timestamp,
- _concurrent: &[&cob::Entry],
- identity: &Doc,
- repo: &R,
- ) -> Result<(), Error> {
- match action {
- Action::Edit { title, target } => {
- self.title = title;
- self.target = target;
- }
- Action::Lifecycle { state } => {
- let valid = self.state == State::Draft
- || self.state == State::Archived
- || self.state == State::Open { conflicts: vec![] };
-
- if valid {
- match state {
- Lifecycle::Open => {
- self.state = State::Open { conflicts: vec![] };
- }
- Lifecycle::Draft => {
- self.state = State::Draft;
- }
- Lifecycle::Archived => {
- self.state = State::Archived;
- }
- }
- }
- }
- Action::Label { labels } => {
- self.labels = BTreeSet::from_iter(labels);
- }
- Action::Assign { assignees } => {
- self.assignees = BTreeSet::from_iter(assignees.into_iter().map(ActorId::from));
- }
- Action::RevisionEdit {
- revision,
- description,
- embeds,
- } => {
- if let Some(redactable) = self.revisions.get_mut(&revision) {
- // If the revision was redacted concurrently, there's nothing to do.
- if let Some(revision) = redactable {
- revision.description.push(Edit::new(
- author,
- description,
- timestamp,
- embeds,
- ));
- }
- } else {
- return Err(Error::Missing(revision.into_inner()));
- }
- }
- Action::Revision {
- description,
- base,
- oid,
- resolves,
- } => {
- debug_assert!(!self.revisions.contains_key(&entry));
- let id = RevisionId(entry);
-
- self.revisions.insert(
- id,
- Some(Revision::new(
- id,
- author.into(),
- description,
- base,
- oid,
- timestamp,
- resolves,
- )),
- );
- }
-+ Action::RevisionReactV1(RevisionReact {
-+ revision,
-+ reaction,
-+ active,
-+ location,
-+ }) => {
-+ if let Some(revision) = lookup::revision_mut(self, &revision)? {
-+ let key = (author, reaction);
-+ let location = location.map(CodeLocation::from);
-+ let reactions = revision.reactions.entry(location).or_default();
-+
-+ if active {
-+ reactions.insert(key);
-+ } else {
-+ reactions.remove(&key);
-+ }
-+ }
-+ }
- Action::RevisionReact {
- revision,
- reaction,
- active,
- location,
- } => {
- if let Some(revision) = lookup::revision_mut(self, &revision)? {
- let key = (author, reaction);
-+ let location = location.map(CodeLocation::from);
- let reactions = revision.reactions.entry(location).or_default();
-
- if active {
- reactions.insert(key);
- } else {
- reactions.remove(&key);
- }
- }
- }
- Action::RevisionRedact { revision } => {
- // Not allowed to delete the root revision.
- let (root, _) = self.root();
- if revision == root {
- return Err(Error::NotAllowed(entry));
- }
- // Redactions must have observed a revision to be valid.
- if let Some(r) = self.revisions.get_mut(&revision) {
- // If the revision has already been merged, ignore the redaction. We
- // don't want to redact merged revisions.
- if self.merges.values().any(|m| m.revision == revision) {
- return Ok(());
- }
- *r = None;
- } else {
- return Err(Error::Missing(revision.into_inner()));
- }
- }
- Action::Review {
- revision,
- ref summary,
- verdict,
- labels,
- } => {
- let Some(rev) = self.revisions.get_mut(&revision) else {
- // If the revision was redacted concurrently, there's nothing to do.
- return Ok(());
- };
- if let Some(rev) = rev {
- // Insert a review if there isn't already one. Otherwise we just ignore
- // this operation
- if let btree_map::Entry::Vacant(e) = rev.reviews.entry(author) {
- let id = ReviewId(entry);
-
- e.insert(Review::new(
- id,
- Author::new(author),
- verdict,
- summary.to_owned(),
- labels,
- timestamp,
- ));
- // Update reviews index.
- self.reviews.insert(id, Some((revision, author)));
- } else {
- log::error!(
- target: "patch",
- "Review by {author} for {revision} already exists, ignoring action.."
- );
- }
- }
- }
- Action::ReviewEdit {
- review,
- summary,
- verdict,
- labels,
- } => {
- if summary.is_none() && verdict.is_none() {
- return Err(Error::EmptyReview);
- }
- let Some(review) = lookup::review_mut(self, &review)? else {
- return Ok(());
- };
- review.verdict = verdict;
- review.summary = summary;
- review.labels = labels;
- }
- Action::ReviewCommentReact {
- review,
- comment,
- reaction,
- active,
- } => {
- if let Some(review) = lookup::review_mut(self, &review)? {
- thread::react(
- &mut review.comments,
- entry,
- author,
- comment,
- reaction,
- active,
- )?;
- }
- }
- Action::ReviewCommentRedact { review, comment } => {
- if let Some(review) = lookup::review_mut(self, &review)? {
- thread::redact(&mut review.comments, entry, comment)?;
- }
- }
- Action::ReviewCommentEdit {
- review,
- comment,
- body,
- embeds,
- } => {
- if let Some(review) = lookup::review_mut(self, &review)? {
- thread::edit(
- &mut review.comments,
- entry,
- author,
- comment,
- timestamp,
- body,
- embeds,
- )?;
- }
- }
- Action::ReviewCommentResolve { review, comment } => {
- if let Some(review) = lookup::review_mut(self, &review)? {
- thread::resolve(&mut review.comments, entry, comment)?;
- }
- }
- Action::ReviewCommentUnresolve { review, comment } => {
- if let Some(review) = lookup::review_mut(self, &review)? {
- thread::unresolve(&mut review.comments, entry, comment)?;
- }
- }
-+ Action::ReviewCommentV1(ReviewComment {
-+ review,
-+ body,
-+ location,
-+ reply_to,
-+ embeds,
-+ }) => {
-+ if let Some(review) = lookup::review_mut(self, &review)? {
-+ thread::comment(
-+ &mut review.comments,
-+ entry,
-+ author,
-+ timestamp,
-+ body,
-+ reply_to,
-+ location.map(|loc| loc.into()),
-+ embeds,
-+ )?;
-+ }
-+ }
- Action::ReviewComment {
- review,
- body,
- location,
- reply_to,
- embeds,
- } => {
- if let Some(review) = lookup::review_mut(self, &review)? {
- thread::comment(
- &mut review.comments,
- entry,
- author,
- timestamp,
- body,
- reply_to,
-- location,
-+ location.map(|loc| loc.into()),
- embeds,
- )?;
- }
- }
- Action::ReviewRedact { review } => {
- // Redactions must have observed a review to be valid.
- let Some(locator) = self.reviews.get_mut(&review) else {
- return Err(Error::Missing(review.into_inner()));
- };
- // If the review is already redacted, do nothing.
- let Some((revision, reviewer)) = locator else {
- return Ok(());
- };
- // The revision must have existed at some point.
- let Some(redactable) = self.revisions.get_mut(revision) else {
- return Err(Error::Missing(revision.into_inner()));
- };
- // But it could be redacted.
- let Some(revision) = redactable else {
- return Ok(());
- };
- // Remove review for this author.
- if let Some(r) = revision.reviews.remove(reviewer) {
- debug_assert_eq!(r.id, review);
- } else {
- log::error!(
- target: "patch", "Review {review} not found in revision {}", revision.id
- );
- }
- // Set the review locator in the review index to redacted.
- *locator = None;
- }
- Action::Merge { revision, commit } => {
- // If the revision was redacted before the merge, ignore the merge.
- if lookup::revision_mut(self, &revision)?.is_none() {
- return Ok(());
- };
- match self.target() {
- MergeTarget::Delegates => {
- let proj = identity.project()?;
- let branch = git::refs::branch(proj.default_branch());
-
- // Nb. We don't return an error in case the merge commit is not an
- // ancestor of the default branch. The default branch can change
- // *after* the merge action is created, which is out of the control
- // of the merge author. We simply skip it, which allows archiving in
- // case of a rebase off the master branch, or a redaction of the
- // merge.
- let Ok(head) = repo.reference_oid(&author, &branch) else {
- return Ok(());
- };
- if commit != head && !repo.is_ancestor_of(commit, head)? {
- return Ok(());
- }
- }
- }
- self.merges.insert(
- author,
- Merge {
- revision,
- commit,
- timestamp,
- },
- );
-
- let mut merges = self.merges.iter().fold(
- HashMap::<(RevisionId, git::Oid), usize>::new(),
- |mut acc, (_, merge)| {
- *acc.entry((merge.revision, merge.commit)).or_default() += 1;
- acc
- },
- );
- // Discard revisions that weren't merged by a threshold of delegates.
- merges.retain(|_, count| *count >= identity.threshold());
-
- match merges.into_keys().collect::<Vec<_>>().as_slice() {
- [] => {
- // None of the revisions met the quorum.
- }
- [(revision, commit)] => {
- // Patch is merged.
- self.state = State::Merged {
- revision: *revision,
- commit: *commit,
- };
- }
- revisions => {
- // More than one revision met the quorum.
- self.state = State::Open {
- conflicts: revisions.to_vec(),
- };
- }
- }
- }
-
-+ Action::RevisionCommentV1(RevisionComment {
-+ revision,
-+ body,
-+ reply_to,
-+ embeds,
-+ location,
-+ }) => {
-+ if let Some(revision) = lookup::revision_mut(self, &revision)? {
-+ thread::comment(
-+ &mut revision.discussion,
-+ entry,
-+ author,
-+ timestamp,
-+ body,
-+ reply_to,
-+ location.map(|loc| loc.into()),
-+ embeds,
-+ )?;
-+ }
-+ }
- Action::RevisionComment {
- revision,
- body,
- reply_to,
- embeds,
- location,
- } => {
- if let Some(revision) = lookup::revision_mut(self, &revision)? {
- thread::comment(
- &mut revision.discussion,
- entry,
- author,
- timestamp,
- body,
- reply_to,
-- location,
-+ location.map(|loc| loc.into()),
- embeds,
- )?;
- }
- }
- Action::RevisionCommentEdit {
- revision,
- comment,
- body,
- embeds,
- } => {
- if let Some(revision) = lookup::revision_mut(self, &revision)? {
- thread::edit(
- &mut revision.discussion,
- entry,
- author,
- comment,
- timestamp,
- body,
- embeds,
- )?;
- }
- }
- Action::RevisionCommentRedact { revision, comment } => {
- if let Some(revision) = lookup::revision_mut(self, &revision)? {
- thread::redact(&mut revision.discussion, entry, comment)?;
- }
- }
- Action::RevisionCommentReact {
- revision,
- comment,
- reaction,
- active,
- } => {
- if let Some(revision) = lookup::revision_mut(self, &revision)? {
- thread::react(
- &mut revision.discussion,
- entry,
- author,
- comment,
- reaction,
- active,
- )?;
- }
- }
- }
- Ok(())
- }
- }
-
- impl cob::store::CobWithType for Patch {
- fn type_name() -> &'static TypeName {
- &TYPENAME
- }
- }
-
- impl store::Cob for Patch {
- type Action = Action;
- type Error = Error;
-
- fn from_root<R: ReadRepository>(op: Op, repo: &R) -> Result<Self, Self::Error> {
- let doc = op.identity_doc(repo)?.ok_or(Error::MissingIdentity)?;
- let mut actions = op.actions.into_iter();
- let Some(Action::Revision {
- description,
- base,
- oid,
- resolves,
- }) = actions.next()
- else {
- return Err(Error::Init("the first action must be of type `revision`"));
- };
- let Some(Action::Edit { title, target }) = actions.next() else {
- return Err(Error::Init("the second action must be of type `edit`"));
- };
- let revision = Revision::new(
- RevisionId(op.id),
- op.author.into(),
- description,
- base,
- oid,
- op.timestamp,
- resolves,
- );
- let mut patch = Patch::new(title, target, (RevisionId(op.id), revision));
-
- for action in actions {
- match patch.authorization(&action, &op.author, &doc)? {
- Authorization::Allow => {
- patch.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?;
- }
- Authorization::Deny => {
- return Err(Error::NotAuthorized(op.author, action));
- }
- Authorization::Unknown => {
- // Note that this shouldn't really happen since there's no concurrency in the
- // root operation.
- continue;
- }
- }
- }
- Ok(patch)
- }
-
- fn op<'a, R: ReadRepository, I: IntoIterator<Item = &'a cob::Entry>>(
- &mut self,
- op: Op,
- concurrent: I,
- repo: &R,
- ) -> Result<(), Error> {
- debug_assert!(!self.timeline.contains(&op.id));
- self.timeline.push(op.id);
-
- let doc = op.identity_doc(repo)?.ok_or(Error::MissingIdentity)?;
- let concurrent = concurrent.into_iter().collect::<Vec<_>>();
-
- for action in op.actions {
- log::trace!(target: "patch", "Applying {} {action:?}", op.id);
-
- if let Err(e) = self.op_action(
- action,
- op.id,
- op.author,
- op.timestamp,
- &concurrent,
- &doc,
- repo,
- ) {
- log::error!(target: "patch", "Error applying {}: {e}", op.id);
- return Err(e);
- }
- }
- Ok(())
- }
- }
-
- impl<R: ReadRepository> cob::Evaluate<R> for Patch {
- type Error = Error;
-
- fn init(entry: &cob::Entry, repo: &R) -> Result<Self, Self::Error> {
- let op = Op::try_from(entry)?;
- let object = Patch::from_root(op, repo)?;
-
- Ok(object)
- }
-
- fn apply<'a, I: Iterator<Item = (&'a EntryId, &'a cob::Entry)>>(
- &mut self,
- entry: &cob::Entry,
- concurrent: I,
- repo: &R,
- ) -> Result<(), Self::Error> {
- let op = Op::try_from(entry)?;
-
- self.op(op, concurrent.map(|(_, e)| e), repo)
- }
- }
-
- mod lookup {
- use super::*;
-
- pub fn revision<'a>(
- patch: &'a Patch,
- revision: &RevisionId,
- ) -> Result<Option<&'a Revision>, Error> {
- match patch.revisions.get(revision) {
- Some(Some(revision)) => Ok(Some(revision)),
- // Redacted.
- Some(None) => Ok(None),
- // Missing. Causal error.
- None => Err(Error::Missing(revision.into_inner())),
- }
- }
-
- pub fn revision_mut<'a>(
- patch: &'a mut Patch,
- revision: &RevisionId,
- ) -> Result<Option<&'a mut Revision>, Error> {
- match patch.revisions.get_mut(revision) {
- Some(Some(revision)) => Ok(Some(revision)),
- // Redacted.
- Some(None) => Ok(None),
- // Missing. Causal error.
- None => Err(Error::Missing(revision.into_inner())),
- }
- }
-
- pub fn review<'a>(
- patch: &'a Patch,
- review: &ReviewId,
- ) -> Result<Option<(&'a Revision, &'a Review)>, Error> {
- match patch.reviews.get(review) {
- Some(Some((revision, author))) => {
- match patch.revisions.get(revision) {
- Some(Some(rev)) => {
- let r = rev
- .reviews
- .get(author)
- .ok_or_else(|| Error::Missing(review.into_inner()))?;
- debug_assert_eq!(&r.id, review);
-
- Ok(Some((rev, r)))
- }
- Some(None) => {
- // If the revision was redacted concurrently, there's nothing to do.
- // Likewise, if the review was redacted concurrently, there's nothing to do.
- Ok(None)
- }
- None => Err(Error::Missing(revision.into_inner())),
- }
- }
- Some(None) => {
- // Redacted.
- Ok(None)
- }
- None => Err(Error::Missing(review.into_inner())),
- }
- }
-
- pub fn review_mut<'a>(
- patch: &'a mut Patch,
- review: &ReviewId,
- ) -> Result<Option<&'a mut Review>, Error> {
- match patch.reviews.get(review) {
- Some(Some((revision, author))) => {
- match patch.revisions.get_mut(revision) {
- Some(Some(rev)) => {
- let r = rev
- .reviews
- .get_mut(author)
- .ok_or_else(|| Error::Missing(review.into_inner()))?;
- debug_assert_eq!(&r.id, review);
-
- Ok(Some(r))
- }
- Some(None) => {
- // If the revision was redacted concurrently, there's nothing to do.
- // Likewise, if the review was redacted concurrently, there's nothing to do.
- Ok(None)
- }
- None => Err(Error::Missing(revision.into_inner())),
- }
- }
- Some(None) => {
- // Redacted.
- Ok(None)
- }
- None => Err(Error::Missing(review.into_inner())),
- }
- }
- }
-
-+/// A `CodeLocation` enumerates the different locations that refer to code.
-+///
-+/// [`CodeLocation::Partial`] is the variant that ensures we are
-+/// backwards-compatible.
-+///
-+/// [`CodeLocation::Diff`] is the variant that is the location that is used in
-+/// the public API.
-+#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
-+#[serde(rename_all = "camelCase", tag = "type")]
-+pub enum CodeLocation {
-+ Partial(PartialLocation),
-+ Diff(DiffLocation),
-+}
-+
-+impl From<PartialLocation> for CodeLocation {
-+ fn from(loc: PartialLocation) -> Self {
-+ Self::Partial(loc)
-+ }
-+}
-+
-+impl From<DiffLocation> for CodeLocation {
-+ fn from(loc: DiffLocation) -> Self {
-+ Self::Diff(loc)
-+ }
-+}
-+
- /// A patch revision.
- #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase")]
- pub struct Revision {
- /// Revision identifier.
- pub(super) id: RevisionId,
- /// Author of the revision.
- pub(super) author: Author,
- /// Revision description.
- pub(super) description: NonEmpty<Edit>,
- /// Base branch commit, used as a merge base.
- pub(super) base: git::Oid,
- /// Reference to the Git object containing the code (revision head).
- pub(super) oid: git::Oid,
- /// Discussion around this revision.
- pub(super) discussion: Thread<Comment<CodeLocation>>,
- /// Reviews of this revision's changes (all review edits are kept).
- pub(super) reviews: BTreeMap<ActorId, Review>,
- /// When this revision was created.
- pub(super) timestamp: Timestamp,
- /// Review comments resolved by this revision.
- pub(super) resolves: BTreeSet<(EntryId, CommentId)>,
- /// Reactions on code locations and revision itself
- #[serde(
- serialize_with = "ser::serialize_reactions",
- deserialize_with = "ser::deserialize_reactions"
- )]
- pub(super) reactions: BTreeMap<Option<CodeLocation>, Reactions>,
- }
-
- impl Revision {
- pub fn new(
- id: RevisionId,
- author: Author,
- description: String,
- base: git::Oid,
- oid: git::Oid,
- timestamp: Timestamp,
- resolves: BTreeSet<(EntryId, CommentId)>,
- ) -> Self {
- let description = Edit::new(*author.public_key(), description, timestamp, Vec::default());
-
- Self {
- id,
- author,
- description: NonEmpty::new(description),
- base,
- oid,
- discussion: Thread::default(),
- reviews: BTreeMap::default(),
- timestamp,
- resolves,
- reactions: Default::default(),
- }
- }
-
- pub fn id(&self) -> RevisionId {
- self.id
- }
-
- pub fn description(&self) -> &str {
- self.description.last().body.as_str()
- }
-
- pub fn edits(&self) -> impl Iterator<Item = &Edit> {
- self.description.iter()
- }
-
- pub fn embeds(&self) -> &[Embed<Uri>] {
- &self.description.last().embeds
- }
-
- pub fn reactions(&self) -> &BTreeMap<Option<CodeLocation>, BTreeSet<(PublicKey, Reaction)>> {
- &self.reactions
- }
-
- /// Author of the revision.
- pub fn author(&self) -> &Author {
- &self.author
- }
-
- /// Base branch commit, used as a merge base.
- pub fn base(&self) -> &git::Oid {
- &self.base
- }
-
- /// Reference to the Git object containing the code (revision head).
- pub fn head(&self) -> git::Oid {
- self.oid
- }
-
- /// Get the commit range of this revision.
- pub fn range(&self) -> (git::Oid, git::Oid) {
- (self.base, self.oid)
- }
-
- /// When this revision was created.
- pub fn timestamp(&self) -> Timestamp {
- self.timestamp
- }
-
- /// Discussion around this revision.
- pub fn discussion(&self) -> &Thread<Comment<CodeLocation>> {
- &self.discussion
- }
-
- /// Review comments resolved by this revision.
- pub fn resolves(&self) -> &BTreeSet<(EntryId, CommentId)> {
- &self.resolves
- }
-
- /// Iterate over all top-level replies.
- pub fn replies(&self) -> impl Iterator<Item = (&CommentId, &thread::Comment<CodeLocation>)> {
- self.discussion.comments()
- }
-
- /// Reviews of this revision's changes (one per actor).
- pub fn reviews(&self) -> impl DoubleEndedIterator<Item = (&PublicKey, &Review)> {
- self.reviews.iter()
- }
-
- /// Get a review by author.
- pub fn review_by(&self, author: &ActorId) -> Option<&Review> {
- self.reviews.get(author)
- }
- }
-
- /// Patch state.
- #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase", tag = "status")]
- pub enum State {
- Draft,
- Open {
- /// Revisions that were merged and are conflicting.
- #[serde(skip_serializing_if = "Vec::is_empty")]
- #[serde(default)]
- conflicts: Vec<(RevisionId, git::Oid)>,
- },
- Archived,
- Merged {
- /// The revision that was merged.
- revision: RevisionId,
- /// The commit in the target branch that contains the changes.
- commit: git::Oid,
- },
- }
-
- impl Default for State {
- fn default() -> Self {
- Self::Open { conflicts: vec![] }
- }
- }
-
- impl fmt::Display for State {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- match self {
- Self::Archived => write!(f, "archived"),
- Self::Draft => write!(f, "draft"),
- Self::Open { .. } => write!(f, "open"),
- Self::Merged { .. } => write!(f, "merged"),
- }
- }
- }
-
- impl From<&State> for Status {
- fn from(value: &State) -> Self {
- match value {
- State::Draft => Self::Draft,
- State::Open { .. } => Self::Open,
- State::Archived => Self::Archived,
- State::Merged { .. } => Self::Merged,
- }
- }
- }
-
- /// A simplified enumeration of a [`State`] that can be used for
- /// filtering purposes.
- #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
- pub enum Status {
- Draft,
- #[default]
- Open,
- Archived,
- Merged,
- }
-
- impl fmt::Display for Status {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- match self {
- Self::Archived => write!(f, "archived"),
- Self::Draft => write!(f, "draft"),
- Self::Open => write!(f, "open"),
- Self::Merged => write!(f, "merged"),
- }
- }
- }
-
- /// A lifecycle operation, resulting in a new state.
- #[derive(Default, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase", tag = "status")]
- pub enum Lifecycle {
- #[default]
- Open,
- Draft,
- Archived,
- }
-
- /// A merged patch revision.
- #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
- #[serde(rename_all = "camelCase")]
- pub struct Merge {
- /// Revision that was merged.
- pub revision: RevisionId,
- /// Base branch commit that contains the revision.
- pub commit: git::Oid,
- /// When this merge was performed.
- pub timestamp: Timestamp,
- }
-
- /// A patch review verdict.
- #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase")]
- pub enum Verdict {
- /// Accept patch.
- Accept,
- /// Reject patch.
- Reject,
- }
-
- impl fmt::Display for Verdict {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- match self {
- Self::Accept => write!(f, "accept"),
- Self::Reject => write!(f, "reject"),
- }
- }
- }
-
- /// A patch review on a revision.
- #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
- #[serde(rename_all = "camelCase")]
- pub struct Review {
- /// Review identifier.
- pub(super) id: ReviewId,
- /// Review author.
- pub(super) author: Author,
- /// Review verdict.
- ///
- /// The verdict cannot be changed, since revisions are immutable.
- pub(super) verdict: Option<Verdict>,
- /// Review summary.
- ///
- /// Can be edited or set to `None`.
- pub(super) summary: Option<String>,
- /// Review comments.
- pub(super) comments: Thread<Comment<CodeLocation>>,
- /// Labels qualifying the review. For example if this review only looks at the
- /// concept or intention of the patch, it could have a "concept" label.
- pub(super) labels: Vec<Label>,
- /// Review timestamp.
- pub(super) timestamp: Timestamp,
- }
-
- impl Review {
- pub fn new(
- id: ReviewId,
- author: Author,
- verdict: Option<Verdict>,
- summary: Option<String>,
- labels: Vec<Label>,
- timestamp: Timestamp,
- ) -> Self {
- Self {
- id,
- author,
- verdict,
- summary,
- comments: Thread::default(),
- labels,
- timestamp,
- }
- }
-
- /// Review identifier.
- pub fn id(&self) -> ReviewId {
- self.id
- }
-
- /// Review author.
- pub fn author(&self) -> &Author {
- &self.author
- }
-
- /// Review verdict.
- pub fn verdict(&self) -> Option<Verdict> {
- self.verdict
- }
-
- /// Review inline code comments.
- pub fn comments(&self) -> impl DoubleEndedIterator<Item = (&EntryId, &Comment<CodeLocation>)> {
- self.comments.comments()
- }
-
- /// Review labels.
- pub fn labels(&self) -> impl Iterator<Item = &Label> {
- self.labels.iter()
- }
-
- /// Review general comment.
- pub fn summary(&self) -> Option<&str> {
- self.summary.as_deref()
- }
-
- /// Review timestamp.
- pub fn timestamp(&self) -> Timestamp {
- self.timestamp
- }
- }
-
- impl<R: ReadRepository> store::Transaction<Patch, R> {
- pub fn edit(&mut self, title: impl ToString, target: MergeTarget) -> Result<(), store::Error> {
- self.push(Action::Edit {
- title: title.to_string(),
- target,
- })
- }
-
- pub fn edit_revision(
- &mut self,
- revision: RevisionId,
- description: impl ToString,
- embeds: Vec<Embed<Uri>>,
- ) -> Result<(), store::Error> {
- self.embed(embeds.clone())?;
- self.push(Action::RevisionEdit {
- revision,
- description: description.to_string(),
- embeds,
- })
- }
-
- /// Redact the revision.
- pub fn redact(&mut self, revision: RevisionId) -> Result<(), store::Error> {
- self.push(Action::RevisionRedact { revision })
- }
-
- /// Start a patch revision discussion.
- pub fn thread<S: ToString>(
- &mut self,
- revision: RevisionId,
- body: S,
- ) -> Result<(), store::Error> {
- self.push(Action::RevisionComment {
- revision,
- body: body.to_string(),
- reply_to: None,
- location: None,
- embeds: vec![],
- })
- }
-
- /// React on a patch revision.
- pub fn react(
- &mut self,
- revision: RevisionId,
- reaction: Reaction,
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- active: bool,
- ) -> Result<(), store::Error> {
- self.push(Action::RevisionReact {
- revision,
- reaction,
- location,
- active,
- })
- }
-
- /// Comment on a patch revision.
- pub fn comment<S: ToString>(
- &mut self,
- revision: RevisionId,
- body: S,
- reply_to: Option<CommentId>,
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- embeds: Vec<Embed<Uri>>,
- ) -> Result<(), store::Error> {
- self.embed(embeds.clone())?;
- self.push(Action::RevisionComment {
- revision,
- body: body.to_string(),
- reply_to,
- location,
- embeds,
- })
- }
-
- /// Edit a comment on a patch revision.
- pub fn comment_edit<S: ToString>(
- &mut self,
- revision: RevisionId,
- comment: CommentId,
- body: S,
- embeds: Vec<Embed<Uri>>,
- ) -> Result<(), store::Error> {
- self.embed(embeds.clone())?;
- self.push(Action::RevisionCommentEdit {
- revision,
- comment,
- body: body.to_string(),
- embeds,
- })
- }
-
- /// React a comment on a patch revision.
- pub fn comment_react(
- &mut self,
- revision: RevisionId,
- comment: CommentId,
- reaction: Reaction,
- active: bool,
- ) -> Result<(), store::Error> {
- self.push(Action::RevisionCommentReact {
- revision,
- comment,
- reaction,
- active,
- })
- }
-
- /// Redact a comment on a patch revision.
- pub fn comment_redact(
- &mut self,
- revision: RevisionId,
- comment: CommentId,
- ) -> Result<(), store::Error> {
- self.push(Action::RevisionCommentRedact { revision, comment })
- }
-
-- /// Comment on a review.
-+ /// Comment on a review for a diff location.
- pub fn review_comment<S: ToString>(
- &mut self,
- review: ReviewId,
- body: S,
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- reply_to: Option<CommentId>,
- embeds: Vec<Embed<Uri>>,
- ) -> Result<(), store::Error> {
- self.embed(embeds.clone())?;
- self.push(Action::ReviewComment {
- review,
- body: body.to_string(),
- location,
- reply_to,
- embeds,
- })
- }
-
- /// Resolve a review comment.
- pub fn review_comment_resolve(
- &mut self,
- review: ReviewId,
- comment: CommentId,
- ) -> Result<(), store::Error> {
- self.push(Action::ReviewCommentResolve { review, comment })
- }
-
- /// Unresolve a review comment.
- pub fn review_comment_unresolve(
- &mut self,
- review: ReviewId,
- comment: CommentId,
- ) -> Result<(), store::Error> {
- self.push(Action::ReviewCommentUnresolve { review, comment })
- }
-
- /// Edit review comment.
- pub fn edit_review_comment<S: ToString>(
- &mut self,
- review: ReviewId,
- comment: EntryId,
- body: S,
- embeds: Vec<Embed<Uri>>,
- ) -> Result<(), store::Error> {
- self.embed(embeds.clone())?;
- self.push(Action::ReviewCommentEdit {
- review,
- comment,
- body: body.to_string(),
- embeds,
- })
- }
-
- /// React to a review comment.
- pub fn react_review_comment(
- &mut self,
- review: ReviewId,
- comment: EntryId,
- reaction: Reaction,
- active: bool,
- ) -> Result<(), store::Error> {
- self.push(Action::ReviewCommentReact {
- review,
- comment,
- reaction,
- active,
- })
- }
-
- /// Redact a review comment.
- pub fn redact_review_comment(
- &mut self,
- review: ReviewId,
- comment: EntryId,
- ) -> Result<(), store::Error> {
- self.push(Action::ReviewCommentRedact { review, comment })
- }
-
- /// Review a patch revision.
- /// Does nothing if a review for that revision already exists by the author.
- pub fn review(
- &mut self,
- revision: RevisionId,
- verdict: Option<Verdict>,
- summary: Option<String>,
- labels: Vec<Label>,
- ) -> Result<(), store::Error> {
- self.push(Action::Review {
- revision,
- summary,
- verdict,
- labels,
- })
- }
-
- /// Edit a review.
- pub fn review_edit(
- &mut self,
- review: ReviewId,
- verdict: Option<Verdict>,
- summary: Option<String>,
- labels: Vec<Label>,
- ) -> Result<(), store::Error> {
- self.push(Action::ReviewEdit {
- review,
- summary,
- verdict,
- labels,
- })
- }
-
- /// Redact a patch review.
- pub fn redact_review(&mut self, review: ReviewId) -> Result<(), store::Error> {
- self.push(Action::ReviewRedact { review })
- }
-
- /// Merge a patch revision.
- pub fn merge(&mut self, revision: RevisionId, commit: git::Oid) -> Result<(), store::Error> {
- self.push(Action::Merge { revision, commit })
- }
-
- /// Update a patch with a new revision.
- pub fn revision(
- &mut self,
- description: impl ToString,
- base: impl Into<git::Oid>,
- oid: impl Into<git::Oid>,
- ) -> Result<(), store::Error> {
- self.push(Action::Revision {
- description: description.to_string(),
- base: base.into(),
- oid: oid.into(),
- resolves: BTreeSet::new(),
- })
- }
-
- /// Lifecycle a patch.
- pub fn lifecycle(&mut self, state: Lifecycle) -> Result<(), store::Error> {
- self.push(Action::Lifecycle { state })
- }
-
- /// Assign a patch.
- pub fn assign(&mut self, assignees: BTreeSet<Did>) -> Result<(), store::Error> {
- self.push(Action::Assign { assignees })
- }
-
- /// Label a patch.
- pub fn label(&mut self, labels: impl IntoIterator<Item = Label>) -> Result<(), store::Error> {
- self.push(Action::Label {
- labels: labels.into_iter().collect(),
- })
- }
- }
-
- pub struct PatchMut<'a, 'g, R, C> {
- pub id: ObjectId,
-
- patch: Patch,
- store: &'g mut Patches<'a, R>,
- cache: &'g mut C,
- }
-
- impl<'a, 'g, R, C> PatchMut<'a, 'g, R, C>
- where
- C: cob::cache::Update<Patch>,
- R: ReadRepository + SignRepository + cob::Store,
- {
- pub fn new(id: ObjectId, patch: Patch, cache: &'g mut Cache<Patches<'a, R>, C>) -> Self {
- Self {
- id,
- patch,
- store: &mut cache.store,
- cache: &mut cache.cache,
- }
- }
-
- pub fn id(&self) -> &ObjectId {
- &self.id
- }
-
- /// Reload the patch data from storage.
- pub fn reload(&mut self) -> Result<(), store::Error> {
- self.patch = self
- .store
- .get(&self.id)?
- .ok_or_else(|| store::Error::NotFound(TYPENAME.clone(), self.id))?;
-
- Ok(())
- }
-
- pub fn transaction<G, F>(
- &mut self,
- message: &str,
- signer: &G,
- operations: F,
- ) -> Result<EntryId, Error>
- where
- G: Signer,
- F: FnOnce(&mut Transaction<Patch, R>) -> Result<(), store::Error>,
- {
- let mut tx = Transaction::default();
- operations(&mut tx)?;
-
- let (patch, commit) = tx.commit(message, self.id, &mut self.store.raw, signer)?;
- self.cache
- .update(&self.store.as_ref().id(), &self.id, &patch)
- .map_err(|e| Error::CacheUpdate {
- id: self.id,
- err: e.into(),
- })?;
- self.patch = patch;
-
- Ok(commit)
- }
-
- /// Edit patch metadata.
- pub fn edit<G: Signer>(
- &mut self,
- title: String,
- target: MergeTarget,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Edit", signer, |tx| tx.edit(title, target))
- }
-
- /// Edit revision metadata.
- pub fn edit_revision<G: Signer>(
- &mut self,
- revision: RevisionId,
- description: String,
- embeds: impl IntoIterator<Item = Embed<Uri>>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Edit revision", signer, |tx| {
- tx.edit_revision(revision, description, embeds.into_iter().collect())
- })
- }
-
- /// Redact a revision.
- pub fn redact<G: Signer>(
- &mut self,
- revision: RevisionId,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Redact revision", signer, |tx| tx.redact(revision))
- }
-
- /// Create a thread on a patch revision.
- pub fn thread<G: Signer, S: ToString>(
- &mut self,
- revision: RevisionId,
- body: S,
- signer: &G,
- ) -> Result<CommentId, Error> {
- self.transaction("Create thread", signer, |tx| tx.thread(revision, body))
- }
-
- /// Comment on a patch revision.
- pub fn comment<G: Signer, S: ToString>(
- &mut self,
- revision: RevisionId,
- body: S,
- reply_to: Option<CommentId>,
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- embeds: impl IntoIterator<Item = Embed<Uri>>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Comment", signer, |tx| {
- tx.comment(
- revision,
- body,
- reply_to,
- location,
- embeds.into_iter().collect(),
- )
- })
- }
-
- /// React on a patch revision.
- pub fn react<G: Signer>(
- &mut self,
- revision: RevisionId,
- reaction: Reaction,
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- active: bool,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("React", signer, |tx| {
- tx.react(revision, reaction, location, active)
- })
- }
-
- /// Edit a comment on a patch revision.
- pub fn comment_edit<G: Signer, S: ToString>(
- &mut self,
- revision: RevisionId,
- comment: CommentId,
- body: S,
- embeds: impl IntoIterator<Item = Embed<Uri>>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Edit comment", signer, |tx| {
- tx.comment_edit(revision, comment, body, embeds.into_iter().collect())
- })
- }
-
- /// React to a comment on a patch revision.
- pub fn comment_react<G: Signer>(
- &mut self,
- revision: RevisionId,
- comment: CommentId,
- reaction: Reaction,
- active: bool,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("React comment", signer, |tx| {
- tx.comment_react(revision, comment, reaction, active)
- })
- }
-
- /// Redact a comment on a patch revision.
- pub fn comment_redact<G: Signer>(
- &mut self,
- revision: RevisionId,
- comment: CommentId,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Redact comment", signer, |tx| {
- tx.comment_redact(revision, comment)
- })
- }
-
- /// Comment on a line of code as part of a review.
- pub fn review_comment<G: Signer, S: ToString>(
- &mut self,
- review: ReviewId,
- body: S,
-- location: Option<CodeLocation>,
-+ location: Option<DiffLocation>,
- reply_to: Option<CommentId>,
- embeds: impl IntoIterator<Item = Embed<Uri>>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Review comment", signer, |tx| {
- tx.review_comment(
- review,
- body,
- location,
- reply_to,
- embeds.into_iter().collect(),
- )
- })
- }
-
- /// Edit review comment.
- pub fn edit_review_comment<G: Signer, S: ToString>(
- &mut self,
- review: ReviewId,
- comment: EntryId,
- body: S,
- embeds: impl IntoIterator<Item = Embed<Uri>>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Edit review comment", signer, |tx| {
- tx.edit_review_comment(review, comment, body, embeds.into_iter().collect())
- })
- }
-
- /// React to a review comment.
- pub fn react_review_comment<G: Signer>(
- &mut self,
- review: ReviewId,
- comment: EntryId,
- reaction: Reaction,
- active: bool,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("React to review comment", signer, |tx| {
- tx.react_review_comment(review, comment, reaction, active)
- })
- }
-
- /// React to a review comment.
- pub fn redact_review_comment<G: Signer>(
- &mut self,
- review: ReviewId,
- comment: EntryId,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Redact review comment", signer, |tx| {
- tx.redact_review_comment(review, comment)
- })
- }
-
- /// Review a patch revision.
- pub fn review<G: Signer>(
- &mut self,
- revision: RevisionId,
- verdict: Option<Verdict>,
- summary: Option<String>,
- labels: Vec<Label>,
- signer: &G,
- ) -> Result<ReviewId, Error> {
- if verdict.is_none() && summary.is_none() {
- return Err(Error::EmptyReview);
- }
- self.transaction("Review", signer, |tx| {
- tx.review(revision, verdict, summary, labels)
- })
- .map(ReviewId)
- }
-
- /// Edit a review.
- pub fn review_edit<G: Signer>(
- &mut self,
- review: ReviewId,
- verdict: Option<Verdict>,
- summary: Option<String>,
- labels: Vec<Label>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Edit review", signer, |tx| {
- tx.review_edit(review, verdict, summary, labels)
- })
- }
-
- /// Redact a patch review.
- pub fn redact_review<G: Signer>(
- &mut self,
- review: ReviewId,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Redact review", signer, |tx| tx.redact_review(review))
- }
-
- /// Resolve a patch review comment.
- pub fn resolve_review_comment<G: Signer>(
- &mut self,
- review: ReviewId,
- comment: CommentId,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Resolve review comment", signer, |tx| {
- tx.review_comment_resolve(review, comment)
- })
- }
-
- /// Unresolve a patch review comment.
- pub fn unresolve_review_comment<G: Signer>(
- &mut self,
- review: ReviewId,
- comment: CommentId,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Unresolve review comment", signer, |tx| {
- tx.review_comment_unresolve(review, comment)
- })
- }
-
- /// Merge a patch revision.
- pub fn merge<G: Signer>(
- &mut self,
- revision: RevisionId,
- commit: git::Oid,
- signer: &G,
- ) -> Result<Merged<R>, Error> {
- // TODO: Don't allow merging the same revision twice?
- let entry = self.transaction("Merge revision", signer, |tx| tx.merge(revision, commit))?;
-
- Ok(Merged {
- entry,
- patch: self.id,
- stored: self.store.as_ref(),
- })
- }
-
- /// Update a patch with a new revision.
- pub fn update<G: Signer>(
- &mut self,
- description: impl ToString,
- base: impl Into<git::Oid>,
- oid: impl Into<git::Oid>,
- signer: &G,
- ) -> Result<RevisionId, Error> {
- self.transaction("Add revision", signer, |tx| {
- tx.revision(description, base, oid)
- })
- .map(RevisionId)
- }
-
- /// Lifecycle a patch.
- pub fn lifecycle<G: Signer>(&mut self, state: Lifecycle, signer: &G) -> Result<EntryId, Error> {
- self.transaction("Lifecycle", signer, |tx| tx.lifecycle(state))
- }
-
- /// Assign a patch.
- pub fn assign<G: Signer>(
- &mut self,
- assignees: BTreeSet<Did>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Assign", signer, |tx| tx.assign(assignees))
- }
-
- /// Archive a patch.
- pub fn archive<G: Signer>(&mut self, signer: &G) -> Result<bool, Error> {
- self.lifecycle(Lifecycle::Archived, signer)?;
-
- Ok(true)
- }
-
- /// Mark an archived patch as ready to be reviewed again.
- /// Returns `false` if the patch was not archived.
- pub fn unarchive<G: Signer>(&mut self, signer: &G) -> Result<bool, Error> {
- if !self.is_archived() {
- return Ok(false);
- }
- self.lifecycle(Lifecycle::Open, signer)?;
-
- Ok(true)
- }
-
- /// Mark a patch as ready to be reviewed.
- /// Returns `false` if the patch was not a draft.
- pub fn ready<G: Signer>(&mut self, signer: &G) -> Result<bool, Error> {
- if !self.is_draft() {
- return Ok(false);
- }
- self.lifecycle(Lifecycle::Open, signer)?;
-
- Ok(true)
- }
-
- /// Mark an open patch as a draft.
- /// Returns `false` if the patch was not open and free of merges.
- pub fn unready<G: Signer>(&mut self, signer: &G) -> Result<bool, Error> {
- if !matches!(self.state(), State::Open { conflicts } if conflicts.is_empty()) {
- return Ok(false);
- }
- self.lifecycle(Lifecycle::Draft, signer)?;
-
- Ok(true)
- }
-
- /// Label a patch.
- pub fn label<G: Signer>(
- &mut self,
- labels: impl IntoIterator<Item = Label>,
- signer: &G,
- ) -> Result<EntryId, Error> {
- self.transaction("Label", signer, |tx| tx.label(labels))
- }
- }
-
- impl<R, C> Deref for PatchMut<'_, '_, R, C> {
- type Target = Patch;
-
- fn deref(&self) -> &Self::Target {
- &self.patch
- }
- }
-
- /// Detailed information on patch states
- #[derive(Debug, Default, PartialEq, Eq, Serialize)]
- #[serde(rename_all = "camelCase")]
- pub struct PatchCounts {
- pub open: usize,
- pub draft: usize,
- pub archived: usize,
- pub merged: usize,
- }
-
- impl PatchCounts {
- /// Total count.
- pub fn total(&self) -> usize {
- self.open + self.draft + self.archived + self.merged
- }
- }
-
- /// Result of looking up a `Patch`'s `Revision`.
- ///
- /// See [`Patches::find_by_revision`].
- #[derive(Debug, PartialEq, Eq)]
- pub struct ByRevision {
- pub id: PatchId,
- pub patch: Patch,
- pub revision_id: RevisionId,
- pub revision: Revision,
- }
-
- pub struct Patches<'a, R> {
- raw: store::Store<'a, Patch, R>,
- }
-
- impl<'a, R> Deref for Patches<'a, R> {
- type Target = store::Store<'a, Patch, R>;
-
- fn deref(&self) -> &Self::Target {
- &self.raw
- }
- }
-
- impl<R> HasRepoId for Patches<'_, R>
- where
- R: ReadRepository,
- {
- fn rid(&self) -> RepoId {
- self.as_ref().id()
- }
- }
-
- impl<'a, R> Patches<'a, R>
- where
- R: ReadRepository + cob::Store,
- {
- /// Open a patches store.
- pub fn open(repository: &'a R) -> Result<Self, RepositoryError> {
- let identity = repository.identity_head()?;
- let raw = store::Store::open(repository)?.identity(identity);
-
- Ok(Self { raw })
- }
-
- /// Patches count by state.
- pub fn counts(&self) -> Result<PatchCounts, store::Error> {
- let all = self.all()?;
- let state_groups =
- all.filter_map(|s| s.ok())
- .fold(PatchCounts::default(), |mut state, (_, p)| {
- match p.state() {
- State::Draft => state.draft += 1,
- State::Open { .. } => state.open += 1,
- State::Archived => state.archived += 1,
- State::Merged { .. } => state.merged += 1,
- }
- state
- });
-
- Ok(state_groups)
- }
-
- /// Find the `Patch` containing the given `Revision`.
- pub fn find_by_revision(&self, revision: &RevisionId) -> Result<Option<ByRevision>, Error> {
- // Revision may be the patch's first, making it have the same ID.
- let p_id = ObjectId::from(revision.into_inner());
- if let Some(p) = self.get(&p_id)? {
- return Ok(p.revision(revision).map(|r| ByRevision {
- id: p_id,
- patch: p.clone(),
- revision_id: *revision,
- revision: r.clone(),
- }));
- }
- let result = self
- .all()?
- .filter_map(|result| result.ok())
- .find_map(|(p_id, p)| {
- p.revision(revision).map(|r| ByRevision {
- id: p_id,
- patch: p.clone(),
- revision_id: *revision,
- revision: r.clone(),
- })
- });
-
- Ok(result)
- }
-
- /// Get a patch.
- pub fn get(&self, id: &ObjectId) -> Result<Option<Patch>, store::Error> {
- self.raw.get(id)
- }
-
- /// Get proposed patches.
- pub fn proposed(&self) -> Result<impl Iterator<Item = (PatchId, Patch)> + '_, Error> {
- let all = self.all()?;
-
- Ok(all
- .into_iter()
- .filter_map(|result| result.ok())
- .filter(|(_, p)| p.is_open()))
- }
-
- /// Get patches proposed by the given key.
- pub fn proposed_by<'b>(
- &'b self,
- who: &'b Did,
- ) -> Result<impl Iterator<Item = (PatchId, Patch)> + 'b, Error> {
- Ok(self
- .proposed()?
- .filter(move |(_, p)| p.author().id() == who))
- }
- }
-
- impl<'a, R> Patches<'a, R>
- where
- R: ReadRepository + SignRepository + cob::Store,
- {
- /// Open a new patch.
- pub fn create<'g, C, G>(
- &'g mut self,
- title: impl ToString,
- description: impl ToString,
- target: MergeTarget,
- base: impl Into<git::Oid>,
- oid: impl Into<git::Oid>,
- labels: &[Label],
- cache: &'g mut C,
- signer: &G,
- ) -> Result<PatchMut<'a, 'g, R, C>, Error>
- where
- C: cob::cache::Update<Patch>,
- G: Signer,
- {
- self._create(
- title,
- description,
- target,
- base,
- oid,
- labels,
- Lifecycle::default(),
- cache,
- signer,
- )
- }
-
- /// Draft a patch. This patch will be created in a [`State::Draft`] state.
- pub fn draft<'g, C, G: Signer>(
- &'g mut self,
- title: impl ToString,
- description: impl ToString,
- target: MergeTarget,
- base: impl Into<git::Oid>,
- oid: impl Into<git::Oid>,
- labels: &[Label],
- cache: &'g mut C,
- signer: &G,
- ) -> Result<PatchMut<'a, 'g, R, C>, Error>
- where
- C: cob::cache::Update<Patch>,
- {
- self._create(
- title,
- description,
- target,
- base,
- oid,
- labels,
- Lifecycle::Draft,
- cache,
- signer,
- )
- }
-
- /// Get a patch mutably.
- pub fn get_mut<'g, C>(
- &'g mut self,
- id: &ObjectId,
- cache: &'g mut C,
- ) -> Result<PatchMut<'a, 'g, R, C>, store::Error> {
- let patch = self
- .raw
- .get(id)?
- .ok_or_else(move || store::Error::NotFound(TYPENAME.clone(), *id))?;
-
- Ok(PatchMut {
- id: *id,
- patch,
- store: self,
- cache,
- })
- }
-
- /// Create a patch. This is an internal function used by `create` and `draft`.
- fn _create<'g, C, G: Signer>(
- &'g mut self,
- title: impl ToString,
- description: impl ToString,
- target: MergeTarget,
- base: impl Into<git::Oid>,
- oid: impl Into<git::Oid>,
- labels: &[Label],
- state: Lifecycle,
- cache: &'g mut C,
- signer: &G,
- ) -> Result<PatchMut<'a, 'g, R, C>, Error>
- where
- C: cob::cache::Update<Patch>,
- {
- let (id, patch) = Transaction::initial("Create patch", &mut self.raw, signer, |tx, _| {
- tx.revision(description, base, oid)?;
- tx.edit(title, target)?;
-
- if !labels.is_empty() {
- tx.label(labels.to_owned())?;
- }
- if state != Lifecycle::default() {
- tx.lifecycle(state)?;
- }
- Ok(())
- })?;
- cache
- .update(&self.raw.as_ref().id(), &id, &patch)
- .map_err(|e| Error::CacheUpdate { id, err: e.into() })?;
-
- Ok(PatchMut {
- id,
- patch,
- store: self,
- cache,
- })
- }
- }
-
- /// Models a comparison between two commit ranges,
- /// commonly obtained from two revisions (likely of the same patch).
- /// This can be used to generate a `git range-diff` command.
- /// See <https://git-scm.com/docs/git-range-diff>.
- #[derive(Debug, Clone, PartialEq, Eq, Copy)]
- pub struct RangeDiff {
- old: (git::Oid, git::Oid),
- new: (git::Oid, git::Oid),
- }
-
- impl RangeDiff {
- const COMMAND: &str = "git";
- const SUBCOMMAND: &str = "range-diff";
-
- pub fn new(old: &Revision, new: &Revision) -> Self {
- Self {
- old: old.range(),
- new: new.range(),
- }
- }
-
- pub fn to_command(&self) -> String {
- let range = if self.has_same_base() {
- format!("{} {} {}", self.old.0, self.old.1, self.new.1)
- } else {
- format!(
- "{}..{} {}..{}",
- self.old.0, self.old.1, self.new.0, self.new.1,
- )
- };
-
- Self::COMMAND.to_string() + " " + Self::SUBCOMMAND + " " + &range
- }
-
- fn has_same_base(&self) -> bool {
- self.old.0 == self.new.0
- }
- }
-
- impl From<RangeDiff> for std::process::Command {
- fn from(range_diff: RangeDiff) -> Self {
- let mut command = std::process::Command::new(RangeDiff::COMMAND);
-
- command.arg(RangeDiff::SUBCOMMAND);
-
- if range_diff.has_same_base() {
- command.args([
- range_diff.old.0.to_string(),
- range_diff.old.1.to_string(),
- range_diff.new.1.to_string(),
- ]);
- } else {
- command.args([
- format!("{}..{}", range_diff.old.0, range_diff.old.1),
- format!("{}..{}", range_diff.new.0, range_diff.new.1),
- ]);
- }
- command
- }
- }
-
- /// Helpers for de/serialization of patch data types.
- mod ser {
- use std::collections::{BTreeMap, BTreeSet};
-
- use serde::ser::SerializeSeq;
-
-- use crate::cob::{thread::Reactions, ActorId, CodeLocation};
-+ use crate::cob::{thread::Reactions, ActorId};
-+
-+ use super::CodeLocation;
-
- /// Serialize a `Revision`'s reaction as an object containing the
- /// `location`, `emoji`, and all `authors` that have performed the
- /// same reaction.
- #[derive(Debug, serde::Serialize, serde::Deserialize)]
- #[serde(rename_all = "camelCase")]
- struct Reaction {
- location: Option<CodeLocation>,
- emoji: super::Reaction,
- authors: Vec<ActorId>,
- }
-
- impl Reaction {
- fn as_revision_reactions(
- reactions: Vec<Reaction>,
- ) -> BTreeMap<Option<CodeLocation>, Reactions> {
- reactions.into_iter().fold(
- BTreeMap::<Option<CodeLocation>, Reactions>::new(),
- |mut reactions,
- Reaction {
- location,
- emoji,
- authors,
- }| {
- let mut inner = authors
- .into_iter()
- .map(|author| (author, emoji))
- .collect::<BTreeSet<_>>();
- let entry = reactions.entry(location).or_default();
- entry.append(&mut inner);
- reactions
- },
- )
- }
- }
-
- /// Helper to serialize a `Revision`'s reactions, since
- /// `CodeLocation` cannot be a key for a JSON object.
- ///
- /// The set `reactions` are first turned into a set of
- /// [`Reaction`]s and then serialized via a `Vec`.
- pub fn serialize_reactions<S>(
- reactions: &BTreeMap<Option<CodeLocation>, Reactions>,
- serializer: S,
- ) -> Result<S::Ok, S::Error>
- where
- S: serde::Serializer,
- {
- let reactions = reactions
- .iter()
- .flat_map(|(location, reaction)| {
- let reactions = reaction.iter().fold(
- BTreeMap::new(),
- |mut acc: BTreeMap<&super::Reaction, Vec<_>>, (author, emoji)| {
- acc.entry(emoji).or_default().push(*author);
- acc
- },
- );
- reactions
- .into_iter()
- .map(|(emoji, authors)| Reaction {
- location: location.clone(),
- emoji: *emoji,
- authors,
- })
- .collect::<Vec<_>>()
- })
- .collect::<Vec<_>>();
- let mut s = serializer.serialize_seq(Some(reactions.len()))?;
- for r in &reactions {
- s.serialize_element(r)?;
- }
- s.end()
- }
-
- /// Helper to deserialize a `Revision`'s reactions, the inverse of
- /// `serialize_reactions`.
- ///
- /// The `Vec` of [`Reaction`]s are deserialized and converted to a
- /// `BTreeMap<Option<CodeLocation>, Reactions>`.
- pub fn deserialize_reactions<'de, D>(
- deserializer: D,
- ) -> Result<BTreeMap<Option<CodeLocation>, Reactions>, D::Error>
- where
- D: serde::Deserializer<'de>,
- {
- struct ReactionsVisitor;
-
- impl<'de> serde::de::Visitor<'de> for ReactionsVisitor {
- type Value = Vec<Reaction>;
-
- fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
- formatter.write_str("a reaction of the form {'location', 'emoji', 'authors'}")
- }
-
- fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
- where
- A: serde::de::SeqAccess<'de>,
- {
- let mut reactions = Vec::new();
- while let Some(reaction) = seq.next_element()? {
- reactions.push(reaction);
- }
- Ok(reactions)
- }
- }
-
- let reactions = deserializer.deserialize_seq(ReactionsVisitor)?;
- Ok(Reaction::as_revision_reactions(reactions))
- }
- }
-
- #[cfg(test)]
- #[allow(clippy::unwrap_used)]
- mod test {
-- use std::path::PathBuf;
-+ use std::path::Path;
- use std::str::FromStr;
- use std::vec;
-
- use pretty_assertions::assert_eq;
-
- use super::*;
- use crate::cob::common::CodeRange;
- use crate::cob::test::Actor;
- use crate::crypto::test::signer::MockSigner;
- use crate::identity;
- use crate::patch::cache::Patches as _;
- use crate::profile::env;
- use crate::test;
- use crate::test::arbitrary;
- use crate::test::arbitrary::gen;
- use crate::test::storage::MockRepository;
-
-- use cob::migrate;
-+ use cob::{migrate, DiffLocation, HunkIndex};
-
- #[test]
- fn test_json_serialization() {
- let edit = Action::Label {
- labels: BTreeSet::new(),
- };
- assert_eq!(
- serde_json::to_string(&edit).unwrap(),
- String::from(r#"{"type":"label","labels":[]}"#)
- );
- }
-
- #[test]
- fn test_reactions_json_serialization() {
- #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
- #[serde(rename_all = "camelCase")]
- struct TestReactions {
- #[serde(
- serialize_with = "super::ser::serialize_reactions",
- deserialize_with = "super::ser::deserialize_reactions"
- )]
- inner: BTreeMap<Option<CodeLocation>, Reactions>,
- }
-
- let reactions = TestReactions {
- inner: [(
- None,
- [
- (
- "z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8"
- .parse()
- .unwrap(),
- Reaction::new('🚀').unwrap(),
- ),
- (
- "z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"
- .parse()
- .unwrap(),
- Reaction::new('🙏').unwrap(),
- ),
- ]
- .into_iter()
- .collect(),
- )]
- .into_iter()
- .collect(),
- };
-
- assert_eq!(
- reactions,
- serde_json::from_str(&serde_json::to_string(&reactions).unwrap()).unwrap()
- );
- }
-
- #[test]
- fn test_patch_create_and_get() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let author: Did = alice.signer.public_key().into();
- let target = MergeTarget::Delegates;
- let patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- target,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let patch_id = patch.id;
- let patch = patches.get(&patch_id).unwrap().unwrap();
-
- assert_eq!(patch.title(), "My first patch");
- assert_eq!(patch.description(), "Blah blah blah.");
- assert_eq!(patch.author().id(), &author);
- assert_eq!(patch.state(), &State::Open { conflicts: vec![] });
- assert_eq!(patch.target(), target);
- assert_eq!(patch.version(), 0);
-
- let (rev_id, revision) = patch.latest();
-
- assert_eq!(revision.author.id(), &author);
- assert_eq!(revision.description(), "Blah blah blah.");
- assert_eq!(revision.discussion.len(), 0);
- assert_eq!(revision.oid, branch.oid);
- assert_eq!(revision.base, branch.base);
-
- let ByRevision { id, .. } = patches.find_by_revision(&rev_id).unwrap().unwrap();
- assert_eq!(id, patch_id);
- }
-
- #[test]
- fn test_patch_discussion() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let id = patch.id;
- let mut patch = patches.get_mut(&id).unwrap();
- let (revision_id, _) = patch.revisions().last().unwrap();
- assert!(
- patch
- .comment(revision_id, "patch comment", None, None, [], &alice.signer)
- .is_ok(),
- "can comment on patch"
- );
-
- let (_, revision) = patch.revisions().last().unwrap();
- let (_, comment) = revision.discussion.first().unwrap();
- assert_eq!("patch comment", comment.body(), "comment body untouched");
- }
-
- #[test]
- fn test_patch_merge() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let id = patch.id;
- let (rid, _) = patch.revisions().next().unwrap();
- let _merge = patch.merge(rid, branch.base, &alice.signer).unwrap();
- let patch = patches.get(&id).unwrap().unwrap();
-
- let merges = patch.merges.iter().collect::<Vec<_>>();
- assert_eq!(merges.len(), 1);
-
- let (merger, merge) = merges.first().unwrap();
- assert_eq!(*merger, alice.signer.public_key());
- assert_eq!(merge.commit, branch.base);
- }
-
- #[test]
- fn test_patch_review() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let (revision_id, _) = patch.latest();
- let review_id = patch
- .review(
- revision_id,
- Some(Verdict::Accept),
- Some("LGTM".to_owned()),
- vec![],
- &alice.signer,
- )
- .unwrap();
-
- let id = patch.id;
- let mut patch = patches.get_mut(&id).unwrap();
- let (_, revision) = patch.latest();
- assert_eq!(revision.reviews.len(), 1);
-
- let review = revision.review_by(alice.signer.public_key()).unwrap();
- assert_eq!(review.verdict(), Some(Verdict::Accept));
- assert_eq!(review.summary(), Some("LGTM"));
-
- patch.redact_review(review_id, &alice.signer).unwrap();
- patch.reload().unwrap();
-
- let (_, revision) = patch.latest();
- assert_eq!(revision.reviews().count(), 0);
-
- // This is fine, redacting an already-redacted review is a no-op.
- patch.redact_review(review_id, &alice.signer).unwrap();
- // If the review never existed, it's an error.
- patch
- .redact_review(ReviewId(arbitrary::entry_id()), &alice.signer)
- .unwrap_err();
- }
-
- #[test]
- fn test_patch_review_revision_redact() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let update = checkout.branch_with([("README", b"Hello Radicle!")]);
- let updated = patch
- .update("I've made changes.", branch.base, update.oid, &alice.signer)
- .unwrap();
-
- // It's fine to redact a review from a redacted revision.
- let review = patch
- .review(updated, Some(Verdict::Accept), None, vec![], &alice.signer)
- .unwrap();
- patch.redact(updated, &alice.signer).unwrap();
- patch.redact_review(review, &alice.signer).unwrap();
- }
-
- #[test]
- fn test_revision_review_merge_redacted() {
- let base = git::Oid::from_str("cb18e95ada2bb38aadd8e6cef0963ce37a87add3").unwrap();
- let oid = git::Oid::from_str("518d5069f94c03427f694bb494ac1cd7d1339380").unwrap();
- let mut alice = Actor::new(MockSigner::default());
- let rid = gen::<RepoId>(1);
- let doc = RawDoc::new(
- gen::<Project>(1),
- vec![alice.did()],
- 1,
- identity::Visibility::Public,
- )
- .verified()
- .unwrap();
- let repo = MockRepository::new(rid, doc);
-
- let a1 = alice.op::<Patch>([
- Action::Revision {
- description: String::new(),
- base,
- oid,
- resolves: Default::default(),
- },
- Action::Edit {
- title: String::from("My patch"),
- target: MergeTarget::Delegates,
- },
- ]);
- let a2 = alice.op::<Patch>([Action::Revision {
- description: String::from("Second revision"),
- base,
- oid,
- resolves: Default::default(),
- }]);
- let a3 = alice.op::<Patch>([Action::RevisionRedact {
- revision: RevisionId(a2.id()),
- }]);
- let a4 = alice.op::<Patch>([Action::Review {
- revision: RevisionId(a2.id()),
- summary: None,
- verdict: Some(Verdict::Accept),
- labels: vec![],
- }]);
- let a5 = alice.op::<Patch>([Action::Merge {
- revision: RevisionId(a2.id()),
- commit: oid,
- }]);
-
- let mut patch = Patch::from_ops([a1, a2], &repo).unwrap();
- assert_eq!(patch.revisions().count(), 2);
-
- patch.op(a3, [], &repo).unwrap();
- assert_eq!(patch.revisions().count(), 1);
-
- patch.op(a4, [], &repo).unwrap();
- patch.op(a5, [], &repo).unwrap();
- }
-
- #[test]
- fn test_revision_edit_redact() {
- let base = arbitrary::oid();
- let oid = arbitrary::oid();
- let repo = gen::<MockRepository>(1);
- let time = env::local_time();
- let alice = MockSigner::default();
- let bob = MockSigner::default();
- let mut h0: cob::test::HistoryBuilder<Patch> = cob::test::history(
- &[
- Action::Revision {
- description: String::from("Original"),
- base,
- oid,
- resolves: Default::default(),
- },
- Action::Edit {
- title: String::from("Some patch"),
- target: MergeTarget::Delegates,
- },
- ],
- time.into(),
- &alice,
- );
- let r1 = h0.commit(
- &Action::Revision {
- description: String::from("New"),
- base,
- oid,
- resolves: Default::default(),
- },
- &alice,
- );
- let patch = Patch::from_history(&h0, &repo).unwrap();
- assert_eq!(patch.revisions().count(), 2);
-
- let mut h1 = h0.clone();
- h1.commit(
- &Action::RevisionRedact {
- revision: RevisionId(r1),
- },
- &alice,
- );
-
- let mut h2 = h0.clone();
- h2.commit(
- &Action::RevisionEdit {
- revision: RevisionId(*h0.root().id()),
- description: String::from("Edited"),
- embeds: Vec::default(),
- },
- &bob,
- );
-
- h0.merge(h1);
- h0.merge(h2);
-
- let patch = Patch::from_history(&h0, &repo).unwrap();
- assert_eq!(patch.revisions().count(), 1);
- }
-
- #[test]
- fn test_revision_reaction() {
- let base = git::Oid::from_str("cb18e95ada2bb38aadd8e6cef0963ce37a87add3").unwrap();
- let oid = git::Oid::from_str("518d5069f94c03427f694bb494ac1cd7d1339380").unwrap();
- let mut alice = Actor::new(MockSigner::default());
- let repo = gen::<MockRepository>(1);
- let reaction = Reaction::new('👍').expect("failed to create a reaction");
-
- let a1 = alice.op::<Patch>([
- Action::Revision {
- description: String::new(),
- base,
- oid,
- resolves: Default::default(),
- },
- Action::Edit {
- title: String::from("My patch"),
- target: MergeTarget::Delegates,
- },
- ]);
- let a2 = alice.op::<Patch>([Action::RevisionReact {
- revision: RevisionId(a1.id()),
- location: None,
- reaction,
- active: true,
- }]);
- let patch = Patch::from_ops([a1, a2], &repo).unwrap();
-
- let (_, r1) = patch.revisions().next().unwrap();
- assert!(!r1.reactions.is_empty());
-
- let mut reactions = r1.reactions.get(&None).unwrap().clone();
- assert!(!reactions.is_empty());
-
- let (_, first_reaction) = reactions.pop_first().unwrap();
- assert_eq!(first_reaction, reaction);
- }
-
- #[test]
- fn test_patch_review_edit() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let (rid, _) = patch.latest();
- let review = patch
- .review(
- rid,
- Some(Verdict::Accept),
- Some("LGTM".to_owned()),
- vec![],
- &alice.signer,
- )
- .unwrap();
- patch
- .review_edit(
- review,
- Some(Verdict::Reject),
- Some("Whoops!".to_owned()),
- vec![],
- &alice.signer,
- )
- .unwrap(); // Overwrite the comment.
-
- let (_, revision) = patch.latest();
- let review = revision.review_by(alice.signer.public_key()).unwrap();
- assert_eq!(review.verdict(), Some(Verdict::Reject));
- assert_eq!(review.summary(), Some("Whoops!"));
- }
-
- #[test]
- fn test_patch_review_duplicate() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let (rid, _) = patch.latest();
- patch
- .review(rid, Some(Verdict::Accept), None, vec![], &alice.signer)
- .unwrap();
- patch
- .review(rid, Some(Verdict::Reject), None, vec![], &alice.signer)
- .unwrap(); // This review is ignored, since there is already a review by this author.
-
- let (_, revision) = patch.latest();
- let review = revision.review_by(alice.signer.public_key()).unwrap();
- assert_eq!(review.verdict(), Some(Verdict::Accept));
- }
-
- #[test]
- fn test_patch_review_edit_comment() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let (rid, _) = patch.latest();
- let review = patch
- .review(rid, Some(Verdict::Accept), None, vec![], &alice.signer)
- .unwrap();
- patch
- .review_comment(review, "First comment!", None, None, [], &alice.signer)
- .unwrap();
-
- let _review = patch
- .review_edit(review, Some(Verdict::Reject), None, vec![], &alice.signer)
- .unwrap();
- patch
- .review_comment(review, "Second comment!", None, None, [], &alice.signer)
- .unwrap();
-
- let (_, revision) = patch.latest();
- let review = revision.review_by(alice.signer.public_key()).unwrap();
- assert_eq!(review.verdict(), Some(Verdict::Reject));
- assert_eq!(review.comments().count(), 2);
- assert_eq!(review.comments().nth(0).unwrap().1.body(), "First comment!");
- assert_eq!(
- review.comments().nth(1).unwrap().1.body(),
- "Second comment!"
- );
- }
-
- #[test]
- fn test_patch_review_comment() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let (rid, _) = patch.latest();
-- let location = CodeLocation {
-- commit: branch.oid,
-- path: PathBuf::from_str("README").unwrap(),
-- old: None,
-- new: Some(CodeRange::Lines { range: 5..8 }),
-+ let location = DiffLocation {
-+ base: *patch.base(),
-+ head: *patch.head(),
-+ path: Path::new("README").to_path_buf(),
-+ selection: Some(HunkIndex::new(1, CodeRange::lines(5..8))),
- };
- let review = patch
- .review(rid, Some(Verdict::Accept), None, vec![], &alice.signer)
- .unwrap();
- patch
- .review_comment(
- review,
- "I like these lines of code",
- Some(location.clone()),
- None,
- [],
- &alice.signer,
- )
- .unwrap();
-
- let (_, revision) = patch.latest();
- let review = revision.review_by(alice.signer.public_key()).unwrap();
- let (_, comment) = review.comments().next().unwrap();
-
- assert_eq!(comment.body(), "I like these lines of code");
-- assert_eq!(comment.location(), Some(&location));
-+ assert_eq!(comment.location(), Some(&location.into()));
- }
-
- #[test]
- fn test_patch_review_remove_summary() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = Cache::no_cache(&*alice.repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- let (rid, _) = patch.latest();
- let review = patch
- .review(
- rid,
- Some(Verdict::Accept),
- Some("Nah".to_owned()),
- vec![],
- &alice.signer,
- )
- .unwrap();
- patch
- .review_edit(review, Some(Verdict::Accept), None, vec![], &alice.signer)
- .unwrap();
-
- let id = patch.id;
- let patch = patches.get_mut(&id).unwrap();
- let (_, revision) = patch.latest();
- let review = revision.review_by(alice.signer.public_key()).unwrap();
-
- assert_eq!(review.verdict(), Some(Verdict::Accept));
- assert_eq!(review.summary(), None);
- }
-
- #[test]
- fn test_patch_update() {
- let alice = test::setup::NodeWithRepo::default();
- let checkout = alice.repo.checkout();
- let branch = checkout.branch_with([("README", b"Hello World!")]);
- let mut patches = {
- let path = alice.tmp.path().join("cobs.db");
- let mut db = cob::cache::Store::open(path).unwrap();
- let store = cob::patch::Patches::open(&*alice.repo).unwrap();
-
- db.migrate(migrate::ignore).unwrap();
- cob::patch::Cache::open(store, db)
- };
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
-
- assert_eq!(patch.description(), "Blah blah blah.");
- assert_eq!(patch.version(), 0);
-
- let update = checkout.branch_with([("README", b"Hello Radicle!")]);
- let _ = patch
- .update("I've made changes.", branch.base, update.oid, &alice.signer)
- .unwrap();
-
- let id = patch.id;
- let patch = patches.get(&id).unwrap().unwrap();
- assert_eq!(patch.version(), 1);
- assert_eq!(patch.revisions.len(), 2);
- assert_eq!(patch.revisions().count(), 2);
- assert_eq!(
- patch.revisions().nth(0).unwrap().1.description(),
- "Blah blah blah."
- );
- assert_eq!(
- patch.revisions().nth(1).unwrap().1.description(),
- "I've made changes."
- );
-
- let (_, revision) = patch.latest();
-
- assert_eq!(patch.version(), 1);
- assert_eq!(revision.oid, update.oid);
- assert_eq!(revision.description(), "I've made changes.");
- }
-
- #[test]
- fn test_patch_redact() {
- let alice = test::setup::Node::default();
- let repo = alice.project();
- let branch = repo
- .checkout()
- .branch_with([("README.md", b"Hello, World!")]);
- let mut patches = Cache::no_cache(&*repo).unwrap();
- let mut patch = patches
- .create(
- "My first patch",
- "Blah blah blah.",
- MergeTarget::Delegates,
- branch.base,
- branch.oid,
- &[],
- &alice.signer,
- )
- .unwrap();
- let patch_id = patch.id;
-
- let update = repo
- .checkout()
- .branch_with([("README.md", b"Hello, Radicle!")]);
- let revision_id = patch
- .update("I've made changes.", branch.base, update.oid, &alice.signer)
- .unwrap();
- assert_eq!(patch.revisions().count(), 2);
-
- patch.redact(revision_id, &alice.signer).unwrap();
- assert_eq!(patch.latest().0, RevisionId(*patch_id));
- assert_eq!(patch.revisions().count(), 1);
-
- // The patch's root must always exist.
- assert_eq!(patch.latest(), patch.root());
- assert!(patch.redact(patch.latest().0, &alice.signer).is_err());
- }
-
- #[test]
- fn test_json() {
- use serde_json::json;
-
- assert_eq!(
- serde_json::to_value(Action::Lifecycle {
- state: Lifecycle::Draft
- })
- .unwrap(),
- json!({
- "type": "lifecycle",
- "state": { "status": "draft" }
- })
- );
-
- let revision = RevisionId(arbitrary::entry_id());
- assert_eq!(
- serde_json::to_value(Action::Review {
- revision,
- summary: None,
- verdict: None,
- labels: vec![],
- })
- .unwrap(),
- json!({
- "type": "review",
- "revision": revision,
- })
- );
-
- assert_eq!(
- serde_json::to_value(CodeRange::Lines { range: 4..8 }).unwrap(),
- json!({
- "type": "lines",
- "range": { "start": 4, "end": 8 },
- })
- );
- }
- }
->>>>>>> Conflict 1 of 1 ends
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny warnings cargo build --all-targets --workspace cargo doc --workspace --no-deps cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name e55d28f4-5318-4922-808d-c3044aaf4bd5 -v /opt/radcis/ci.rad.levitte.org/cci/state/e55d28f4-5318-4922-808d-c3044aaf4bd5/s:/e55d28f4-5318-4922-808d-c3044aaf4bd5/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/e55d28f4-5318-4922-808d-c3044aaf4bd5/w:/e55d28f4-5318-4922-808d-c3044aaf4bd5/w -w /e55d28f4-5318-4922-808d-c3044aaf4bd5/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:bookworm bash /e55d28f4-5318-4922-808d-c3044aaf4bd5/s/script.sh
+ cargo --version
info: syncing channel updates for '1.85-x86_64-unknown-linux-gnu'
info: latest update on 2025-03-18, rust version 1.85.1 (4eb161250 2025-03-15)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-src'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
cargo 1.85.1 (d73d2caf9 2024-12-31)
+ rustc --version
rustc 1.85.1 (4eb161250 2025-03-15)
+ cargo fmt --check
+ cargo clippy --all-targets --workspace -- --deny warnings
Updating crates.io index
Downloading crates ...
Downloaded emojis v0.6.4
Downloaded schemars_derive v1.0.4
Downloaded aead v0.5.2
Downloaded pem-rfc7468 v0.7.0
Downloaded aes v0.8.4
Downloaded sem_safe v0.2.0
Downloaded pkcs1 v0.7.5
Downloaded blowfish v0.9.1
Downloaded chrono v0.4.38
Downloaded same-file v1.0.6
Downloaded ryu v1.0.17
Downloaded zerofrom v0.1.6
Downloaded parking_lot v0.12.3
Downloaded gix-refspec v0.27.0
Downloaded fluent-uri v0.3.2
Downloaded radicle-git-ext v0.8.1
Downloaded proc-macro-error v1.0.4
Downloaded qcheck-macros v1.0.0
Downloaded serde_derive_internals v0.29.1
Downloaded phf v0.11.3
Downloaded qcheck v1.0.0
Downloaded inout v0.1.3
Downloaded cyphernet v0.5.2
Downloaded pkg-config v0.3.30
Downloaded log v0.4.27
Downloaded timeago v0.4.2
Downloaded shlex v1.3.0
Downloaded miniz_oxide v0.8.8
Downloaded netservices v0.8.0
Downloaded multibase v0.9.1
Downloaded tree-sitter-language v0.1.2
Downloaded jsonschema v0.30.0
Downloaded tree-sitter-html v0.23.2
Downloaded zerovec-derive v0.10.3
Downloaded gix-prompt v0.9.1
Downloaded zerofrom-derive v0.1.6
Downloaded zerovec v0.10.4
Downloaded gix-protocol v0.47.0
Downloaded gix-ref v0.49.1
Downloaded idna_adapter v1.2.0
Downloaded num-iter v0.1.45
Downloaded num-rational v0.4.2
Downloaded once_cell v1.21.3
Downloaded num-integer v0.1.46
Downloaded gix-tempfile v15.0.0
Downloaded gix-revwalk v0.17.0
Downloaded gix-sec v0.10.12
Downloaded gix-revision v0.31.1
Downloaded unicode-display-width v0.3.0
Downloaded unicode-ident v1.0.12
Downloaded memmap2 v0.9.4
Downloaded typenum v1.17.0
Downloaded gix-hashtable v0.6.0
Downloaded gix-fs v0.12.1
Downloaded litemap v0.7.5
Downloaded write16 v1.0.0
Downloaded newline-converter v0.3.0
Downloaded spin v0.9.8
Downloaded vsimd v0.8.0
Downloaded litrs v0.4.1
Downloaded git-ref-format-macro v0.3.1
Downloaded normalize-line-endings v0.3.0
Downloaded utf16_iter v1.0.5
Downloaded writeable v0.5.5
Downloaded group v0.13.0
Downloaded home v0.5.9
Downloaded gix-validate v0.9.4
Downloaded icu_locid_transform_data v1.5.1
Downloaded iana-time-zone v0.1.60
Downloaded snapbox v0.4.17
Downloaded icu_collections v1.5.0
Downloaded unicode-segmentation v1.11.0
Downloaded url v2.5.4
Downloaded io-reactor v0.5.2
Downloaded walkdir v2.5.0
Downloaded serde_derive v1.0.219
Downloaded gix-url v0.28.2
Downloaded gix-transport v0.44.0
Downloaded icu_properties_data v1.5.1
Downloaded rand v0.8.5
Downloaded hmac v0.12.1
Downloaded prodash v29.0.2
Downloaded indexmap v2.2.6
Downloaded serde_json v1.0.140
Downloaded serde v1.0.219
Downloaded vcpkg v0.2.15
Downloaded memchr v2.7.2
Downloaded unicode-normalization v0.1.23
Downloaded hashbrown v0.14.3
Downloaded winnow v0.6.26
Downloaded tree-sitter v0.24.4
Downloaded syn v1.0.109
Downloaded git2 v0.19.0
Downloaded tree-sitter-c v0.23.2
Downloaded syn v2.0.89
Downloaded tree-sitter-typescript v0.23.2
Downloaded tree-sitter-python v0.23.4
Downloaded inquire v0.7.5
Downloaded tree-sitter-rust v0.23.2
Downloaded rustix v1.0.7
Downloaded rustix v0.38.34
Downloaded regex-syntax v0.8.5
Downloaded ssh-key v0.6.6
Downloaded radicle-surf v0.22.0
Downloaded socket2 v0.5.7
Downloaded similar v2.5.0
Downloaded tree-sitter-bash v0.23.3
Downloaded tree-sitter-ruby v0.23.1
Downloaded icu_properties v1.5.1
Downloaded icu_normalizer_data v1.5.1
Downloaded lexopt v0.3.0
Downloaded git-ref-format-core v0.3.1
Downloaded icu_locid v1.5.0
Downloaded icu_provider v1.5.0
Downloaded jiff v0.2.1
Downloaded gix-hash v0.15.1
Downloaded gix-chunk v0.4.11
Downloaded gix-actor v0.33.2
Downloaded yoke-derive v0.7.5
Downloaded yoke v0.7.5
Downloaded xattr v1.3.1
Downloaded libz-sys v1.1.16
Downloaded sha3 v0.10.8
Downloaded utf8_iter v1.0.4
Downloaded unicode-width v0.1.11
Downloaded libc v0.2.174
Downloaded nonempty v0.9.0
Downloaded maybe-async v0.2.10
Downloaded lock_api v0.4.11
Downloaded gix-utils v0.1.14
Downloaded gix-lock v15.0.1
Downloaded yansi v0.5.1
Downloaded noise-framework v0.4.0
Downloaded icu_locid_transform v1.5.0
Downloaded gix-traverse v0.43.1
Downloaded gix-trace v0.1.12
Downloaded universal-hash v0.5.1
Downloaded num v0.4.3
Downloaded uuid v1.16.0
Downloaded jobserver v0.1.31
Downloaded lazy_static v1.5.0
Downloaded linux-raw-sys v0.4.13
Downloaded keccak v0.1.5
Downloaded icu_normalizer v1.5.0
Downloaded signals_receipts v0.2.0
Downloaded libm v0.2.8
Downloaded signal-hook v0.3.18
Downloaded version_check v0.9.4
Downloaded utf8parse v0.2.1
Downloaded smallvec v1.13.2
Downloaded nonempty v0.5.0
Downloaded localtime v1.3.1
Downloaded uuid-simd v0.8.0
Downloaded gix-diff v0.49.0
Downloaded gix-credentials v0.26.0
Downloaded gix-date v0.9.4
Downloaded gix-config-value v0.14.12
Downloaded gix-features v0.39.1
Downloaded gix-commitgraph v0.25.1
Downloaded gix-command v0.4.1
Downloaded num-bigint v0.4.6
Downloaded opaque-debug v0.3.1
Downloaded itoa v1.0.11
Downloaded tree-sitter-toml-ng v0.6.0
Downloaded gix-odb v0.66.0
Downloaded typeid v1.0.3
Downloaded gix-shallow v0.1.0
Downloaded gix-object v0.46.1
Downloaded gix-negotiate v0.17.0
Downloaded tinystr v0.7.6
Downloaded siphasher v0.3.11
Downloaded scrypt v0.11.0
Downloaded thiserror v1.0.69
Downloaded streaming-iterator v0.1.9
Downloaded outref v0.5.2
Downloaded num-bigint-dig v0.8.4
Downloaded stable_deref_trait v1.2.0
Downloaded signal-hook-registry v1.4.5
Downloaded sha2 v0.10.8
Downloaded libgit2-sys v0.17.0+1.8.1
Downloaded sha1_smol v1.0.0
Downloaded serde-untagged v0.1.7
Downloaded idna v1.0.3
Downloaded sqlite v0.32.0
Downloaded linux-raw-sys v0.9.4
Downloaded signature v2.2.0
Downloaded num-traits v0.2.19
Downloaded num-complex v0.4.6
Downloaded tempfile v3.10.1
Downloaded sqlite3-sys v0.15.2
Downloaded num-cmp v0.1.0
Downloaded icu_provider_macros v1.5.0
Downloaded referencing v0.30.0
Downloaded tar v0.4.40
Downloaded synstructure v0.13.1
Downloaded ssh-encoding v0.2.0
Downloaded spki v0.7.3
Downloaded signature v1.6.4
Downloaded sec1 v0.7.3
Downloaded scopeguard v1.2.0
Downloaded gix-quote v0.4.15
Downloaded gix-path v0.10.15
Downloaded gix-packetline v0.18.4
Downloaded gix-pack v0.56.0
Downloaded zerocopy v0.7.35
Downloaded tree-sitter-md v0.3.2
Downloaded tinyvec v1.6.0
Downloaded shell-words v1.1.0
Downloaded thiserror-impl v2.0.12
Downloaded socks5-client v0.4.1
Downloaded snapbox-macros v0.3.8
Downloaded signal-hook-mio v0.2.4
Downloaded rsa v0.9.6
Downloaded tinyvec_macros v0.1.1
Downloaded thiserror v2.0.12
Downloaded schemars v1.0.4
Downloaded zeroize v1.7.0
Downloaded tree-sitter-highlight v0.24.4
Downloaded tree-sitter-go v0.23.4
Downloaded rfc6979 v0.4.0
Downloaded ref-cast-impl v1.0.24
Downloaded quote v1.0.36
Downloaded siphasher v1.0.1
Downloaded rand_core v0.6.4
Downloaded tree-sitter-json v0.24.8
Downloaded sqlite3-src v0.5.1
Downloaded tree-sitter-css v0.23.1
Downloaded mio v1.0.4
Downloaded ssh-cipher v0.2.0
Downloaded mio v0.8.11
Downloaded thiserror-impl v1.0.69
Downloaded subtle v2.5.0
Downloaded rand_chacha v0.3.1
Downloaded regex v1.11.1
Downloaded flate2 v1.1.1
Downloaded bit-vec v0.8.0
Downloaded fraction v0.15.3
Downloaded fancy-regex v0.14.0
Downloaded elliptic-curve v0.13.8
Downloaded derive_more-impl v2.0.1
Downloaded polyval v0.6.2
Downloaded fastrand v2.1.0
Downloaded escargot v0.5.10
Downloaded errno v0.3.13
Downloaded ecdsa v0.16.9
Downloaded ec25519 v0.1.0
Downloaded data-encoding v2.5.0
Downloaded convert_case v0.7.1
Downloaded pretty_assertions v1.4.0
Downloaded ppv-lite86 v0.2.17
Downloaded popol v3.0.0
Downloaded percent-encoding v2.3.1
Downloaded generic-array v0.14.7
Downloaded fxhash v0.2.1
Downloaded filetime v0.2.23
Downloaded ff v0.13.0
Downloaded erased-serde v0.4.6
Downloaded poly1305 v0.8.0
Downloaded p384 v0.13.0
Downloaded ghash v0.5.1
Downloaded form_urlencoded v1.2.1
Downloaded digest v0.10.7
Downloaded data-encoding-macro v0.1.14
Downloaded crypto-common v0.1.6
Downloaded crossterm v0.29.0
Downloaded colorchoice v1.0.0
Downloaded bitflags v2.9.1
Downloaded bitflags v1.3.2
Downloaded phf_shared v0.11.3
Downloaded faster-hex v0.9.0
Downloaded equivalent v1.0.1
Downloaded derive_more v2.0.1
Downloaded der v0.7.9
Downloaded ctr v0.9.2
Downloaded crypto-bigint v0.5.5
Downloaded displaydoc v0.2.5
Downloaded diff v0.1.13
Downloaded crossbeam-utils v0.8.19
Downloaded const-oid v0.9.6
Downloaded fast-glob v0.3.3
Downloaded email_address v0.2.9
Downloaded ed25519 v1.5.3
Downloaded cpufeatures v0.2.12
Downloaded colored v2.1.0
Downloaded block-padding v0.3.3
Downloaded bit-set v0.8.0
Downloaded getrandom v0.2.15
Downloaded document-features v0.2.11
Downloaded data-encoding-macro-internal v0.1.12
Downloaded cyphergraphy v0.3.0
Downloaded cipher v0.4.4
Downloaded bytesize v2.0.1
Downloaded bloomy v1.2.0
Downloaded salsa20 v0.10.2
Downloaded radicle-std-ext v0.1.0
Downloaded proc-macro2 v1.0.92
Downloaded pkcs8 v0.10.2
Downloaded either v1.11.0
Downloaded dyn-clone v1.0.17
Downloaded cypheraddr v0.4.0
Downloaded ct-codecs v1.1.1
Downloaded crc32fast v1.4.0
Downloaded cfg-if v1.0.0
Downloaded block-buffer v0.10.4
Downloaded proc-macro-error-attr v1.0.4
Downloaded primeorder v0.13.6
Downloaded pbkdf2 v0.12.2
Downloaded parking_lot_core v0.9.9
Downloaded p521 v0.13.3
Downloaded crossbeam-channel v0.5.15
Downloaded chacha20poly1305 v0.10.1
Downloaded chacha20 v0.9.1
Downloaded cbc v0.1.2
Downloaded base64 v0.22.1
Downloaded anstyle-query v1.0.2
Downloaded aho-corasick v1.1.3
Downloaded ahash v0.8.11
Downloaded regex-automata v0.4.9
Downloaded ref-cast v1.0.24
Downloaded git-ref-format v0.3.1
Downloaded crossterm v0.25.0
Downloaded bstr v1.9.1
Downloaded amplify_syn v2.0.1
Downloaded cc v1.2.2
Downloaded base64 v0.13.1
Downloaded arc-swap v1.7.1
Downloaded anyhow v1.0.82
Downloaded anstyle-parse v0.2.3
Downloaded anstyle v1.0.6
Downloaded aes-gcm v0.10.3
Downloaded base64ct v1.6.0
Downloaded base64 v0.21.7
Downloaded base32 v0.4.0
Downloaded base-x v0.2.11
Downloaded amplify_derive v4.0.0
Downloaded p256 v0.13.2
Downloaded bytes v1.10.1
Downloaded byteorder v1.5.0
Downloaded bytecount v0.6.8
Downloaded borrow-or-share v0.2.2
Downloaded bcrypt-pbkdf v0.10.0
Downloaded autocfg v1.2.0
Downloaded ascii v1.1.0
Downloaded base16ct v0.2.0
Downloaded anstream v0.6.13
Downloaded amplify_num v0.5.2
Downloaded amplify v4.6.0
Downloaded adler2 v2.0.0
Compiling libc v0.2.174
Compiling proc-macro2 v1.0.92
Compiling unicode-ident v1.0.12
Checking cfg-if v1.0.0
Compiling shlex v1.3.0
Compiling version_check v0.9.4
Compiling serde v1.0.219
Checking memchr v2.7.2
Compiling quote v1.0.36
Compiling autocfg v1.2.0
Checking getrandom v0.2.15
Compiling syn v2.0.89
Checking smallvec v1.13.2
Compiling jobserver v0.1.31
Checking aho-corasick v1.1.3
Checking regex-syntax v0.8.5
Compiling cc v1.2.2
Compiling typenum v1.17.0
Checking regex-automata v0.4.9
Compiling generic-array v0.14.7
Checking rand_core v0.6.4
Checking log v0.4.27
Checking fastrand v2.1.0
Compiling synstructure v0.13.1
Checking crypto-common v0.1.6
Compiling lock_api v0.4.11
Compiling parking_lot_core v0.9.9
Checking bstr v1.9.1
Checking bitflags v2.9.1
Checking scopeguard v1.2.0
Checking stable_deref_trait v1.2.0
Checking subtle v2.5.0
Checking parking_lot v0.12.3
Compiling syn v1.0.109
Checking tinyvec_macros v0.1.1
Compiling serde_derive v1.0.219
Compiling zerofrom-derive v0.1.6
Compiling yoke-derive v0.7.5
Compiling zerovec-derive v0.10.3
Checking once_cell v1.21.3
Checking zerofrom v0.1.6
Checking tinyvec v1.6.0
Compiling displaydoc v0.2.5
Checking yoke v0.7.5
Checking zerovec v0.10.4
Checking zeroize v1.7.0
Checking unicode-normalization v0.1.23
Checking cpufeatures v0.2.12
Checking tinystr v0.7.6
Checking litemap v0.7.5
Checking writeable v0.5.5
Compiling thiserror v2.0.12
Compiling icu_locid_transform_data v1.5.1
Compiling crc32fast v1.4.0
Checking icu_locid v1.5.0
Compiling thiserror-impl v2.0.12
Compiling icu_provider_macros v1.5.0
Checking block-padding v0.3.3
Compiling icu_properties_data v1.5.1
Checking inout v0.1.3
Checking icu_provider v1.5.0
Checking block-buffer v0.10.4
Checking itoa v1.0.11
Checking hashbrown v0.14.3
Compiling icu_normalizer_data v1.5.1
Compiling pkg-config v0.3.30
Checking digest v0.10.7
Checking icu_locid_transform v1.5.0
Checking cipher v0.4.4
Checking icu_collections v1.5.0
Compiling thiserror v1.0.69
Checking utf8_iter v1.0.4
Checking write16 v1.0.0
Checking icu_properties v1.5.1
Checking utf16_iter v1.0.5
Compiling thiserror-impl v1.0.69
Checking percent-encoding v2.3.1
Compiling rustix v0.38.34
Checking linux-raw-sys v0.4.13
Checking sha2 v0.10.8
Checking form_urlencoded v1.2.1
Checking universal-hash v0.5.1
Checking opaque-debug v0.3.1
Checking icu_normalizer v1.5.0
Compiling vcpkg v0.2.15
Compiling amplify_syn v2.0.1
Checking idna_adapter v1.2.0
Checking idna v1.0.3
Compiling libz-sys v1.1.16
Checking gix-trace v0.1.12
Checking url v2.5.4
Compiling data-encoding v2.5.0
Checking tempfile v3.10.1
Compiling amplify_derive v4.0.0
Checking amplify_num v0.5.2
Compiling data-encoding-macro-internal v0.1.12
Checking signature v1.6.4
Checking ascii v1.1.0
Checking ed25519 v1.5.3
Checking data-encoding-macro v0.1.14
Compiling libgit2-sys v0.17.0+1.8.1
Checking faster-hex v0.9.0
Checking aead v0.5.2
Compiling num-traits v0.2.19
Compiling proc-macro-error-attr v1.0.4
Checking byteorder v1.5.0
Checking base-x v0.2.11
Checking ct-codecs v1.1.1
Checking multibase v0.9.1
Checking ec25519 v0.1.0
Checking amplify v4.6.0
Checking poly1305 v0.8.0
Checking chacha20 v0.9.1
Checking gix-utils v0.1.14
Compiling proc-macro-error v1.0.4
Checking adler2 v2.0.0
Checking cyphergraphy v0.3.0
Checking miniz_oxide v0.8.8
Checking gix-hash v0.15.1
Checking keccak v0.1.5
Compiling crossbeam-utils v0.8.19
Checking same-file v1.0.6
Checking sha3 v0.10.8
Checking walkdir v2.5.0
Checking flate2 v1.1.1
Compiling git-ref-format-core v0.3.1
Checking polyval v0.6.2
Compiling sqlite3-src v0.5.1
Checking hmac v0.12.1
Checking prodash v29.0.2
Checking base64ct v1.6.0
Checking base32 v0.4.0
Checking equivalent v1.0.1
Checking ppv-lite86 v0.2.17
Checking sha1_smol v1.0.0
Compiling serde_json v1.0.140
Checking gix-features v0.39.1
Checking pem-rfc7468 v0.7.0
Checking rand_chacha v0.3.1
Checking indexmap v2.2.6
Checking cypheraddr v0.4.0
Checking pbkdf2 v0.12.2
Checking ghash v0.5.1
Compiling git-ref-format-macro v0.3.1
Checking chacha20poly1305 v0.10.1
Checking aes v0.8.4
Checking ctr v0.9.2
Checking ryu v1.0.17
Checking aes-gcm v0.10.3
Checking git-ref-format v0.3.1
Checking noise-framework v0.4.0
Checking crossbeam-channel v0.5.15
Checking socks5-client v0.4.1
Checking rand v0.8.5
Checking ssh-encoding v0.2.0
Checking blowfish v0.9.1
Checking cbc v0.1.2
Checking radicle-std-ext v0.1.0
Checking home v0.5.9
Compiling ref-cast v1.0.24
Checking gix-path v0.10.15
Checking ssh-cipher v0.2.0
Checking bcrypt-pbkdf v0.10.0
Checking cyphernet v0.5.2
Compiling ref-cast-impl v1.0.24
Checking signature v2.2.0
Checking ssh-key v0.6.6
Checking qcheck v1.0.0
Checking radicle-ssh v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-ssh)
Compiling typeid v1.0.3
Checking lazy_static v1.5.0
Checking dyn-clone v1.0.17
Checking siphasher v1.0.1
Checking nonempty v0.9.0
Checking radicle-dag v0.10.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-dag)
Compiling serde_derive_internals v0.29.1
Checking erased-serde v0.4.6
Checking jiff v0.2.1
Compiling schemars_derive v1.0.4
Checking iana-time-zone v0.1.60
Checking chrono v0.4.38
Checking gix-date v0.9.4
Checking schemars v1.0.4
Checking serde-untagged v0.1.7
Checking colored v2.1.0
Checking localtime v1.3.1
Checking bytesize v2.0.1
Checking winnow v0.6.26
Checking tree-sitter-language v0.1.2
Checking fast-glob v0.3.3
Checking base64 v0.21.7
Checking gix-hashtable v0.6.0
Checking gix-validate v0.9.4
Checking memmap2 v0.9.4
Compiling anyhow v1.0.82
Checking gix-actor v0.33.2
Checking gix-chunk v0.4.11
Checking gix-object v0.46.1
Checking anstyle-query v1.0.2
Checking gix-commitgraph v0.25.1
Checking gix-fs v0.12.1
Checking errno v0.3.13
Checking gix-revwalk v0.17.0
Checking sem_safe v0.2.0
Checking signals_receipts v0.2.0
Checking gix-tempfile v15.0.0
Compiling signal-hook v0.3.18
Checking signal-hook-registry v1.4.5
Checking shell-words v1.1.0
Checking gix-command v0.4.1
Checking radicle-signals v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-signals)
Checking mio v1.0.4
Checking mio v0.8.11
Compiling tree-sitter v0.24.4
Compiling unicode-segmentation v1.11.0
Compiling convert_case v0.7.1
Checking signal-hook-mio v0.2.4
Checking gix-lock v15.0.1
Checking gix-config-value v0.14.12
Checking gix-url v0.28.2
Checking gix-quote v0.4.15
Checking gix-sec v0.10.12
Checking regex v1.11.1
Compiling rustix v1.0.7
Checking gix-prompt v0.9.1
Compiling derive_more-impl v2.0.1
Compiling xattr v1.3.1
Compiling filetime v0.2.23
Checking gix-traverse v0.43.1
Checking gix-revision v0.31.1
Checking sqlite3-sys v0.15.2
Checking sqlite v0.32.0
Checking gix-diff v0.49.0
Checking gix-packetline v0.18.4
Checking lexopt v0.3.0
Checking utf8parse v0.2.1
Checking linux-raw-sys v0.9.4
Checking bitflags v1.3.2
Compiling litrs v0.4.1
Checking crossterm v0.25.0
Checking anstyle-parse v0.2.3
Compiling document-features v0.2.11
Checking gix-transport v0.44.0
Checking gix-pack v0.56.0
Checking gix-refspec v0.27.0
Checking derive_more v2.0.1
Compiling tar v0.4.40
Checking gix-credentials v0.26.0
Checking newline-converter v0.3.0
Checking gix-shallow v0.1.0
Checking gix-ref v0.49.1
Checking gix-negotiate v0.17.0
Checking fxhash v0.2.1
Compiling maybe-async v0.2.10
Checking streaming-iterator v0.1.9
Checking colorchoice v1.0.0
Checking unicode-width v0.1.11
Checking anstyle v1.0.6
Checking arc-swap v1.7.1
Checking anstream v0.6.13
Checking gix-odb v0.66.0
Checking inquire v0.7.5
Checking gix-protocol v0.47.0
Compiling radicle-surf v0.22.0
Checking crossterm v0.29.0
Checking unicode-display-width v0.3.0
Compiling tree-sitter-typescript v0.23.2
Compiling tree-sitter-go v0.23.4
Compiling tree-sitter-ruby v0.23.1
Compiling tree-sitter-html v0.23.2
Compiling tree-sitter-toml-ng v0.6.0
Compiling tree-sitter-c v0.23.2
Compiling tree-sitter-rust v0.23.2
Compiling tree-sitter-json v0.24.8
Compiling tree-sitter-css v0.23.1
Compiling tree-sitter-md v0.3.2
Compiling tree-sitter-python v0.23.4
Compiling tree-sitter-bash v0.23.3
Checking either v1.11.0
Checking snapbox-macros v0.3.8
Checking salsa20 v0.10.2
Checking base64 v0.13.1
Checking siphasher v0.3.11
Compiling radicle-cli v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli)
Checking normalize-line-endings v0.3.0
Checking similar v2.5.0
Checking nonempty v0.5.0
Checking bloomy v1.2.0
Checking snapbox v0.4.17
Checking scrypt v0.11.0
Checking tree-sitter-highlight v0.24.4
Checking popol v3.0.0
Checking bytes v1.10.1
Checking timeago v0.4.2
Checking io-reactor v0.5.2
Checking socket2 v0.5.7
Checking diff v0.1.13
Checking yansi v0.5.1
Compiling radicle-node v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-node)
Checking netservices v0.8.0
Checking pretty_assertions v1.4.0
Checking num-integer v0.1.46
Checking radicle-systemd v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-systemd)
Compiling escargot v0.5.10
Compiling qcheck-macros v1.0.0
Checking num-bigint v0.4.6
Compiling ahash v0.8.11
Compiling radicle-remote-helper v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-remote-helper)
Checking num-rational v0.4.2
Checking num-iter v0.1.45
Checking num-complex v0.4.6
Checking zerocopy v0.7.35
Checking bit-vec v0.8.0
Checking borrow-or-share v0.2.2
Checking bit-set v0.8.0
Checking fluent-uri v0.3.2
Checking num v0.4.3
Checking phf_shared v0.11.3
Checking vsimd v0.8.0
Checking outref v0.5.2
Checking uuid v1.16.0
Checking referencing v0.30.0
Checking phf v0.11.3
Checking uuid-simd v0.8.0
Checking fraction v0.15.3
Checking fancy-regex v0.14.0
Checking email_address v0.2.9
Checking bytecount v0.6.8
Checking base64 v0.22.1
Checking num-cmp v0.1.0
Checking emojis v0.6.4
Checking jsonschema v0.30.0
Checking git2 v0.19.0
Checking radicle-git-ext v0.8.1
Checking radicle-term v0.13.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-term)
Checking radicle-crypto v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-crypto)
Checking radicle-cob v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cob)
Checking radicle v0.16.1 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle)
Checking radicle-fetch v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-fetch)
Checking radicle-cli-test v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli-test)
Checking radicle-schemars v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-schemars)
Checking radicle-protocol v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-protocol)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 41.73s
+ cargo build --all-targets --workspace
Compiling cfg-if v1.0.0
Compiling libc v0.2.174
Compiling shlex v1.3.0
Compiling memchr v2.7.2
Compiling serde v1.0.219
Compiling smallvec v1.13.2
Compiling jobserver v0.1.31
Compiling getrandom v0.2.15
Compiling aho-corasick v1.1.3
Compiling regex-syntax v0.8.5
Compiling cc v1.2.2
Compiling regex-automata v0.4.9
Compiling typenum v1.17.0
Compiling generic-array v0.14.7
Compiling rand_core v0.6.4
Compiling log v0.4.27
Compiling crypto-common v0.1.6
Compiling fastrand v2.1.0
Compiling bitflags v2.9.1
Compiling scopeguard v1.2.0
Compiling lock_api v0.4.11
Compiling zerofrom v0.1.6
Compiling parking_lot_core v0.9.9
Compiling subtle v2.5.0
Compiling stable_deref_trait v1.2.0
Compiling yoke v0.7.5
Compiling parking_lot v0.12.3
Compiling tinyvec_macros v0.1.1
Compiling once_cell v1.21.3
Compiling tinyvec v1.6.0
Compiling zerovec v0.10.4
Compiling zeroize v1.7.0
Compiling cpufeatures v0.2.12
Compiling bstr v1.9.1
Compiling unicode-normalization v0.1.23
Compiling tinystr v0.7.6
Compiling writeable v0.5.5
Compiling litemap v0.7.5
Compiling block-padding v0.3.3
Compiling icu_locid v1.5.0
Compiling thiserror v2.0.12
Compiling inout v0.1.3
Compiling icu_locid_transform_data v1.5.1
Compiling block-buffer v0.10.4
Compiling adler2 v2.0.0
Compiling itoa v1.0.11
Compiling hashbrown v0.14.3
Compiling miniz_oxide v0.8.8
Compiling icu_provider v1.5.0
Compiling digest v0.10.7
Compiling icu_locid_transform v1.5.0
Compiling cipher v0.4.4
Compiling icu_properties_data v1.5.1
Compiling crc32fast v1.4.0
Compiling icu_collections v1.5.0
Compiling icu_normalizer_data v1.5.1
Compiling utf16_iter v1.0.5
Compiling icu_properties v1.5.1
Compiling utf8_iter v1.0.4
Compiling write16 v1.0.0
Compiling percent-encoding v2.3.1
Compiling linux-raw-sys v0.4.13
Compiling thiserror v1.0.69
Compiling sha2 v0.10.8
Compiling form_urlencoded v1.2.1
Compiling rustix v0.38.34
Compiling universal-hash v0.5.1
Compiling opaque-debug v0.3.1
Compiling libz-sys v1.1.16
Compiling gix-trace v0.1.12
Compiling amplify_num v0.5.2
Compiling icu_normalizer v1.5.0
Compiling data-encoding v2.5.0
Compiling idna_adapter v1.2.0
Compiling tempfile v3.10.1
Compiling idna v1.0.3
Compiling ascii v1.1.0
Compiling signature v1.6.4
Compiling url v2.5.4
Compiling ed25519 v1.5.3
Compiling amplify v4.6.0
Compiling data-encoding-macro v0.1.14
Compiling libgit2-sys v0.17.0+1.8.1
Compiling aead v0.5.2
Compiling faster-hex v0.9.0
Compiling byteorder v1.5.0
Compiling base-x v0.2.11
Compiling ct-codecs v1.1.1
Compiling ec25519 v0.1.0
Compiling multibase v0.9.1
Compiling poly1305 v0.8.0
Compiling chacha20 v0.9.1
Compiling gix-utils v0.1.14
Compiling cyphergraphy v0.3.0
Compiling num-traits v0.2.19
Compiling gix-hash v0.15.1
Compiling same-file v1.0.6
Compiling keccak v0.1.5
Compiling sha3 v0.10.8
Compiling walkdir v2.5.0
Compiling polyval v0.6.2
Compiling git-ref-format-core v0.3.1
Compiling flate2 v1.1.1
Compiling hmac v0.12.1
Compiling sqlite3-src v0.5.1
Compiling prodash v29.0.2
Compiling base64ct v1.6.0
Compiling base32 v0.4.0
Compiling ppv-lite86 v0.2.17
Compiling sha1_smol v1.0.0
Compiling equivalent v1.0.1
Compiling indexmap v2.2.6
Compiling rand_chacha v0.3.1
Compiling gix-features v0.39.1
Compiling cypheraddr v0.4.0
Compiling pem-rfc7468 v0.7.0
Compiling git-ref-format-macro v0.3.1
Compiling pbkdf2 v0.12.2
Compiling ghash v0.5.1
Compiling crossbeam-utils v0.8.19
Compiling chacha20poly1305 v0.10.1
Compiling ctr v0.9.2
Compiling aes v0.8.4
Compiling ryu v1.0.17
Compiling serde_json v1.0.140
Compiling aes-gcm v0.10.3
Compiling git-ref-format v0.3.1
Compiling crossbeam-channel v0.5.15
Compiling noise-framework v0.4.0
Compiling ssh-encoding v0.2.0
Compiling socks5-client v0.4.1
Compiling rand v0.8.5
Compiling blowfish v0.9.1
Compiling cbc v0.1.2
Compiling home v0.5.9
Compiling radicle-std-ext v0.1.0
Compiling gix-path v0.10.15
Compiling ssh-cipher v0.2.0
Compiling bcrypt-pbkdf v0.10.0
Compiling cyphernet v0.5.2
Compiling signature v2.2.0
Compiling ssh-key v0.6.6
Compiling ref-cast v1.0.24
Compiling qcheck v1.0.0
Compiling radicle-ssh v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-ssh)
Compiling lazy_static v1.5.0
Compiling dyn-clone v1.0.17
Compiling siphasher v1.0.1
Compiling typeid v1.0.3
Compiling radicle-dag v0.10.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-dag)
Compiling nonempty v0.9.0
Compiling erased-serde v0.4.6
Compiling iana-time-zone v0.1.60
Compiling jiff v0.2.1
Compiling serde-untagged v0.1.7
Compiling chrono v0.4.38
Compiling schemars v1.0.4
Compiling gix-date v0.9.4
Compiling colored v2.1.0
Compiling localtime v1.3.1
Compiling bytesize v2.0.1
Compiling winnow v0.6.26
Compiling tree-sitter-language v0.1.2
Compiling fast-glob v0.3.3
Compiling base64 v0.21.7
Compiling gix-actor v0.33.2
Compiling gix-hashtable v0.6.0
Compiling gix-validate v0.9.4
Compiling memmap2 v0.9.4
Compiling gix-object v0.46.1
Compiling gix-chunk v0.4.11
Compiling anstyle-query v1.0.2
Compiling gix-commitgraph v0.25.1
Compiling anyhow v1.0.82
Compiling gix-revwalk v0.17.0
Compiling gix-fs v0.12.1
Compiling sem_safe v0.2.0
Compiling errno v0.3.13
Compiling unicode-segmentation v1.11.0
Compiling sqlite3-sys v0.15.2
Compiling sqlite v0.32.0
Compiling signals_receipts v0.2.0
Compiling gix-tempfile v15.0.0
Compiling signal-hook-registry v1.4.5
Compiling shell-words v1.1.0
Compiling gix-command v0.4.1
Compiling signal-hook v0.3.18
Compiling radicle-signals v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-signals)
Compiling mio v1.0.4
Compiling mio v0.8.11
Compiling tree-sitter v0.24.4
Compiling signal-hook-mio v0.2.4
Compiling gix-lock v15.0.1
Compiling convert_case v0.7.1
Compiling gix-config-value v0.14.12
Compiling gix-url v0.28.2
Compiling gix-quote v0.4.15
Compiling regex v1.11.1
Compiling gix-sec v0.10.12
Compiling xattr v1.3.1
Compiling gix-prompt v0.9.1
Compiling derive_more-impl v2.0.1
Compiling gix-revision v0.31.1
Compiling gix-traverse v0.43.1
Compiling gix-diff v0.49.0
Compiling gix-packetline v0.18.4
Compiling filetime v0.2.23
Compiling lexopt v0.3.0
Compiling linux-raw-sys v0.9.4
Compiling utf8parse v0.2.1
Compiling bitflags v1.3.2
Compiling crossterm v0.25.0
Compiling anstyle-parse v0.2.3
Compiling rustix v1.0.7
Compiling derive_more v2.0.1
Compiling gix-transport v0.44.0
Compiling tar v0.4.40
Compiling gix-pack v0.56.0
Compiling gix-refspec v0.27.0
Compiling gix-credentials v0.26.0
Compiling gix-ref v0.49.1
Compiling gix-shallow v0.1.0
Compiling newline-converter v0.3.0
Compiling gix-negotiate v0.17.0
Compiling fxhash v0.2.1
Compiling arc-swap v1.7.1
Compiling colorchoice v1.0.0
Compiling anstyle v1.0.6
Compiling streaming-iterator v0.1.9
Compiling unicode-width v0.1.11
Compiling inquire v0.7.5
Compiling anstream v0.6.13
Compiling gix-odb v0.66.0
Compiling gix-protocol v0.47.0
Compiling radicle-surf v0.22.0
Compiling crossterm v0.29.0
Compiling unicode-display-width v0.3.0
Compiling tree-sitter-json v0.24.8
Compiling tree-sitter-go v0.23.4
Compiling tree-sitter-typescript v0.23.2
Compiling tree-sitter-c v0.23.2
Compiling tree-sitter-ruby v0.23.1
Compiling tree-sitter-md v0.3.2
Compiling tree-sitter-bash v0.23.3
Compiling tree-sitter-css v0.23.1
Compiling tree-sitter-python v0.23.4
Compiling tree-sitter-toml-ng v0.6.0
Compiling tree-sitter-html v0.23.2
Compiling tree-sitter-rust v0.23.2
Compiling either v1.11.0
Compiling snapbox-macros v0.3.8
Compiling salsa20 v0.10.2
Compiling radicle-cli v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli)
Compiling siphasher v0.3.11
Compiling similar v2.5.0
Compiling base64 v0.13.1
Compiling normalize-line-endings v0.3.0
Compiling nonempty v0.5.0
Compiling snapbox v0.4.17
Compiling bloomy v1.2.0
Compiling scrypt v0.11.0
Compiling tree-sitter-highlight v0.24.4
Compiling popol v3.0.0
Compiling bytes v1.10.1
Compiling timeago v0.4.2
Compiling io-reactor v0.5.2
Compiling socket2 v0.5.7
Compiling radicle-node v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-node)
Compiling yansi v0.5.1
Compiling diff v0.1.13
Compiling netservices v0.8.0
Compiling pretty_assertions v1.4.0
Compiling num-integer v0.1.46
Compiling radicle-systemd v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-systemd)
Compiling escargot v0.5.10
Compiling num-bigint v0.4.6
Compiling radicle-remote-helper v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-remote-helper)
Compiling num-iter v0.1.45
Compiling num-complex v0.4.6
Compiling num-rational v0.4.2
Compiling borrow-or-share v0.2.2
Compiling zerocopy v0.7.35
Compiling bit-vec v0.8.0
Compiling ahash v0.8.11
Compiling bit-set v0.8.0
Compiling num v0.4.3
Compiling fluent-uri v0.3.2
Compiling phf_shared v0.11.3
Compiling uuid v1.16.0
Compiling outref v0.5.2
Compiling vsimd v0.8.0
Compiling phf v0.11.3
Compiling referencing v0.30.0
Compiling uuid-simd v0.8.0
Compiling fancy-regex v0.14.0
Compiling fraction v0.15.3
Compiling email_address v0.2.9
Compiling bytecount v0.6.8
Compiling num-cmp v0.1.0
Compiling base64 v0.22.1
Compiling emojis v0.6.4
Compiling jsonschema v0.30.0
Compiling git2 v0.19.0
Compiling radicle-git-ext v0.8.1
Compiling radicle-term v0.13.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-term)
Compiling radicle-crypto v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-crypto)
Compiling radicle-cob v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cob)
Compiling radicle v0.16.1 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle)
Compiling radicle-fetch v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-fetch)
Compiling radicle-protocol v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-protocol)
Compiling radicle-cli-test v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli-test)
Compiling radicle-schemars v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-schemars)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 02s
+ cargo doc --workspace --no-deps
Checking regex-automata v0.4.9
Compiling syn v1.0.109
Checking idna v1.0.3
Checking radicle-ssh v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-ssh)
Checking url v2.5.4
Compiling num-traits v0.2.19
Checking git2 v0.19.0
Checking radicle-dag v0.10.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-dag)
Compiling amplify_syn v2.0.1
Checking bstr v1.9.1
Compiling proc-macro-error v1.0.4
Compiling amplify_derive v4.0.0
Compiling data-encoding-macro-internal v0.1.12
Checking gix-path v0.10.15
Compiling git-ref-format-macro v0.3.1
Checking git-ref-format-core v0.3.1
Checking gix-date v0.9.4
Checking data-encoding-macro v0.1.14
Checking multibase v0.9.1
Checking gix-actor v0.33.2
Checking gix-validate v0.9.4
Checking git-ref-format v0.3.1
Checking gix-object v0.46.1
Checking radicle-git-ext v0.8.1
Checking gix-commitgraph v0.25.1
Checking chrono v0.4.38
Checking gix-command v0.4.1
Checking gix-revwalk v0.17.0
Checking radicle-signals v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-signals)
Checking regex v1.11.1
Checking gix-config-value v0.14.12
Checking tree-sitter v0.24.4
Checking amplify v4.6.0
Checking gix-url v0.28.2
Checking gix-quote v0.4.15
Checking gix-prompt v0.9.1
Checking gix-traverse v0.43.1
Checking cyphergraphy v0.3.0
Checking gix-revision v0.31.1
Checking gix-diff v0.49.0
Checking gix-packetline v0.18.4
Checking cypheraddr v0.4.0
Checking noise-framework v0.4.0
Checking radicle-surf v0.22.0
Checking gix-transport v0.44.0
Checking socks5-client v0.4.1
Compiling radicle-cli v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli)
Checking gix-refspec v0.27.0
Checking cyphernet v0.5.2
Checking gix-pack v0.56.0
Checking radicle-crypto v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-crypto)
Checking tree-sitter-toml-ng v0.6.0
Checking tree-sitter-highlight v0.24.4
Checking gix-credentials v0.26.0
Checking radicle-cob v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cob)
Checking gix-shallow v0.1.0
Checking gix-ref v0.49.1
Checking radicle-term v0.13.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-term)
Checking radicle v0.16.1 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle)
Checking gix-negotiate v0.17.0
Checking gix-odb v0.66.0
Checking io-reactor v0.5.2
Checking gix-protocol v0.47.0
Compiling radicle-node v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-node)
Checking netservices v0.8.0
Checking radicle-systemd v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-systemd)
Documenting radicle v0.16.1 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle)
Documenting radicle-cob v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cob)
Documenting radicle-crypto v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-crypto)
Documenting radicle-term v0.13.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-term)
Documenting radicle-signals v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-signals)
Documenting radicle-ssh v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-ssh)
Documenting radicle-dag v0.10.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-dag)
Documenting radicle-systemd v0.9.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-systemd)
Checking radicle-fetch v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-fetch)
Documenting radicle-cli v0.14.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli)
Documenting radicle-fetch v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-fetch)
Checking radicle-protocol v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-protocol)
Documenting radicle-protocol v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-protocol)
Documenting radicle-node v0.12.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-node)
Documenting radicle-schemars v0.1.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-schemars)
Checking radicle-remote-helper v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-remote-helper)
Documenting radicle-remote-helper v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-remote-helper)
Documenting radicle-cli-test v0.11.0 (/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli-test)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.34s
Generated /e55d28f4-5318-4922-808d-c3044aaf4bd5/w/target/doc/radicle/index.html and 16 other files
+ cargo test --workspace --no-fail-fast
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.14s
Running unittests src/lib.rs (target/debug/deps/radicle-d7f2ef00712f1157)
running 213 tests
test canonical::formatter::test::securesystemslib_asserts ... ok
test canonical::formatter::test::ascii_control_characters ... ok
test canonical::formatter::test::ordered_nested_object ... ok
test cob::cache::tests::test_check_version ... ok
test cob::cache::tests::test_migrate_to ... ok
test cob::common::test::test_color ... ok
test cob::common::test::test_emojis ... ok
test cob::cache::migrations::_2::tests::test_migration_2 ... ok
test cob::cache::migrations::_2::tests::test_patch_json_deserialization ... ok
test cob::identity::test::prop_json_eq_str ... ok
test cob::identity::test::test_identity_redact_revision ... ok
test cob::identity::test::test_identity_reject_concurrent ... ok
test cob::identity::test::test_identity_update_rejected ... ok
test cob::identity::test::test_identity_remove_delegate_concurrent ... ok
test cob::identity::test::test_identity_updates ... ok
test cob::issue::cache::tests::test_counts ... ok
test cob::issue::cache::tests::test_get ... ok
test cob::issue::cache::tests::test_is_empty ... ok
test cob::issue::cache::tests::test_list ... ok
test cob::issue::cache::tests::test_list_by_status ... ok
test cob::issue::cache::tests::test_remove ... ok
test cob::identity::test::test_valid_identity ... ok
test cob::issue::test::test_embeds ... ok
test cob::identity::test::test_identity_updates_concurrent ... ok
test cob::issue::test::test_invalid_actions ... ok
test cob::issue::test::test_embeds_edit ... ok
test cob::identity::test::test_identity_updates_concurrent_outdated ... ok
test cob::issue::test::test_invalid_tx ... ok
test cob::issue::test::test_invalid_tx_reference ... ok
test cob::issue::test::test_invalid_cob ... ok
test cob::issue::test::test_issue_all ... ok
test cob::issue::test::test_concurrency ... ok
test cob::issue::test::test_issue_comment ... ok
test cob::issue::test::test_issue_comment_redact ... ok
test cob::issue::test::test_issue_create_and_assign ... ok
test cob::issue::test::test_issue_create_and_change_state ... ok
test cob::issue::test::test_issue_create_and_get ... ok
test cob::issue::test::test_issue_edit_description ... ok
test cob::issue::test::test_issue_create_and_unassign ... ok
test cob::issue::test::test_issue_create_and_reassign ... ok
test cob::issue::test::test_issue_edit ... ok
test cob::issue::test::test_issue_multilines ... ok
test cob::issue::test::test_issue_state_serde ... ok
test cob::issue::test::test_ordering ... ok
test cob::patch::actions::test::test_review_comment ... ok
test cob::patch::actions::test::test_review_edit ... ok
test cob::patch::actions::test::test_revision_comment ... ok
test cob::patch::actions::test::test_revision_react ... ok
test cob::issue::test::test_issue_react ... ok
test cob::issue::test::test_issue_label ... ok
test cob::patch::cache::tests::test_find_by_revision ... ok
test cob::patch::cache::tests::test_is_empty ... ok
test cob::issue::test::test_issue_reply ... ok
test cob::patch::cache::tests::test_list_by_status ... ok
test cob::patch::cache::tests::test_remove ... ok
test cob::patch::encoding::review::test::test_review_deserialize_summary_migration_null_summary ... ok
test cob::patch::encoding::review::test::test_review_deserialize_summary_migration_with_summary ... ok
test cob::patch::encoding::review::test::test_review_deserialize_summary_migration_without_summary ... ok
test cob::patch::encoding::review::test::test_review_deserialize_summary_v2 ... ok
test cob::patch::encoding::review::test::test_review_summary ... ok
test cob::patch::encoding::revision::test::test_location_v1_to_v2_migration ... ok
test cob::patch::encoding::revision::test::test_location_v2_preserved ... ok
test cob::patch::encoding::revision::test::test_revision_deserialize_mixed_locations ... ok
test cob::patch::encoding::revision::test::test_revision_deserialize_v1_location_migration ... ok
test cob::patch::encoding::revision::test::test_revision_deserialize_v2_location_preserved ... ok
test cob::patch::test::test_json ... ok
test cob::patch::test::test_json_serialization ... ok
test cob::patch::cache::tests::test_get ... ok
test cob::patch::cache::tests::test_list ... ok
test cob::patch::cache::tests::test_counts ... ok
test cob::patch::test::test_patch_discussion ... ok
test cob::patch::test::test_patch_create_and_get ... ok
test cob::patch::test::test_patch_merge ... ok
test cob::patch::test::test_patch_review_comment ... ok
test cob::patch::test::test_patch_redact ... ok
test cob::patch::test::test_patch_review ... ok
test cob::patch::test::test_patch_review_duplicate ... ok
test cob::patch::test::test_patch_review_remove_summary ... ok
test cob::patch::test::test_patch_review_edit ... ok
test cob::patch::test::test_reactions_json_serialization ... ok
test cob::patch::test::test_patch_review_edit_comment ... ok
test cob::patch::test::test_revision_edit_redact ... ok
test cob::patch::test::test_revision_review_merge_redacted ... ok
test cob::patch::test::test_revision_reaction ... ok
test cob::thread::tests::test_comment_edit_missing ... ok
test cob::thread::tests::test_comment_edit_redacted ... ok
test cob::thread::tests::test_comment_redact_missing ... ok
test cob::thread::tests::test_duplicate_comments ... ok
test cob::thread::tests::test_edit_comment ... ok
test cob::thread::tests::test_redact_comment ... ok
test cob::patch::test::test_patch_review_revision_redact ... ok
test cob::thread::tests::test_timeline ... ok
test git::canonical::rules::tests::test_deserialization ... ok
test git::canonical::rules::tests::test_deserialize_extensions ... ok
test git::canonical::rules::tests::test_order ... ok
test git::canonical::rules::tests::test_roundtrip ... ok
test cob::patch::test::test_patch_update ... ok
test git::canonical::rules::tests::test_rule_validate_success ... ok
test git::canonical::rules::tests::test_special_branches ... ok
test git::canonical::rules::tests::test_canonical ... ok
test git::canonical::tests::test_quorum_merges ... ok
test git::canonical::rules::tests::test_rule_validate_failures ... ok
test git::test::test_version_from_str ... ok
test git::test::test_version_ord ... ok
test identity::did::test::test_did_encode_decode ... ok
test identity::did::test::test_did_vectors ... ok
test identity::doc::id::test::prop_from_str ... ok
test git::canonical::tests::test_quorum ... ok
test identity::doc::test::test_canonical_doc ... ok
test git::canonical::tests::test_quorum_properties ... ok
test identity::doc::test::test_duplicate_dids ... ok
test identity::doc::test::test_future_version_error ... ok
test identity::doc::test::test_is_valid_version ... ok
test identity::doc::test::test_canonical_example ... ok
test identity::doc::test::test_not_found ... ok
test identity::doc::test::test_parse_version ... ok
test identity::doc::test::test_visibility_json ... ok
test identity::doc::update::test::test_can_update_crefs ... ok
test identity::doc::update::test::test_cannot_include_default_branch_rule ... ok
test cob::thread::tests::prop_ordering ... ok
test identity::doc::update::test::test_default_branch_rule_exists_after_verification ... ok
test node::address::store::test::test_alias ... ok
test node::address::store::test::test_disconnected ... ok
test node::address::store::test::test_disconnected_ban ... ok
test identity::project::test::test_project_name ... ok
test node::address::store::test::test_entries ... ok
test node::address::store::test::test_get_none ... ok
test node::address::store::test::test_insert_and_get ... ok
test node::address::store::test::test_insert_and_remove ... ok
test node::address::store::test::test_insert_and_update ... ok
test node::address::store::test::test_insert_duplicate ... ok
test node::address::store::test::test_empty ... ok
test node::address::store::test::test_node_aliases ... ok
test node::address::store::test::test_remove_nothing ... ok
test node::db::test::test_version ... ok
test node::features::test::test_operations ... ok
test node::notifications::store::test::test_branch_notifications ... ok
test node::notifications::store::test::test_clear ... ok
test node::notifications::store::test::test_cob_notifications ... ok
test node::notifications::store::test::test_counts_by_repo ... ok
test node::notifications::store::test::test_duplicate_notifications ... ok
test node::notifications::store::test::test_notification_status ... ok
test node::policy::store::test::test_follow_and_unfollow_node ... ok
test node::policy::store::test::test_node_aliases ... ok
test node::policy::store::test::test_node_policies ... ok
test identity::doc::test::test_max_delegates ... ok
test node::policy::store::test::test_node_policy ... ok
test node::policy::store::test::test_repo_policies ... ok
test node::policy::store::test::test_repo_policy ... ok
test node::policy::store::test::test_seed_and_unseed_repo ... ok
test node::policy::store::test::test_update_alias ... ok
test node::policy::store::test::test_update_scope ... ok
test node::refs::store::test::test_count ... ok
test node::refs::store::test::test_set_and_get ... ok
test node::refs::store::test::test_set_and_delete ... ok
test node::routing::test::test_count ... ok
test node::routing::test::test_entries ... ok
test node::routing::test::test_insert_and_get ... ok
test node::routing::test::test_insert_and_get_resources ... ok
test node::routing::test::test_insert_duplicate ... ok
test node::routing::test::test_len ... ok
test node::routing::test::test_insert_and_remove ... ok
test node::routing::test::test_insert_existing_updated_time ... ok
test node::routing::test::test_remove_redundant ... ok
test node::routing::test::test_update_existing_multi ... ok
test node::sync::announce::test::announcer_must_reach_preferred_seeds ... ok
test node::routing::test::test_remove_many ... ok
test node::routing::test::test_prune ... ok
test node::sync::announce::test::announcer_reached_max_replication_target ... ok
test node::sync::announce::test::announcer_timed_out ... ok
test node::sync::announce::test::announcer_reached_min_replication_target ... ok
test node::sync::announce::test::announcer_will_minimise_replication_factor ... ok
test node::sync::announce::test::cannot_construct_announcer ... ok
test node::sync::fetch::test::all_nodes_are_candidates ... ok
test node::sync::fetch::test::all_nodes_are_fetchable ... ok
test node::sync::fetch::test::could_not_reach_target ... ok
test node::sync::fetch::test::ignores_duplicates_and_local_node ... ok
test node::sync::fetch::test::preferred_seeds_target_returned_over_replicas ... ok
test node::sync::fetch::test::reaches_target_of_max_replicas ... ok
test node::sync::fetch::test::reaches_target_of_preferred_seeds ... ok
test node::sync::test::ensure_replicas_construction ... ok
test node::test::test_alias ... ok
test node::test::test_command_result ... ok
test node::test::test_user_agent ... ok
test node::timestamp::tests::test_timestamp_max ... ok
test node::sync::fetch::test::reaches_target_of_replicas ... ok
test node::sync::test::replicas_constrain_to ... ok
test profile::test::test_config ... ok
test profile::test::canonicalize_home ... ok
test rad::tests::test_checkout ... ok
test rad::tests::test_fork ... ok
test serde_ext::test::test_localtime ... ok
test serde_ext::test::test_localtime_ext ... ok
test storage::git::tests::test_references_of ... ok
test profile::config::test::schema ... ok
test rad::tests::test_init ... ok
test storage::git::transport::local::url::test::test_url_parse ... ok
test storage::git::transport::local::url::test::test_url_to_string ... ok
test storage::git::transport::remote::url::test::test_url_parse ... ok
test storage::refs::tests::prop_canonical_roundtrip ... ok
test storage::git::tests::test_sign_refs ... ok
test storage::tests::test_storage ... ok
test test::assert::test::assert_with_message ... ok
test test::assert::test::test_assert_no_move ... ok
test test::assert::test::test_assert_panic_0 - should panic ... ok
test test::assert::test::test_assert_panic_1 - should panic ... ok
test test::assert::test::test_assert_panic_2 - should panic ... ok
test test::assert::test::test_assert_succeed ... ok
test test::assert::test::test_panic_message ... ok
test version::test::test_version ... ok
test storage::git::tests::test_remote_refs ... ok
test storage::refs::tests::test_rid_verification ... ok
test identity::doc::test::prop_encode_decode ... ok
test result: ok. 213 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.21s
Running unittests src/lib.rs (target/debug/deps/radicle_cli-e3bc136737b6931a)
running 14 tests
test commands::rad_patch::review::builder::tests::test_review_comments_multiline ... ok
test commands::rad_patch::review::builder::tests::test_review_comments_before ... ok
test commands::rad_patch::review::builder::tests::test_review_comments_basic ... ok
test commands::rad_inspect::test::test_tree ... ok
test commands::rad_patch::review::builder::tests::test_review_comments_split_hunk ... ok
test git::pretty_diff::test::test_pretty ... ignored
test git::ddiff::tests::diff_encode_decode_ddiff_hunk ... ok
test git::unified_diff::test::test_diff_content_encode_decode_content ... ok
test git::unified_diff::test::test_diff_encode_decode_diff ... ok
test terminal::format::test::test_bytes ... ok
test terminal::patch::test::test_edit_display_message ... ok
test terminal::format::test::test_strip_comments ... ok
test terminal::patch::test::test_create_display_message ... ok
test terminal::patch::test::test_update_display_message ... ok
test result: ok. 13 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.01s
Running unittests src/main.rs (target/debug/deps/rad-f1f0232c8e62d994)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/commands.rs (target/debug/deps/commands-295ee92451aa7bc0)
running 100 tests
test framework_home ... ok
test git_push_and_fetch ... ok
test git_push_amend ... ok
test git_push_canonical_tags ... ok
test git_push_diverge ... ok
test git_push_rollback ... ok
test rad_auth_errors ... ok
test rad_block ... ok
test rad_auth ... ok
test rad_checkout ... ok
test git_push_converge ... ok
test git_tag ... ok
test rad_clone ... ok
test rad_clone_connect ... ok
test rad_clean ... ok
test rad_clone_unknown ... ok
test rad_clone_directory ... ok
test rad_clone_all ... ok
test rad_cob_multiset ... ok
test rad_cob_log ... ok
test rad_cob_migrate ... ok
test rad_cob_show ... ok
test rad_clone_partial_fail ... ok
test rad_cob_update_identity ... ok
test rad_config ... ok
test rad_cob_update ... ok
test rad_diff ... ok
test rad_id_collaboration ... ignored, slow
test rad_id ... ok
test rad_id_conflict ... ok
test rad_id_missing_commits ... ok
test rad_id_private ... ok
test rad_id_multi_delegate ... ok
test rad_id_threshold_soft_fork ... ok
test rad_id_threshold ... ok
test rad_id_unknown_field ... ok
test rad_id_update_delete_field ... ok
test rad_init ... ignored, part of many other tests
test rad_init_detached_head ... ok
test rad_init_existing ... ok
test rad_init_no_git ... ok
test rad_init_no_seed ... ok
test rad_init_private ... ok
test rad_fetch ... ok
test rad_fork ... ok
test rad_init_private_clone ... ok
test rad_init_private_no_seed ... ok
test rad_inbox ... ok
test rad_init_sync_not_connected ... ok
test rad_init_private_clone_seed ... ok
test rad_init_private_seed ... ok
test rad_init_with_existing_remote ... ok
test rad_init_sync_preferred ... ok
test rad_inspect ... ok
test rad_issue ... ok
test rad_merge_after_update ... ok
test rad_merge_no_ff ... ok
test rad_merge_via_push ... ok
test rad_node_connect ... ok
test rad_node_connect_without_address ... ok
test rad_node ... ok
test rad_patch ... ok
test rad_patch_ahead_behind ... ok
test rad_patch_change_base ... ok
test rad_patch_checkout ... ok
test rad_patch_checkout_revision ... ok
test rad_patch_checkout_force ... ok
test rad_patch_detached_head ... ok
test rad_init_sync_and_clone ... ok
test rad_patch_draft ... ok
test rad_patch_diff ... ok
test rad_init_sync_timeout ... ok
test rad_patch_edit ... ok
test rad_patch_fetch_2 ... ok
test rad_patch_merge_draft ... ok
test rad_patch_fetch_1 ... ok
test rad_patch_delete ... ok
test rad_patch_revert_merge ... ok
test rad_patch_open_explore ... ok
test rad_patch_update ... ok
test rad_publish ... ok
test rad_patch_via_push ... ok
test rad_review_by_hunk ... ok
test rad_seed_and_follow ... ok
test rad_remote ... ok
test rad_self ... ok
test rad_seed_many ... ok
test rad_sync_without_node ... ok
test rad_push_and_pull_patches ... ok
test rad_unseed ... ok
test rad_unseed_many ... ok
test rad_warn_old_nodes ... FAILED
test rad_sync ... ok
test rad_watch ... ok
test test_clone_without_seeds ... ok
test test_cob_deletion ... ok
test test_cob_replication ... ok
test rad_workflow ... ok
test rad_patch_pull_update ... ok
test test_replication_via_seed ... ok
failures:
---- rad_warn_old_nodes stdout ----
1753288177 test: Using PATH ["/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/crates/radicle-cli/target/debug", "/usr/local/cargo/bin", "/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/tmp/radicle-z9hGIb/work/alice"]
1753288177 test: rad-warn-old-nodes.md: Running `/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/target/debug/rad` with ["config", "push", "preferredSeeds", "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776"] in `/tmp/radicle-z9hGIb/work/alice`..
1753288178 test: rad-warn-old-nodes.md: Running `/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/target/debug/rad` with ["config", "push", "node.connect", "z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776"] in `/tmp/radicle-z9hGIb/work/alice`..
1753288178 test: rad-warn-old-nodes.md: Running `/e55d28f4-5318-4922-808d-c3044aaf4bd5/w/target/debug/rad` with ["debug"] in `/tmp/radicle-z9hGIb/work/alice`..
thread 'rad_warn_old_nodes' panicked at crates/radicle-cli-test/src/lib.rs:487:36:
--- Expected
++++ actual: stdout
1 1 | {
2 2 | "radExe": "[..]",
3 3 | "radVersion": "[..]",
4 - "radicleNodeVersion": "radicle-node [..]",
5 - "gitRemoteRadVersion": "git-remote-rad [..]",
6 - "gitVersion": "git version [..]",
7 - "sshVersion": "[..]",
8 - "gitHead": "[..]",
4 + "radicleNodeVersion": "<unknown>",
5 + "gitRemoteRadVersion": "git-remote-rad pre-release (222e53c3)",
6 + "gitVersion": "git version 2.39.5",
7 + "sshVersion": "OpenSSH_9.2p1 Debian-2+deb12u6, OpenSSL 3.0.16 11 Feb 2025",
8 + "gitHead": "222e53c3",
9 9 | "log": {
10 10 | "filename": "[..]",
11 11 | "exists": false,
12 12 | "len": null
13 13 | },
⋮
29 29 | "warnings": [
30 30 | "Value of configuration option `node.connect` at index 0 mentions node with address 'ash.radicle.garden:8776', which has been renamed to 'rosa.radicle.xyz:8776'. Please update your configuration.",
31 31 | "Value of configuration option `preferred_seeds` at index 0 mentions node with address 'seed.radicle.garden:8776', which has been renamed to 'iris.radicle.xyz:8776'. Please update your configuration."
32 32 | ]
33 33 | }
Exit status: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
rad_warn_old_nodes
test result: FAILED. 97 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out; finished in 70.85s
error: test failed, to rerun pass `-p radicle-cli --test commands`
Running unittests src/lib.rs (target/debug/deps/radicle_cli_test-c03b627d0c86fb23)
running 3 tests
test tests::test_parse ... ok
test tests::test_run ... ok
test tests::test_example_spaced_brackets ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_cob-7ce377579d6f8f3a)
running 8 tests
test object::tests::test_serde ... ok
test tests::invalid_parse_refstr ... ok
test tests::parse_refstr ... ok
test tests::traverse_cobs ... ok
test type_name::test::valid_typenames ... ok
test tests::list_cobs ... ok
test tests::update_cob ... ok
test tests::roundtrip ... ok
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
Running unittests src/lib.rs (target/debug/deps/radicle_crypto-53df22f2e7b1cb5a)
running 12 tests
test ssh::fmt::test::test_key ... ok
test ssh::fmt::test::test_fingerprint ... ok
test ssh::keystore::tests::test_init_no_passphrase ... ok
test ssh::test::test_agent_encoding_remove ... ok
test ssh::test::test_agent_encoding_sign ... ok
test ssh::test::prop_encode_decode_sk ... ok
test tests::prop_encode_decode ... ok
test tests::test_e25519_dh ... ok
test tests::test_encode_decode ... ok
test tests::prop_key_equality ... ok
test ssh::keystore::tests::test_signer ... ok
test ssh::keystore::tests::test_init_passphrase ... ok
test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.87s
Running unittests src/lib.rs (target/debug/deps/radicle_dag-20ca1aca3d76c348)
running 20 tests
test tests::test_cycle ... ok
test tests::test_contains ... ok
test tests::test_fold_diamond ... ok
test tests::test_complex ... ok
test tests::test_dependencies ... ok
test tests::test_diamond ... ok
test tests::test_fold_sorting_1 ... ok
test tests::test_fold_sorting_2 ... ok
test tests::test_is_empty ... ok
test tests::test_get ... ok
test tests::test_len ... ok
test tests::test_merge_1 ... ok
test tests::test_merge_2 ... ok
test tests::test_prune_1 ... ok
test tests::test_prune_2 ... ok
test tests::test_remove ... ok
test tests::test_prune_by_sorting ... ok
test tests::test_fold_multiple_roots ... ok
test tests::test_siblings ... ok
test tests::test_fold_reject ... ok
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_fetch-8e88ace6f2a7b826)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_node-718af7be4c23dc3c)
running 69 tests
test control::tests::test_control_socket ... ok
test control::tests::test_seed_unseed ... ok
test tests::e2e::missing_default_branch ... ok
test tests::e2e::missing_delegate_default_branch ... ok
test tests::e2e::test_catchup_on_refs_announcements ... ok
test tests::e2e::test_background_foreground_fetch ... ok
test tests::e2e::test_channel_reader_limit ... ok
test tests::e2e::test_clone ... ok
test tests::e2e::test_dont_fetch_owned_refs ... ok
test tests::e2e::test_fetch_followed_remotes ... ok
test tests::e2e::test_connection_crossing ... FAILED
test tests::e2e::test_fetch_preserve_owned_refs ... ok
test tests::e2e::test_fetch_unseeded ... ok
test tests::e2e::test_fetch_up_to_date ... ok
test tests::e2e::test_concurrent_fetches ... ok
test tests::e2e::test_inventory_sync_basic ... ok
test tests::e2e::test_large_fetch ... ok
test tests::e2e::test_migrated_clone ... ok
test tests::e2e::test_missing_remote ... ok
test tests::e2e::test_multiple_offline_inits ... ok
test tests::e2e::test_non_fastforward_sigrefs ... ok
test tests::e2e::test_outdated_delegate_sigrefs ... ok
test tests::e2e::test_outdated_sigrefs ... ok
test tests::e2e::test_replication ... ok
test tests::e2e::test_inventory_sync_bridge ... ok
test tests::e2e::test_inventory_sync_ring ... ok
test tests::e2e::test_replication_invalid ... ok
test tests::e2e::test_inventory_sync_star ... ok
test tests::e2e::test_replication_ref_in_sigrefs ... ok
test tests::test_announcement_rebroadcast ... ok
test tests::test_announcement_rebroadcast_duplicates ... ok
test tests::test_announcement_relay ... ok
test tests::test_announcement_rebroadcast_timestamp_filtered ... ok
test tests::test_connection_kept_alive ... ok
test tests::test_disconnecting_unresponsive_peer ... ok
test tests::test_fetch_missing_inventory_on_gossip ... ok
test tests::test_fetch_missing_inventory_on_schedule ... ok
test tests::test_inbound_connection ... ok
test tests::test_inventory_decode ... ok
test tests::test_init_and_seed ... ok
test tests::test_inventory_relay ... ok
test tests::test_inventory_relay_bad_timestamp ... ok
test tests::test_inventory_sync ... ok
test tests::test_maintain_connections ... ok
test tests::test_maintain_connections_failed_attempt ... ok
test tests::test_maintain_connections_transient ... ok
test tests::test_inventory_pruning ... ok
test tests::test_persistent_peer_connect ... ok
test tests::test_outbound_connection ... ok
test tests::test_persistent_peer_reconnect_success ... ok
test tests::test_persistent_peer_reconnect_attempt ... ok
test tests::test_ping_response ... ok
test tests::test_queued_fetch_from_command_same_rid ... ok
test tests::test_queued_fetch_from_ann_same_rid ... ok
test tests::test_redundant_connect ... ok
test tests::test_queued_fetch_max_capacity ... ok
test tests::test_refs_announcement_followed ... ok
test tests::test_refs_announcement_fetch_trusted_no_inventory ... ok
test tests::test_refs_announcement_no_subscribe ... ok
test tests::test_refs_announcement_offline ... ok
test tests::test_refs_announcement_relay_private ... ok
test tests::test_refs_announcement_relay_public ... ok
test tests::test_refs_synced_event ... ok
test tests::test_seed_repo_subscribe ... ok
test wire::test::test_inventory_ann_with_extension ... ok
test wire::test::test_pong_message_with_extension ... ok
test tests::test_seeding ... ok
test tests::prop_inventory_exchange_dense ... ok
test tests::test_announcement_message_amplification ... ok
failures:
---- tests::e2e::test_connection_crossing stdout ----
1753288187 test: Node::init alice: z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf
1753288187 test: Node::init bob: z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A
1753288187 tests::e2e::test_connection_crossing node: Opening policy database..
1753288187 tests::e2e::test_connection_crossing node: Migrating COBs cache..
1753288187 tests::e2e::test_connection_crossing node: Migration of COBs cache complete (version=2)..
1753288187 tests::e2e::test_connection_crossing node: Default seeding policy set to 'block (all)'
1753288187 tests::e2e::test_connection_crossing node: Initializing service (Test)..
1753288187 tests::e2e::test_connection_crossing node: Opening node database..
1753288187 tests::e2e::test_connection_crossing node: Address book is empty. Adding bootstrap nodes..
1753288187 tests::e2e::test_connection_crossing node: 0 nodes added to address book
1753288187 tests::e2e::test_connection_crossing service: Init @1753288187896
1753288187 tests::e2e::test_connection_crossing service: Empty refs database, populating from storage..
1753288187 tests::e2e::test_connection_crossing service: Not enough available peers to connect to (available=0, wanted=8)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> node: Listening on 0.0.0.0:39205..
1753288187 tests::e2e::test_connection_crossing node: Binding control socket /tmp/.tmpyBizt2/bdfLa4kF/node/control.sock..
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <runtime> node: Running node z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf in /tmp/.tmpyBizt2/bdfLa4kF..
1753288187 tests::e2e::test_connection_crossing node: Opening policy database..
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <control> control: Control thread listening on socket..
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received command QueryState(..)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <signals> node: Signal notifications channel error: receiving on an empty and disconnected channel
1753288187 tests::e2e::test_connection_crossing node: Migrating COBs cache..
1753288187 tests::e2e::test_connection_crossing node: Migration of COBs cache complete (version=2)..
1753288187 tests::e2e::test_connection_crossing node: Default seeding policy set to 'block (all)'
1753288187 tests::e2e::test_connection_crossing node: Initializing service (Test)..
1753288187 tests::e2e::test_connection_crossing node: Opening node database..
1753288187 tests::e2e::test_connection_crossing node: Address book is empty. Adding bootstrap nodes..
1753288187 tests::e2e::test_connection_crossing node: 0 nodes added to address book
1753288187 tests::e2e::test_connection_crossing service: Init @1753288187936
1753288187 tests::e2e::test_connection_crossing service: Empty refs database, populating from storage..
1753288187 tests::e2e::test_connection_crossing service: Not enough available peers to connect to (available=0, wanted=8)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> node: Listening on 0.0.0.0:40283..
1753288187 tests::e2e::test_connection_crossing node: Binding control socket /tmp/.tmpyBizt2/4sPkgxPA/node/control.sock..
1753288187 test: Preferred peer is z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received command QueryState(..)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received command Connect(z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf, 0.0.0.0:39205, ConnectOptions { persistent: false, timeout: 30s })
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Connecting to z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (0.0.0.0:39205)..
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Attempted connection to z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (0.0.0.0:39205)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> wire: Registering outbound transport for z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (fd=14)..
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> wire: Outbound peer resource registered for z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf with id=2 (fd=14)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> wire: Inbound connection from 127.0.0.1:38252 (fd=150)..
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <runtime> node: Running node z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A in /tmp/.tmpyBizt2/4sPkgxPA..
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> wire: Accepted inbound connection from 127.0.0.1:38252 (fd=150)..
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> wire: Inbound peer resource registered with id=2 (fd=150)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <signals> node: Signal notifications channel error: receiving on an empty and disconnected channel
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <control> control: Control thread listening on socket..
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> wire: Session established with z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (id=2) (fd=14) (outbound)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Connected to z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (0.0.0.0:39205) (Outbound)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Subscribing to messages since timestamp 1753201787980..
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received command QueryState(..)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received command QueryState(..)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> wire: Session established with z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A (id=2) (fd=150) (inbound)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Connected to z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A (127.0.0.1:38252) (Inbound)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Subscribing to messages since timestamp 1753201787981..
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received node announcement of z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A with 0 address(es) from z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A (t=1753288187936)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received node announcement of z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf with 0 address(es) from z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (t=1753288187896)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Stored announcement from z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf to be broadcast in 0 millisecond(s) (t=1753288187896)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Stored announcement from z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A to be broadcast in 0 millisecond(s) (t=1753288187936)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Address store entry for node z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf updated at 1753288187896
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received inventory announcement of z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf with 0 item(s) from z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf (t=1753288187897)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Address store entry for node z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A updated at 1753288187936
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received inventory announcement of z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A with 0 item(s) from z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A (t=1753288187937)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Stored announcement from z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf to be broadcast in 0 millisecond(s) (t=1753288187897)
1753288187 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received subscription filter from z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Stored announcement from z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A to be broadcast in 0 millisecond(s) (t=1753288187937)
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received subscription filter from z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received command Connect(z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A, 0.0.0.0:40283, ConnectOptions { persistent: false, timeout: 30s })
1753288187 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Connecting to z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A (0.0.0.0:40283)..
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received command QueryState(..)
1753288188 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received command QueryState(..)
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Received command QueryState(..)
1753288188 test: Ok([Session { nid: PublicKey(z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A), link: Inbound, addr: Address(NetAddr { host: Ip(127.0.0.1), port: 38252 }), state: Connected { since: LocalTime { millis: 1753288187981 }, ping: None, fetching: {}, latencies: [], stable: false } }])
1753288188 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <service> service: Received command QueryState(..)
1753288188 test: Ok([Session { nid: PublicKey(z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf), link: Outbound, addr: Address(NetAddr { host: Ip(0.0.0.0), port: 39205 }), state: Connected { since: LocalTime { millis: 1753288187980 }, ping: None, fetching: {}, latencies: [], stable: false } }])
thread 'tests::e2e::test_connection_crossing' panicked at crates/radicle-node/src/tests/e2e.rs:866:9:
assertion `left == right` failed
left: Inbound
right: Outbound
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1753288188 test: Node z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A shutting down..
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> wire: Disconnecting peer with id=2: connection reset
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> wire: Transport handover for disconnecting peer with id=2 (fd=150)
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Disconnected from z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A (connection reset)
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <service> service: Dropping peer z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A..
1753288188 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <control> control: Received `{"command":"shutdown"}` on control socket
1753288188 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <control> control: Shutdown requested..
1753288188 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <runtime> pool: Worker pool shutting down..
1753288188 z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A <runtime> node: Node shutdown completed for z6MkguaZynNNDCdFrAT1ynh6f5FQ7VdPDFShDUwSyeaMea1A
1753288188 test: Node z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf shutting down..
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <control> control: Received `{"command":"shutdown"}` on control socket
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <control> control: Shutdown requested..
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <runtime> pool: Worker pool shutting down..
1753288188 z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf <runtime> node: Node shutdown completed for z6MkqZaMdSGWEgRYYsDCV2PR9MSfaXrHWyj9SunFKUWY1YVf
failures:
tests::e2e::test_connection_crossing
test result: FAILED. 68 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 17.71s
error: test failed, to rerun pass `-p radicle-node --lib`
Running unittests src/main.rs (target/debug/deps/radicle_node-1bb22b7f18b8f153)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_protocol-1d58ddb89cb1b830)
running 45 tests
test deserializer::test::test_decode_next ... ok
test deserializer::test::test_unparsed ... ok
test deserializer::test::prop_decode_next ... ok
test service::limiter::test::test_limitter_different_rates ... ok
test service::filter::test::test_parameters ... ok
test service::limiter::test::test_limitter_multi ... ok
test service::limiter::test::test_limitter_refill ... ok
test service::filter::test::test_sizes ... ok
test service::gossip::store::test::test_announced ... ok
test service::message::tests::test_inventory_limit ... ok
test wire::frame::test::test_stream_id ... ok
test wire::message::tests::prop_addr ... ok
test service::message::tests::test_ref_remote_limit ... ok
test service::message::tests::prop_refs_announcement_signing ... ok
test wire::message::tests::prop_message_encode_decode ... ok
test wire::message::tests::test_inv_ann_max_size ... ok
test wire::message::tests::test_node_ann_max_size ... ok
test wire::message::tests::test_ping_encode_size_overflow - should panic ... ok
test wire::message::tests::test_pingpong_encode_max_size ... ok
test wire::message::tests::test_pong_encode_size_overflow - should panic ... ok
test wire::message::tests::prop_zero_bytes_encode_decode ... ok
test wire::tests::prop_filter ... ok
test wire::tests::prop_id ... ok
test wire::tests::prop_oid ... ok
test wire::tests::prop_pubkey ... ok
test wire::tests::prop_refs ... ok
test wire::tests::prop_signature ... ok
test wire::tests::prop_signed_refs ... ok
test wire::tests::prop_string ... ok
test wire::tests::prop_tuple ... ok
test wire::tests::prop_u16 ... ok
test wire::tests::prop_u32 ... ok
test wire::tests::prop_u64 ... ok
test wire::tests::prop_u8 ... ok
test wire::tests::prop_vec ... ok
test wire::tests::test_alias ... ok
test wire::tests::test_bounded_vec_limit ... ok
test wire::tests::test_filter_invalid ... ok
test wire::tests::test_string ... ok
test wire::varint::test::prop_encode_decode ... ok
test wire::varint::test::test_encode_overflow - should panic ... ok
test wire::varint::test::test_encoding ... ok
test wire::message::tests::prop_message_decoder ... ok
test wire::message::tests::test_refs_ann_max_size ... ok
test service::message::tests::test_node_announcement_validate ... ok
test result: ok. 45 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.92s
Running unittests src/lib.rs (target/debug/deps/radicle_remote_helper-8b2edb530a9f47a2)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/git-remote-rad.rs (target/debug/deps/git_remote_rad-d5b678aeed24ce75)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/main.rs (target/debug/deps/radicle_schemars-069c890a0d54a7f5)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_signals-ad41f42c3d3e47ce)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_ssh-0a612ae4f7514ee0)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_systemd-28e02dc067eac38d)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/lib.rs (target/debug/deps/radicle_term-a183e76cc571a795)
running 20 tests
test ansi::tests::colors_disabled ... ok
test ansi::tests::colors_enabled ... ok
test cell::test::test_width ... ok
test element::test::test_truncate ... ok
test ansi::tests::wrapping ... ok
test element::test::test_width ... ok
test table::test::test_table_border ... ok
test table::test::test_table_border_truncated ... ok
test table::test::test_table_border_maximized ... ok
test table::test::test_table_truncate ... ok
test table::test::test_table ... ok
test table::test::test_table_unicode_truncate ... ok
test table::test::test_truncate ... ok
test table::test::test_table_unicode ... ok
test textarea::test::test_wrapping ... ok
test textarea::test::test_wrapping_code_block ... ok
test vstack::test::test_vstack_maximize ... ok
test textarea::test::test_wrapping_fenced_block ... ok
test vstack::test::test_vstack ... ok
test textarea::test::test_wrapping_paragraphs ... ok
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle
running 1 test
test crates/radicle/src/cob/patch/encoding/review.rs - cob::patch::encoding::review::Review (line 26) ... ignored
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_cli
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_cli_test
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_cob
running 1 test
test crates/radicle-cob/src/backend/git/stable.rs - backend::git::stable::with_advanced_timestamp (line 56) ... ignored
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_crypto
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_dag
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_fetch
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_node
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_protocol
running 6 tests
test crates/radicle-protocol/src/bounded.rs - bounded::BoundedVec<T,N>::max (line 96) ... ok
test crates/radicle-protocol/src/bounded.rs - bounded::BoundedVec<T,N>::truncate (line 50) ... ok
test crates/radicle-protocol/src/bounded.rs - bounded::BoundedVec<T,N>::collect_from (line 30) ... ok
test crates/radicle-protocol/src/bounded.rs - bounded::BoundedVec<T,N>::unbound (line 149) ... ok
test crates/radicle-protocol/src/bounded.rs - bounded::BoundedVec<T,N>::push (line 122) ... ok
test crates/radicle-protocol/src/bounded.rs - bounded::BoundedVec<T,N>::with_capacity (line 66) ... ok
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.51s
Doc-tests radicle_remote_helper
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_signals
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_ssh
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_systemd
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests radicle_term
running 1 test
test crates/radicle-term/src/table.rs - table (line 4) ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.50s
error: 2 targets failed:
`-p radicle-cli --test commands`
`-p radicle-node --lib`
Exit code: 101
{
"response": "finished",
"result": "failure"
}