rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwoodac311023314f169190ee2a10455f97f26876ee7a
{
"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:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "afbed8b741c45ac08c71c55c805dd2c1af99b1d8",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"title": "radicle: the great Canonical rewrite",
"state": {
"status": "merged",
"conflicts": []
},
"before": "8a66e4d04492e3a3db410ace03ecc39e79dbb45c",
"after": "ac311023314f169190ee2a10455f97f26876ee7a",
"commits": [
"ac311023314f169190ee2a10455f97f26876ee7a",
"25543239a8f92857ef536db660d108dc982f66d3"
],
"target": "3fc92f83fe089263c470b328414d923227cf0e4a",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "afbed8b741c45ac08c71c55c805dd2c1af99b1d8",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "This change was inspired by the a story as old as time:\n\n \ud835\udd43\ud835\udd56\ud835\udd65 \ud835\udd66\ud835\udd64 \ud835\udd5e\ud835\udd5a\ud835\udd69 \ud835\udd60\ud835\udd66\ud835\udd63 \ud835\udd53\ud835\udd66\ud835\udd64\ud835\udd5a\ud835\udd5f\ud835\udd56\ud835\udd64\ud835\udd64 \ud835\udd5d\ud835\udd60\ud835\udd58\ud835\udd5a\ud835\udd54 \ud835\udd68\ud835\udd5a\ud835\udd65\ud835\udd59 \ud835\udd60\ud835\udd66\ud835\udd63 \ud835\udd40\ud835\udd46!\n\nIt was motivated by the fact that the canonical quorum logic was spread across\ntwo modules and also two different repositories (in the API sense). The\n`radicle-remote-helper` contained special logic for computing the quorum, and\nalso relied on the logic with `radicle` itself. It would also mix using the\nRadicle storage repository and the working copy repository \u2013 resulting in issues\nwhere objects could exist in one and not the other.\n\nThe change begins by separating away the IO away from any of the business logic\nin the `git::canonical` module. To follow along, there are two important submodules:\n\n1. `voting` captures the different type of voting processes for commits and tags\n\ta. Tags are simple, where one `Oid` means one vote\n\tb. Commits are slightly more complicated. They begin with one `Oid` means one\n vote, but then it is expected that merge bases are calculated for pairs of\n commits. These merge bases are used to increase a vote for an `Oid` if it\n is the merge base of another commit.\n2. `quorum` builds on top of `voting` and uses the voting processes as well as\nthe `threshold` to find the quorum for the tag or commit reference.\n\ta. For tags, the first past the threshold wins, but if multiple pass then it\n is an error.\n\tb. For commits, the merge base process should be used to increase the votes,\n until the caller is ready to find the quorum. At this point, the commits\n that pass the `threshold` are then compared to find the commit that is the\n child-most commit of all other candidates. If they diverge, then an error\n is returned.\n\nThere is also a `convergence` module that captures the logic that is required\nfor the `radicle-remote-helper`. It essentially checks if a candidate object\nmatches the expected objects, tags or commits, and performs the necessary\nconvergence logic \u2013 checking that the candidate commit is converging with\nat least of the other `Did`s.\n\nThese two quorum processes, and the convergence process, essentially act as\nstate machines and can be driven by the use of a Git repository for finding the\nmerge bases. This is where the `effects` module comes in. The `effects` capture\nthe necessary traits that are required to drive the state machines of the quorum\nprocesses. It is expected that a Git repository implements these, and in fact, a\n`git2::Repository` implementation is provided. The traits are useful, since it\nmeans that a `git2::Repository` can be swapped out and the logic would stay the\nsame.\n\nThis all culminates into the new and improved `Canonical` and\n`CanonicalWithConvergence`. Both of which have methods `find_quorum` for\nperforming the quorum process using a *single* provided repository.\n\nThis resulted in the semantic change of requiring that the\n`radicle-remote-helper` pushes the candidate commit, irregardless of whether it\nwill be a fast-forward. For now, this is something that will be accepted while\nthe UX can be improved in the future by providing detailed warnings of the\ndivergence and ways to fix it. The benefit is that the tooling will never stop\nsomeone from diverging if that is in fact what they want to do.",
"base": "7a9d4512f99156681ca879e0794a6ade154af33b",
"oid": "7346d737188d23150ddc5f4ecec11e596ec28b75",
"timestamp": 1754503567
},
{
"id": "d04ac96aaa9c85b62257d732c348f80ea4733227",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Changes:\n- Removed extra newline",
"base": "7a9d4512f99156681ca879e0794a6ade154af33b",
"oid": "b413ece6d33a5864ecfe07696e221fdae75a3f5c",
"timestamp": 1754905210
},
{
"id": "37941020cdf30eecc3d1560bebe5e5029f9c5089",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Review",
"base": "a568e7f4848729ca02d5d5373dfacba289658493",
"oid": "b155828c29a819435b1d494d4ab4cccaa4df6b71",
"timestamp": 1756135764
},
{
"id": "8bcafc2a85235a1687a5f216b94b1abefb2cd8af",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Changes:\n- Rebased\n- Accepted review changes",
"base": "8a66e4d04492e3a3db410ace03ecc39e79dbb45c",
"oid": "ac311023314f169190ee2a10455f97f26876ee7a",
"timestamp": 1756140770
},
{
"id": "9c9a1dde4aa662d0fd96c92f0d48bcde7a4ab353",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Rebase",
"base": "8a66e4d04492e3a3db410ace03ecc39e79dbb45c",
"oid": "690f6b02c0e0d9201807e5711b0e6c6f5a0b5c5a",
"timestamp": 1756141119
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "ef21c432-d317-4408-b8af-de56b0b52452"
},
"info_url": "https://cci.rad.levitte.org//ef21c432-d317-4408-b8af-de56b0b52452.html"
}
Started at: 2026-09-08 02:35:29.049068+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/ef21c432-d317-4408-b8af-de56b0b52452/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 38 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout afbed8b741c45ac08c71c55c805dd2c1af99b1d8
✓ Switched to branch patch/afbed8b at revision 8bcafc2
✓ Branch patch/afbed8b setup to track rad/patches/afbed8b741c45ac08c71c55c805dd2c1af99b1d8
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout ac311023314f169190ee2a10455f97f26876ee7a
HEAD is now at ac311023 remote-helper: remove check for fast-forward
Exit code: 0
$ rad patch show afbed8b741c45ac08c71c55c805dd2c1af99b1d8 -p
╭──────────────────────────────────────────────────────────────────────────────────╮
│ Title radicle: the great Canonical rewrite │
│ Patch afbed8b741c45ac08c71c55c805dd2c1af99b1d8 │
│ Author fintohaps z6Mkire…SQZ3voM │
│ Head ac311023314f169190ee2a10455f97f26876ee7a │
│ Base 8a66e4d04492e3a3db410ace03ecc39e79dbb45c │
│ Target master │
│ Branches patch/afbed8b │
│ Commits ahead 2, behind 881 │
│ Status merged │
│ │
│ This change was inspired by the a story as old as time: │
│ │
│ 𝕃𝕖𝕥 𝕦𝕤 𝕞𝕚𝕩 𝕠𝕦𝕣 𝕓𝕦𝕤𝕚𝕟𝕖𝕤𝕤 𝕝𝕠𝕘𝕚𝕔 𝕨𝕚𝕥𝕙 𝕠𝕦𝕣 𝕀𝕆! │
│ │
│ It was motivated by the fact that the canonical quorum logic was spread across │
│ two modules and also two different repositories (in the API sense). The │
│ `radicle-remote-helper` contained special logic for computing the quorum, and │
│ also relied on the logic with `radicle` itself. It would also mix using the │
│ Radicle storage repository and the working copy repository – resulting in issues │
│ where objects could exist in one and not the other. │
│ │
│ The change begins by separating away the IO away from any of the business logic │
│ in the `git::canonical` module. To follow along, there are two important │
│ submodules: │
│ │
│ 1. `voting` captures the different type of voting processes for commits and tags │
│ a. Tags are simple, where one `Oid` means one vote │
│ b. Commits are slightly more complicated. They begin with one `Oid` means one │
│ vote, but then it is expected that merge bases are calculated for pairs of │
│ commits. These merge bases are used to increase a vote for an `Oid` if it │
│ is the merge base of another commit. │
│ 2. `quorum` builds on top of `voting` and uses the voting processes as well as │
│ the `threshold` to find the quorum for the tag or commit reference. │
│ a. For tags, the first past the threshold wins, but if multiple pass then it │
│ is an error. │
│ b. For commits, the merge base process should be used to increase the votes, │
│ until the caller is ready to find the quorum. At this point, the commits │
│ that pass the `threshold` are then compared to find the commit that is the │
│ child-most commit of all other candidates. If they diverge, then an error │
│ is returned. │
│ │
│ There is also a `convergence` module that captures the logic that is required │
│ for the `radicle-remote-helper`. It essentially checks if a candidate object │
│ matches the expected objects, tags or commits, and performs the necessary │
│ convergence logic – checking that the candidate commit is converging with │
│ at least of the other `Did`s. │
│ │
│ These two quorum processes, and the convergence process, essentially act as │
│ state machines and can be driven by the use of a Git repository for finding the │
│ merge bases. This is where the `effects` module comes in. The `effects` capture │
│ the necessary traits that are required to drive the state machines of the quorum │
│ processes. It is expected that a Git repository implements these, and in fact, a │
│ `git2::Repository` implementation is provided. The traits are useful, since it │
│ means that a `git2::Repository` can be swapped out and the logic would stay the │
│ same. │
│ │
│ This all culminates into the new and improved `Canonical` and │
│ `CanonicalWithConvergence`. Both of which have methods `find_quorum` for │
│ performing the quorum process using a *single* provided repository. │
│ │
│ This resulted in the semantic change of requiring that the │
│ `radicle-remote-helper` pushes the candidate commit, irregardless of whether it │
│ will be a fast-forward. For now, this is something that will be accepted while │
│ the UX can be improved in the future by providing detailed warnings of the │
│ divergence and ways to fix it. The benefit is that the tooling will never stop │
│ someone from diverging if that is in fact what they want to do. │
├──────────────────────────────────────────────────────────────────────────────────┤
│ ac31102 remote-helper: remove check for fast-forward │
│ 2554323 radicle: the great Canonical rewrite │
├──────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision afbed8b @ 7a9d451..7346d73 by fintohaps z6Mkire…SQZ3voM 1 year ago │
│ ↑ Revision d04ac96 @ 7a9d451..b413ece by fintohaps z6Mkire…SQZ3voM 1 year ago │
│ ↑ Revision 3794102 @ a568e7f..b155828 by lorenz z6MkkPv…WX5sTEz 1 year ago │
│ ↑ Revision 8bcafc2 @ 8a66e4d..ac31102 by fintohaps z6Mkire…SQZ3voM 1 year ago │
│ ↑ Revision 9c9a1dd @ 8a66e4d..690f6b0 by lorenz z6MkkPv…WX5sTEz 1 year ago │
│ └─ ✓ merged by lorenz z6MkkPv…WX5sTEz │
╰──────────────────────────────────────────────────────────────────────────────────╯
commit ac311023314f169190ee2a10455f97f26876ee7a
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Wed Aug 6 07:43:20 2025 +0100
remote-helper: remove check for fast-forward
Since the commit is now always pushed to the Radicle storage, there is no need
to check for fast-forward. If heads diverge, it will be reported by the quorum
error.
diff --git a/crates/radicle-remote-helper/src/push.rs b/crates/radicle-remote-helper/src/push.rs
index 494875c1c..c41770a89 100644
--- a/crates/radicle-remote-helper/src/push.rs
+++ b/crates/radicle-remote-helper/src/push.rs
@@ -361,9 +361,9 @@ pub fn run(
.ok_or(Error::UnknownObjectType { oid: *src })?;
let canonical = canonical::Canonical::new(me, object, canonical)?;
- match canonical.quorum(&working) {
+ match canonical.quorum() {
Ok(quorum) => set_canonical_refs.push(quorum),
- Err(e) => canonical::io::handle_error(e, &dst, hints)?,
+ Err(e) => canonical::io::handle_error(e)?,
}
}
Ok(explorer)
diff --git a/crates/radicle-remote-helper/src/push/canonical.rs b/crates/radicle-remote-helper/src/push/canonical.rs
index 2691b8ade..ba0640e54 100644
--- a/crates/radicle-remote-helper/src/push/canonical.rs
+++ b/crates/radicle-remote-helper/src/push/canonical.rs
@@ -1,24 +1,12 @@
use radicle::git;
use radicle::git::canonical;
use radicle::git::canonical::effects;
-use radicle::git::raw::Repository;
+use radicle::git::canonical::error::QuorumError;
+use radicle::git::canonical::QuorumWithConvergence;
use radicle::prelude::Did;
-use super::error;
-
-pub(crate) struct Vote {
- object: canonical::Object,
-}
-
-impl Vote {
- pub(crate) fn id(&self) -> git::Oid {
- self.object.id()
- }
-}
-
/// Validates a vote to update a canonical reference during push.
pub(crate) struct Canonical<'a, 'b, 'r, R> {
- vote: Vote,
canonical: canonical::CanonicalWithConvergence<'a, 'b, 'r, R>,
}
@@ -33,7 +21,6 @@ where
) -> Result<Self, canonical::error::FindObjectsError> {
let canonical = canonical.find_objects()?;
Ok(Self {
- vote: Vote { object },
canonical: canonical.with_convergence(me, object),
})
}
@@ -55,89 +42,47 @@ where
/// Ensures that the new head and the canonical commit do not diverge.
///
/// [`head`]: crate::push::canonical::Canonical::head
- pub fn quorum(
- self,
- working: &Repository,
- ) -> Result<(git::Qualified<'a>, canonical::Object), error::Canonical> {
- match self.canonical.quorum() {
- Ok(result) => {
- let canonical::QuorumWithConvergence { quorum, converges } = result;
- let canonical::Quorum { refname, object } = quorum;
- let quorum_head = object.id();
- // Canonical head is an ancestor of head.
- let is_ff = self.vote.id() == quorum_head
- || working
- .graph_descendant_of(*self.vote.id(), *quorum_head)
- .map_err(|err| {
- error::Canonical::graph_descendant(self.vote.id(), quorum_head, err)
- })?;
-
- if !is_ff && !converges {
- Err(error::Canonical::heads_diverge(self.vote.id(), quorum_head))
- } else {
- Ok((refname, object))
- }
- }
- Err(err) => Err(err.into()),
- }
+ pub fn quorum(self) -> Result<(git::Qualified<'a>, canonical::Object), QuorumError> {
+ self.canonical
+ .quorum()
+ .map(|QuorumWithConvergence { quorum, .. }| (quorum.refname, quorum.object))
}
}
pub(crate) mod io {
- use radicle::git;
use radicle::git::canonical::error::QuorumError;
use crate::push::error;
- use crate::{hint, warn};
+ use crate::warn;
/// Handle recoverable errors, printing relevant information to the
/// terminal. Otherwise, convert the error into an unrecoverable error
/// [`error::CanonicalUnrecoverable`].
- pub fn handle_error(
- e: error::Canonical,
- canonical: &git::Qualified,
- hints: bool,
- ) -> Result<(), error::CanonicalUnrecoverable> {
+ pub fn handle_error(e: QuorumError) -> Result<(), error::CanonicalUnrecoverable> {
match e {
- error::Canonical::GraphDescendant(e) => Err(e.into()),
- error::Canonical::HeadsDiverge(e) => {
- if hints {
- hint(
- format!("you are attempting to push a commit that would cause \
- your upstream to diverge from the canonical reference {canonical}"),
- );
- hint(
- "to integrate the remote changes, run `git pull --rebase` \
- and try again",
- );
- }
- Err(e.into())
+ QuorumError::Convergence(err) => Err(err.into()),
+ QuorumError::MergeBase(err) => Err(err.into()),
+ e @ QuorumError::DivergingCommits { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find a commit to agree upon");
+ Ok(())
+ }
+ e @ QuorumError::DivergingTags { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find a tag to agree upon");
+ Ok(())
+ }
+ e @ QuorumError::DifferentTypes { .. } => {
+ warn(e.to_string());
+ warn(
+ "it is recommended to find an object type (either commit or tag) to agree upon",
+ );
+ Ok(())
}
- error::Canonical::Quorum(e) => {
- match e {
- QuorumError::Convergence(err) => Err(err.into()),
- QuorumError::MergeBase(err) => Err(err.into()),
- e @ QuorumError::DivergingCommits { .. } => {
- warn(e.to_string());
- warn("it is recommended to find a commit to agree upon");
- Ok(())
- }
- e @ QuorumError::DivergingTags { .. } => {
- warn(e.to_string());
- warn("it is recommended to find a tag to agree upon");
- Ok(())
- }
- e @ QuorumError::DifferentTypes { .. } => {
- warn(e.to_string());
- warn("it is recommended to find an object type (either commit or tag) to agree upon");
- Ok(())
- }
- e @ QuorumError::NoCandidates { .. } => {
- warn(e.to_string());
- warn("it is recommended to find an object (either commit or tag) to agree upon");
- Ok(())
- }
- }
+ e @ QuorumError::NoCandidates { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find an object (either commit or tag) to agree upon");
+ Ok(())
}
}
}
diff --git a/crates/radicle-remote-helper/src/push/error.rs b/crates/radicle-remote-helper/src/push/error.rs
index abc2abc09..e65be9e1b 100644
--- a/crates/radicle-remote-helper/src/push/error.rs
+++ b/crates/radicle-remote-helper/src/push/error.rs
@@ -18,30 +18,6 @@ pub enum CanonicalUnrecoverable {
Git { source: git::raw::Error },
}
-#[derive(Debug, Error)]
-pub enum Canonical {
- #[error(transparent)]
- GraphDescendant(GraphDescendant),
- #[error(transparent)]
- HeadsDiverge(HeadsDiverge),
- #[error(transparent)]
- Quorum(#[from] canonical::error::QuorumError),
-}
-
-impl Canonical {
- pub fn graph_descendant(head: git::Oid, canonical: git::Oid, source: git::raw::Error) -> Self {
- Self::GraphDescendant(GraphDescendant {
- head,
- canonical,
- source,
- })
- }
-
- pub fn heads_diverge(head: git::Oid, canonical: git::Oid) -> Self {
- Self::HeadsDiverge(HeadsDiverge { head, canonical })
- }
-}
-
#[derive(Debug, Error)]
#[error("failed to check if {head} is an ancestor of {canonical} due to: {source}")]
pub struct GraphDescendant {
commit 25543239a8f92857ef536db660d108dc982f66d3
Author: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
Date: Wed Jul 23 22:04:40 2025 +0200
radicle: the great Canonical rewrite
This change was inspired by the a story as old as time:
𝕃𝕖𝕥 𝕦𝕤 𝕞𝕚𝕩 𝕠𝕦𝕣 𝕓𝕦𝕤𝕚𝕟𝕖𝕤𝕤 𝕝𝕠𝕘𝕚𝕔 𝕨𝕚𝕥𝕙 𝕠𝕦𝕣 𝕀𝕆!
It was motivated by the fact that the canonical quorum logic was spread across
two modules and also two different repositories (in the API sense). The
`radicle-remote-helper` contained special logic for computing the quorum, and
also relied on the logic with `radicle` itself. It would also mix using the
Radicle storage repository and the working copy repository – resulting in issues
where objects could exist in one and not the other.
The change begins by separating away the IO away from any of the business logic
in the `git::canonical` module. To follow along, there are two important submodules:
1. `voting` captures the different type of voting processes for commits and tags
a. Tags are simple, where one `Oid` means one vote
b. Commits are slightly more complicated. They begin with one `Oid` means one
vote, but then it is expected that merge bases are calculated for pairs of
commits. These merge bases are used to increase a vote for an `Oid` if it
is the merge base of another commit.
2. `quorum` builds on top of `voting` and uses the voting processes as well as
the `threshold` to find the quorum for the tag or commit reference.
a. For tags, the first past the threshold wins, but if multiple pass then it
is an error.
b. For commits, the merge base process should be used to increase the votes,
until the caller is ready to find the quorum. At this point, the commits
that pass the `threshold` are then compared to find the commit that is the
child-most commit of all other candidates. If they diverge, then an error
is returned.
There is also a `convergence` module that captures the logic that is required
for the `radicle-remote-helper`. It essentially checks if a candidate object
matches the expected objects, tags or commits, and performs the necessary
convergence logic – checking that the candidate commit is converging with
at least of the other `Did`s.
These two quorum processes, and the convergence process, essentially act as
state machines and can be driven by the use of a Git repository for finding the
merge bases. This is where the `effects` module comes in. The `effects` capture
the necessary traits that are required to drive the state machines of the quorum
processes. It is expected that a Git repository implements these, and in fact, a
`git2::Repository` implementation is provided. The traits are useful, since it
means that a `git2::Repository` can be swapped out and the logic would stay the
same.
This all culminates into the new and improved `Canonical` and
`CanonicalWithConvergence`. Both of which have methods `find_quorum` for
performing the quorum process using a *single* provided repository.
This resulted in the semantic change of requiring that the
`radicle-remote-helper` pushes the candidate commit, irregardless of whether it
will be a fast-forward. For now, this is something that will be accepted while
the UX can be improved in the future by providing detailed warnings of the
divergence and ways to fix it. The benefit is that the tooling will never stop
someone from diverging if that is in fact what they want to do.
diff --git a/crates/radicle-cli/examples/git/git-push-canonical-annotated-tags.md b/crates/radicle-cli/examples/git/git-push-canonical-annotated-tags.md
index 6b01e9ef3..609229a0a 100644
--- a/crates/radicle-cli/examples/git/git-push-canonical-annotated-tags.md
+++ b/crates/radicle-cli/examples/git/git-push-canonical-annotated-tags.md
@@ -93,6 +93,8 @@ Now, Alice will create an annotated tag and push it:
$ git tag -a -m "Hotfix for release 1" v1.0-hotfix
$ git cat-file -t v1.0-hotfix
tag
+$ git cat-file -t ac51a0746a5e8311829bc481202909a1e3acc0c2
+tag
```
``` ~alice (stderr)
diff --git a/crates/radicle-cli/examples/git/git-push-diverge.md b/crates/radicle-cli/examples/git/git-push-diverge.md
index 424eab755..4a79a1aa1 100644
--- a/crates/radicle-cli/examples/git/git-push-diverge.md
+++ b/crates/radicle-cli/examples/git/git-push-diverge.md
@@ -29,30 +29,31 @@ As Alice, we fetch that code, but commit on top of our own master, which is no
longer canonical, since Bob pushed a more recent commit, and the threshold is 1:
``` ~alice
-$ rad remote add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --fetch --no-sync
-✓ Remote bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk added
-✓ Remote-tracking branch bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master created for z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
+$ rad remote add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --name bob --fetch --no-sync
+✓ Remote bob added
+✓ Remote-tracking branch bob/master created for z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
$ git branch -arv
- bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master 319a7dc Third commit
- rad/master f2de534 Second commit
+ bob/master 319a7dc Third commit
+ rad/master f2de534 Second commit
$ git commit -m "Third commit by Alice" --allow-empty -q
```
If we try to push now, we get an error with a hint, telling us that we need to
integrate Bob's changes before pushing ours:
-``` ~alice (stderr) (fail) RAD_HINT=1
+``` ~alice (stderr)
$ git push rad
-hint: you are attempting to push a commit that would cause your upstream to diverge from the canonical reference refs/heads/master
-hint: to integrate the remote changes, run `git pull --rebase` and try again
-error: refusing to update canonical reference to commit that is not a descendant of current canonical head
-error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'
+warn: could not determine target commit for canonical reference 'refs/heads/master', found diverging commits 2e8758fc512cbdef298c86feddff5ba3280e94b4 and 319a7dc3b195368ded4b099f8c90bbb80addccd3, with base commit f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 and threshold 1
+warn: it is recommended to find a commit to agree upon
+✓ Synced with 1 seed(s)
+To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
+ f2de534..2e8758f master -> master
```
We do that, and notice that we're now able to push our code:
``` ~alice
-$ git pull --rebase
+$ git pull bob master --rebase
$ git log --oneline
f6cff86 Third commit by Alice
319a7dc Third commit
@@ -60,10 +61,10 @@ f2de534 Second commit
08c788d Initial commit
```
``` ~alice RAD_SOCKET=/dev/null (stderr)
-$ git push rad
+$ git push rad -f
✓ Canonical reference refs/heads/master updated to target commit f6cff86594495e9beccfeda7c20173e55c1dd9fc
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
- f2de534..f6cff86 master -> master
+ + 2e8758f...f6cff86 master -> master (forced update)
```
One thing of note is that we can revert to an older commit as long as we are
diff --git a/crates/radicle-cli/examples/rad-id-missing-commits.md b/crates/radicle-cli/examples/rad-id-missing-commits.md
deleted file mode 100644
index f684811e5..000000000
--- a/crates/radicle-cli/examples/rad-id-missing-commits.md
+++ /dev/null
@@ -1,90 +0,0 @@
-Sometimes, commits may appear missing in the working copy when pushing to the
-default branch. In this scenario, we show this happening, and then how to
-recover from the problem.
-
-First, we need to be in a scenario where there is more than one delegate:
-
-``` ~alice
-$ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk -q
-7be665f9fccba97abb21b2fa85a6fd3181c72858
-```
-
-``` ~alice
-$ rad follow did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
-✓ Follow policy updated for z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
-$ rad sync
-Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 1 potential seed(s).
-✓ Target met: 1 seed(s)
-🌱 Fetched from z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
-✓ Synced with 1 seed(s)
-$ rad id update --title "Bump threshold" --description "Bumping threshold to 2" --threshold 2 -q
-f515dc5af139b8eb9fa817df3f637f2acc29c12b
-$ rad sync -a
-✓ Synced with 1 seed(s)
-```
-
-``` ~bob
-$ rad id accept f515dc5af139b8eb9fa817df3f637f2acc29c12b -q
-$ rad sync -a
-✓ Synced with 1 seed(s)
-```
-
-At this stage, Bob makes some changes at the same time, updating the default
-branch:
-
-``` ~bob (stderr) RAD_SOCKET=/dev/null
-$ touch README.md
-$ git add README.md
-$ git commit -m "Add README"
-$ git push rad master
-To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
- f2de534..361f146 master -> master
-```
-
-Alice, is also busy making some changes:
-
-``` ~alice
-$ rad sync -f
-Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 1 potential seed(s).
-✓ Target met: 1 seed(s)
-🌱 Fetched from z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
-```
-
-``` ~alice
-$ touch LICENSE
-$ git add LICENSE
-$ git commit -m "Add LICENSE"
-[master 62d19fd] Add LICENSE
- 1 file changed, 0 insertions(+), 0 deletions(-)
- create mode 100644 LICENSE
-```
-
-However, when she goes to push to the default branch she sees an error about a missing commit from Bob:
-
-``` ~alice (fails) (stderr)
-$ git push rad master
-error: the commit 361f146ec7339fffdea1ea586f51410250bec9cf for did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk is missing from the repository [..]
-error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'
-```
-
-The reason for this is that when attempting to compute the canonical commit for
-the default branch, there are some checks to see if the delegates agree on the
-new commit. In this case, Bob's commit was not available to perform this check,
-so, Alice must fetch from Bob's state of the repository. She can do this by
-adding him as a remote:
-
-``` ~alice
-$ rad remote add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --name "bob"
-✓ Remote bob added
-✓ Remote-tracking branch bob/master created for z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
-```
-
-
-``` ~alice (stderr) RAD_SOCKET=/dev/null
-$ git push rad master
-To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
- f2de534..62d19fd master -> master
-```
-
-Note that if the remote tracking branch already exists, then she can simply `git
-fetch bob/master`.
diff --git a/crates/radicle-cli/tests/commands.rs b/crates/radicle-cli/tests/commands.rs
index 0d5e53ae3..4529e615d 100644
--- a/crates/radicle-cli/tests/commands.rs
+++ b/crates/radicle-cli/tests/commands.rs
@@ -461,47 +461,6 @@ fn rad_id_threshold_soft_fork() {
.unwrap();
}
-#[test]
-fn rad_id_missing_commits() {
- let mut environment = Environment::new();
- let alice = environment.node("alice");
- let bob = environment.node("bob");
- let acme = RepoId::from_str("z42hL2jL4XNk6K8oHQaSWfMgCL7ji").unwrap();
-
- environment.repository(&alice);
-
- test(
- "examples/rad-init.md",
- environment.work(&alice),
- Some(&alice.home),
- [],
- )
- .unwrap();
-
- let mut alice = alice.spawn();
- let mut bob = bob.spawn();
-
- bob.handle.seed(acme, Scope::All).unwrap();
- alice.connect(&bob).converge([&bob]);
-
- bob.fork(acme, environment.work(&bob)).unwrap();
-
- formula(&environment.tempdir(), "examples/rad-id-missing-commits.md")
- .unwrap()
- .home(
- "alice",
- environment.work(&alice),
- [("RAD_HOME", alice.home.path().display())],
- )
- .home(
- "bob",
- environment.work(&bob).join("heartwood"),
- [("RAD_HOME", bob.home.path().display())],
- )
- .run()
- .unwrap();
-}
-
#[test]
fn rad_id_update_delete_field() {
Environment::alice(["rad-init", "rad-id-update-delete-field"]);
diff --git a/crates/radicle-node/src/worker/fetch.rs b/crates/radicle-node/src/worker/fetch.rs
index 40eebfd82..53428355b 100644
--- a/crates/radicle-node/src/worker/fetch.rs
+++ b/crates/radicle-node/src/worker/fetch.rs
@@ -122,9 +122,6 @@ impl Handle {
log::trace!(target: "worker", "Set HEAD to {}", head.new);
}
}
- Err(RepositoryError::Quorum(
- radicle::git::canonical::error::QuorumError::Git(e),
- )) => return Err(e.into()),
Err(RepositoryError::Quorum(e)) => {
log::warn!(target: "worker", "Fetch could not set HEAD: {e}")
}
@@ -390,15 +387,19 @@ fn set_canonical_refs(repo: &Repository, applied: &Applied) -> Result<(), error:
let name = name.strip_namespace();
let canonical = match rules.canonical(name.clone(), repo) {
- Ok(Some(canonical)) => canonical,
- Ok(None) => continue,
- Err(e) => {
- log::warn!(target: "worker", "Failed to get canonical reference rule for {name}: {e}");
+ Some(canonical) => canonical,
+ None => continue,
+ };
+
+ let canonical = match canonical.find_objects() {
+ Err(err) => {
+ log::warn!(target: "worker", "Failed to find objects for canonical computation: {err}");
continue;
}
+ Ok(canonical) => canonical,
};
- match canonical.quorum(&repo.backend) {
+ match canonical.quorum() {
Err(err) => {
log::warn!(
target: "worker",
@@ -406,7 +407,10 @@ fn set_canonical_refs(repo: &Repository, applied: &Applied) -> Result<(), error:
);
continue;
}
- Ok((refname, _, oid)) => {
+ Ok(git::canonical::Quorum {
+ refname, object, ..
+ }) => {
+ let oid = object.id();
if let Err(e) = repo.backend.reference(
refname.clone().as_str(),
*oid,
diff --git a/crates/radicle-remote-helper/src/push.rs b/crates/radicle-remote-helper/src/push.rs
index 56b3678e1..494875c1c 100644
--- a/crates/radicle-remote-helper/src/push.rs
+++ b/crates/radicle-remote-helper/src/push.rs
@@ -120,10 +120,10 @@ pub enum Error {
PushAction(#[from] error::PushAction),
#[error(transparent)]
Canonical(#[from] error::CanonicalUnrecoverable),
- #[error(transparent)]
- CanonicalInit(#[from] radicle::git::canonical::error::CanonicalError),
#[error("could not determine object type for {oid}")]
UnknownObjectType { oid: git::Oid },
+ #[error(transparent)]
+ FindObjects(#[from] git::canonical::error::FindObjectsError),
}
/// Push command.
@@ -284,7 +284,7 @@ pub fn run(
let identity = stored.identity()?;
let project = identity.project()?;
let canonical_ref = git::refs::branch(project.default_branch());
- let mut set_canonical_refs: Vec<(git::Qualified, git::raw::ObjectType, git::Oid)> =
+ let mut set_canonical_refs: Vec<(git::Qualified, git::canonical::Object)> =
Vec::with_capacity(specs.len());
let working = git::raw::Repository::open(working)?;
@@ -346,26 +346,27 @@ pub fn run(
let rules = crefs.rules();
let me = Did::from(nid);
+ let explorer =
+ push(src, &dst, *force, &nid, &working, stored, patches, &signer)?;
// If we're trying to update the canonical head, make sure
// we don't diverge from the current head. This only applies
// to repos with more than one delegate.
//
// Note that we *do* allow rolling back to a previous commit on the
// canonical branch.
- if let Some(canonical) = rules.canonical(dst.clone(), stored)? {
- let kind = working
- .find_object(**src, None)?
- .kind()
- .and_then(git::canonical::CanonicalObjectType::new)
+ if let Some(canonical) = rules.canonical(dst.clone(), stored) {
+ let object = working
+ .find_object(**src, None)
+ .map(|obj| git::canonical::Object::new(&obj))?
.ok_or(Error::UnknownObjectType { oid: *src })?;
- let canonical = canonical::Canonical::new(me, *src, kind, canonical);
+ let canonical = canonical::Canonical::new(me, object, canonical)?;
match canonical.quorum(&working) {
Ok(quorum) => set_canonical_refs.push(quorum),
Err(e) => canonical::io::handle_error(e, &dst, hints)?,
}
}
- push(src, &dst, *force, &nid, &working, stored, patches, &signer)
+ Ok(explorer)
}
}
}
@@ -386,7 +387,9 @@ pub fn run(
if !ok.is_empty() {
let _ = stored.sign_refs(&signer)?;
- for (refname, kind, oid) in &set_canonical_refs {
+ for (refname, object) in &set_canonical_refs {
+ let oid = object.id();
+ let kind = object.object_type();
let print_update = || {
eprintln!(
"{} Canonical reference {} updated to target {kind} {}",
@@ -409,10 +412,10 @@ pub fn run(
}
match stored.backend.refname_to_id(refname.as_str()) {
- Ok(new) if new != **oid => {
+ Ok(new) if new != *oid => {
stored.backend.reference(
refname.as_str(),
- **oid,
+ *oid,
true,
"set-canonical-reference from git-push (radicle)",
)?;
@@ -421,7 +424,7 @@ pub fn run(
Err(e) if e.code() == git::raw::ErrorCode::NotFound => {
stored.backend.reference(
refname.as_str(),
- **oid,
+ *oid,
true,
"set-canonical-reference from git-push (radicle)",
)?;
diff --git a/crates/radicle-remote-helper/src/push/canonical.rs b/crates/radicle-remote-helper/src/push/canonical.rs
index 524402e46..2691b8ade 100644
--- a/crates/radicle-remote-helper/src/push/canonical.rs
+++ b/crates/radicle-remote-helper/src/push/canonical.rs
@@ -1,36 +1,41 @@
use radicle::git;
+use radicle::git::canonical;
+use radicle::git::canonical::effects;
use radicle::git::raw::Repository;
use radicle::prelude::Did;
use super::error;
pub(crate) struct Vote {
- did: Did,
- oid: git::Oid,
- kind: git::canonical::CanonicalObjectType,
+ object: canonical::Object,
+}
+
+impl Vote {
+ pub(crate) fn id(&self) -> git::Oid {
+ self.object.id()
+ }
}
/// Validates a vote to update a canonical reference during push.
-pub(crate) struct Canonical<'a, 'b> {
+pub(crate) struct Canonical<'a, 'b, 'r, R> {
vote: Vote,
- canonical: git::canonical::Canonical<'a, 'b>,
+ canonical: canonical::CanonicalWithConvergence<'a, 'b, 'r, R>,
}
-impl<'a, 'b> Canonical<'a, 'b> {
+impl<'a, 'b, 'r, R> Canonical<'a, 'b, 'r, R>
+where
+ R: effects::Ancestry + effects::FindMergeBase + effects::FindObjects,
+{
pub fn new(
me: Did,
- head: git::Oid,
- kind: git::canonical::CanonicalObjectType,
- canonical: git::canonical::Canonical<'a, 'b>,
- ) -> Self {
- Self {
- vote: Vote {
- did: me,
- oid: head,
- kind,
- },
- canonical,
- }
+ object: canonical::Object,
+ canonical: canonical::Canonical<'a, 'b, 'r, R, canonical::Initial>,
+ ) -> Result<Self, canonical::error::FindObjectsError> {
+ let canonical = canonical.find_objects()?;
+ Ok(Self {
+ vote: Vote { object },
+ canonical: canonical.with_convergence(me, object),
+ })
}
/// Calculates the quorum of the [`git::canonical::Canonical`] provided.
@@ -51,31 +56,26 @@ impl<'a, 'b> Canonical<'a, 'b> {
///
/// [`head`]: crate::push::canonical::Canonical::head
pub fn quorum(
- mut self,
+ self,
working: &Repository,
- ) -> Result<(git::Qualified<'a>, git::raw::ObjectType, git::Oid), error::Canonical> {
- let converges = self
- .canonical
- .converges(working, (&self.vote.did, &self.vote.oid))?;
- if converges || self.canonical.has_no_tips() || self.canonical.is_only(&self.vote.did) {
- self.canonical
- .modify_vote(self.vote.did, self.vote.oid, self.vote.kind);
- }
-
- match self.canonical.quorum(working) {
- Ok((cref, quorum_type, quorum_head)) => {
+ ) -> Result<(git::Qualified<'a>, canonical::Object), error::Canonical> {
+ match self.canonical.quorum() {
+ Ok(result) => {
+ let canonical::QuorumWithConvergence { quorum, converges } = result;
+ let canonical::Quorum { refname, object } = quorum;
+ let quorum_head = object.id();
// Canonical head is an ancestor of head.
- let is_ff = self.vote.oid == quorum_head
+ let is_ff = self.vote.id() == quorum_head
|| working
- .graph_descendant_of(*self.vote.oid, *quorum_head)
+ .graph_descendant_of(*self.vote.id(), *quorum_head)
.map_err(|err| {
- error::Canonical::graph_descendant(self.vote.oid, quorum_head, err)
+ error::Canonical::graph_descendant(self.vote.id(), quorum_head, err)
})?;
if !is_ff && !converges {
- Err(error::Canonical::heads_diverge(self.vote.oid, quorum_head))
+ Err(error::Canonical::heads_diverge(self.vote.id(), quorum_head))
} else {
- Ok((cref, quorum_type, quorum_head))
+ Ok((refname, object))
}
}
Err(err) => Err(err.into()),
@@ -100,7 +100,6 @@ pub(crate) mod io {
) -> Result<(), error::CanonicalUnrecoverable> {
match e {
error::Canonical::GraphDescendant(e) => Err(e.into()),
- error::Canonical::Converges(e) => Err(e.into()),
error::Canonical::HeadsDiverge(e) => {
if hints {
hint(
@@ -114,31 +113,32 @@ pub(crate) mod io {
}
Err(e.into())
}
- error::Canonical::Quorum(e) => match e {
- e @ QuorumError::DivergingCommits { .. } => {
- warn(e.to_string());
- warn("it is recommended to find a commit to agree upon");
- Ok(())
+ error::Canonical::Quorum(e) => {
+ match e {
+ QuorumError::Convergence(err) => Err(err.into()),
+ QuorumError::MergeBase(err) => Err(err.into()),
+ e @ QuorumError::DivergingCommits { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find a commit to agree upon");
+ Ok(())
+ }
+ e @ QuorumError::DivergingTags { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find a tag to agree upon");
+ Ok(())
+ }
+ e @ QuorumError::DifferentTypes { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find an object type (either commit or tag) to agree upon");
+ Ok(())
+ }
+ e @ QuorumError::NoCandidates { .. } => {
+ warn(e.to_string());
+ warn("it is recommended to find an object (either commit or tag) to agree upon");
+ Ok(())
+ }
}
- e @ QuorumError::DivergingTags { .. } => {
- warn(e.to_string());
- warn("it is recommended to find a tag to agree upon");
- Ok(())
- }
- e @ QuorumError::DifferentTypes { .. } => {
- warn(e.to_string());
- warn("it is recommended to find an object type (either commit or tag) to agree upon");
- Ok(())
- }
- e @ QuorumError::NoCandidates { .. } => {
- warn(e.to_string());
- warn(
- "it is recommended to find an object (either commit or tag) to agree upon",
- );
- Ok(())
- }
- QuorumError::Git(err) => Err(error::CanonicalUnrecoverable::Git { source: err }),
- },
+ }
}
}
}
diff --git a/crates/radicle-remote-helper/src/push/error.rs b/crates/radicle-remote-helper/src/push/error.rs
index 6ce8d1457..abc2abc09 100644
--- a/crates/radicle-remote-helper/src/push/error.rs
+++ b/crates/radicle-remote-helper/src/push/error.rs
@@ -9,6 +9,10 @@ pub enum CanonicalUnrecoverable {
#[error(transparent)]
Converges(#[from] canonical::error::ConvergesError),
#[error(transparent)]
+ MergeBase(#[from] canonical::error::MergeBaseError),
+ #[error(transparent)]
+ FindObjects(#[from] canonical::error::FindObjectsError),
+ #[error(transparent)]
HeadsDiverge(#[from] HeadsDiverge),
#[error("failure while computing canonical reference: {source}")]
Git { source: git::raw::Error },
@@ -19,8 +23,6 @@ pub enum Canonical {
#[error(transparent)]
GraphDescendant(GraphDescendant),
#[error(transparent)]
- Converges(#[from] canonical::error::ConvergesError),
- #[error(transparent)]
HeadsDiverge(HeadsDiverge),
#[error(transparent)]
Quorum(#[from] canonical::error::QuorumError),
diff --git a/crates/radicle/src/git/canonical.rs b/crates/radicle/src/git/canonical.rs
index 3786e856c..aab1d20ee 100644
--- a/crates/radicle/src/git/canonical.rs
+++ b/crates/radicle/src/git/canonical.rs
@@ -1,564 +1,500 @@
pub mod error;
use error::*;
+mod convergence;
+use convergence::Convergence;
+
+mod quorum;
+use quorum::{CommitQuorum, CommitQuorumFailure, TagQuorum, TagQuorumFailure};
+
+mod voting;
+
+pub mod effects;
pub mod rules;
-use nonempty::NonEmpty;
pub use rules::{MatchedRule, RawRule, Rules, ValidRule};
-use std::collections::BTreeMap;
+use std::collections::{BTreeMap, BTreeSet};
use std::fmt;
+use std::marker::PhantomData;
+use std::ops::ControlFlow;
-use raw::ObjectType;
-use raw::Repository;
+use git_ext::ref_format::Namespaced;
use crate::prelude::Did;
-use crate::storage::git;
-use super::raw;
use super::{Oid, Qualified};
-/// A collection of [`Did`]s and their [`Oid`]s that is the tip for a given
-/// reference for that [`Did`].
-///
-/// The general construction of `Canonical` is by using the [`Canonical::new`]
-/// constructor.
+/// A marker for the initial state of [`Canonical`], after construction using
+/// [`Canonical::new`].
+pub struct Initial;
+
+/// A marker for the state of [`Canonical`] once it has found objects for the
+/// calculation, using [`Canonical::find_objects`].
+pub struct ObjectsFound;
+
+/// [`Canonical`] captures the state for finding the quorum between a set of
+/// [`Did`]s and their references, attempting to agree on a Git commit or tag.
///
-/// `Canonical` can then be used for performing calculations about the
-/// canonicity of the reference, most importantly the [`Canonical::quorum`].
+/// Construction happens through [`Canonical::new`], at which point you must use
+/// [`Canonical::find_objects`] so that the state has the set of [`Object`]s it
+/// must use for the quorum calculation.
///
-/// References to the refname and the matched rule are kept, as they
-/// are very handy for generating error messages.
-#[derive(Debug)]
-pub struct Canonical<'a, 'b> {
+/// At this point, the caller can either call [`Canonical::quorum`] to find the
+/// quorum, or modify the calculation by produce a [`CanonicalWithConvergence`]
+/// using [`Canonical::with_convergence`], and then using
+/// [`CanonicalWithConvergence::quorum`].
+pub struct Canonical<'a, 'b, 'r, R, T> {
refname: Qualified<'a>,
rule: &'b ValidRule,
- tips: BTreeMap<Did, (Oid, CanonicalObjectType)>,
+ repo: &'r R,
+ objects: BTreeMap<Did, Object>,
+ missing: Missing,
+ _marker: PhantomData<T>,
}
-/// Supported Git object types for canonical computation.
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-pub enum CanonicalObjectType {
- /// The Git object is a commit.
- Commit,
- /// The Git object is a tag.
- Tag,
+impl<'a, 'b, 'r, R, T> fmt::Debug for Canonical<'a, 'b, 'r, R, T> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ f.debug_struct("Canonical")
+ .field("refname", &self.refname)
+ .field("rule", &self.rule)
+ .field("objects", &self.objects)
+ .field("missing", &self.missing)
+ .finish()
+ }
}
-impl fmt::Display for CanonicalObjectType {
+/// Similar to [`Canonical`], however it checks that a new vote of a single
+/// [`Did`] converges with any other [`Did`], to then see if that provides a
+/// different quorum result.
+pub struct CanonicalWithConvergence<'a, 'b, 'r, R> {
+ canonical: Canonical<'a, 'b, 'r, R, ObjectsFound>,
+ convergence: Convergence<'r, R>,
+}
+
+impl<'a, 'b, 'r, R> fmt::Debug for CanonicalWithConvergence<'a, 'b, 'r, R> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- match self {
- CanonicalObjectType::Commit => f.write_str("commit"),
- CanonicalObjectType::Tag => f.write_str("tag"),
- }
+ f.debug_struct("CanonicalWithConvergence")
+ .field("canonical", &self.canonical)
+ .field("convergence", &self.convergence)
+ .finish()
}
}
-impl CanonicalObjectType {
- /// Construct the [`CanonicalObjectType`] from a [`git2::ObjectType`].
- pub fn new(kind: git::raw::ObjectType) -> Option<Self> {
- match kind {
- ObjectType::Commit => Some(Self::Commit),
- ObjectType::Tag => Some(Self::Tag),
- _ => None,
- }
+impl<'a, 'b, 'r, R> AsRef<Canonical<'a, 'b, 'r, R, ObjectsFound>>
+ for CanonicalWithConvergence<'a, 'b, 'r, R>
+{
+ fn as_ref(&self) -> &Canonical<'a, 'b, 'r, R, ObjectsFound> {
+ &self.canonical
}
}
-impl<'a, 'b> Canonical<'a, 'b> {
- /// Construct the set of canonical tips given for the given `rule` and
- /// the reference `refname`.
- pub fn new(
- repo: &Repository,
- refname: Qualified<'a>,
- rule: &'b ValidRule,
- ) -> Result<Self, CanonicalError> {
- let mut tips = BTreeMap::new();
- for delegate in rule.allowed().iter() {
- let name = &refname.with_namespace(delegate.as_key().into());
-
- let reference = match repo.find_reference(name) {
- Ok(reference) => reference,
- Err(e) if super::ext::is_not_found_err(&e) => {
- log::warn!(
- target: "radicle",
- "Missing `{name}` while calculating the canonical reference",
- );
- continue;
- }
- Err(e) => return Err(CanonicalError::find_reference(name, e)),
- };
-
- let Some(oid) = reference.target() else {
- log::warn!(target: "radicle", "Missing target for reference `{name}`");
- continue;
- };
-
- let kind = Self::find_object_for(delegate, oid.into(), repo)?;
-
- tips.insert(*delegate, (oid.into(), kind));
- }
- Ok(Canonical {
+impl<'a, 'b, 'r, R> Canonical<'a, 'b, 'r, R, Initial>
+where
+ R: effects::Ancestry + effects::FindMergeBase + effects::FindObjects,
+{
+ /// Construct a new [`Canonical`] with the given [`Qualified`] reference, a
+ /// canonical reference [`ValidRule`] for that reference, and the Git
+ /// repository to load and check the Git data.
+ pub fn new(refname: Qualified<'a>, rule: &'b ValidRule, repo: &'r R) -> Self {
+ Self {
refname,
- tips,
rule,
- })
- }
-
- pub fn find_object_for(
- did: &Did,
- oid: Oid,
- repo: &raw::Repository,
- ) -> Result<CanonicalObjectType, CanonicalError> {
- match repo.find_object(*oid, None) {
- Ok(object) => object
- .kind()
- .and_then(CanonicalObjectType::new)
- .ok_or_else(|| {
- CanonicalError::invalid_object_type(
- repo.path().to_path_buf(),
- *did,
- oid,
- object.kind(),
- )
- }),
- Err(err) if super::ext::is_not_found_err(&err) => Err(CanonicalError::missing_object(
- repo.path().to_path_buf(),
- *did,
- oid,
- err,
- )),
- Err(err) => Err(CanonicalError::find_object(oid, err)),
+ repo,
+ missing: Missing::default(),
+ objects: BTreeMap::new(),
+ _marker: PhantomData,
}
}
- /// Returns `true` if there were no tips found for any of the DIDs for
- /// the given reference.
- ///
- /// N.b. this may be the case when a new reference is being created.
- pub fn has_no_tips(&self) -> bool {
- self.tips.is_empty()
- }
-
- pub fn refname(&self) -> &Qualified {
- &self.refname
+ /// Find the objects for the [`Canonical`] computation, and prepare it to
+ /// find the quorum.
+ pub fn find_objects(
+ self,
+ ) -> Result<Canonical<'a, 'b, 'r, R, ObjectsFound>, effects::FindObjectsError> {
+ let FoundObjects {
+ objects,
+ missing_refs,
+ missing_objects,
+ } = self
+ .repo
+ .find_objects(&self.refname, self.rule.allowed().iter())?;
+ let missing = Missing {
+ refs: missing_refs,
+ objects: missing_objects,
+ };
+ Ok(Canonical {
+ refname: self.refname,
+ rule: self.rule,
+ repo: self.repo,
+ missing,
+ objects,
+ _marker: PhantomData,
+ })
}
+}
- /// In some cases, we allow the vote to be modified. For example, when the
- /// `did` is pushing a new commit, we may want to see if the new commit will
- /// reach a quorum.
- pub fn modify_vote(&mut self, did: Did, oid: Oid, kind: CanonicalObjectType) {
- self.tips.insert(did, (oid, kind));
+impl<'a, 'b, 'r, R> Canonical<'a, 'b, 'r, R, ObjectsFound>
+where
+ R: effects::Ancestry + effects::FindMergeBase + effects::FindObjects,
+{
+ /// Adds the check for convergence before finding the quorum.
+ pub fn with_convergence(
+ self,
+ candidate: Did,
+ object: Object,
+ ) -> CanonicalWithConvergence<'a, 'b, 'r, R> {
+ let convergence = Convergence::new(self.repo, candidate, object);
+ CanonicalWithConvergence {
+ canonical: self,
+ convergence,
+ }
}
- /// Check that the provided `did` is part of the set of allowed
- /// DIDs of the matching rule.
- pub fn is_allowed(&self, did: &Did) -> bool {
- self.rule.allowed().contains(did)
+ /// Find the [`Quorum`] for the canonical computation.
+ pub fn quorum(self) -> Result<Quorum<'a>, QuorumError> {
+ let mut finder = QuorumFinder::new(self.refname, self.rule, self.objects.values());
+ while let ControlFlow::Continue(pairs) = finder.find_merge_bases() {
+ let mut bases = Vec::with_capacity(pairs.size_hint().0);
+ for (a, b) in pairs {
+ bases.push(self.repo.merge_base(a, b)?);
+ }
+ finder.found_merge_bases(bases.into_iter());
+ }
+ let refname = finder.refname.clone();
+ let threshold = (*finder.rule.threshold()).into();
+ let results = finder.find_quorum();
+ match results {
+ (Ok(commit), Err(_)) => Ok(commit),
+ (Err(_), Ok(tag)) => Ok(tag),
+ (Ok(_), Ok(_)) => Err(QuorumError::DifferentTypes {
+ refname: refname.to_string(),
+ }),
+ (Err(ec), Err(eq)) => Err(Self::convert_failures(
+ ec,
+ eq,
+ refname.to_string(),
+ threshold,
+ )),
+ }
}
- /// Check that the provided `did` is the only DID in the set of allowed
- /// DIDs of the matching rule.
- pub fn is_only(&self, did: &Did) -> bool {
- self.rule.allowed().is_only(did)
+ /// If there are [`Missing`] objects, these may be reported by the caller,
+ /// and if further objects are found, then these can be marked using
+ /// [`Canonical::found_objects`].
+ pub fn missing(&self) -> &Missing {
+ &self.missing
}
- /// Checks that setting the given candidate tip would converge with at least
- /// one other known tip.
- ///
- /// It converges if the candidate Oid is either equal to, ahead of, or behind any of
- /// the tips.
- pub fn converges(
- &self,
- repo: &Repository,
- (candidate, commit): (&Did, &Oid),
- ) -> Result<bool, ConvergesError> {
- /// Ensures [`Oid`]s are of the same object type
- enum Objects {
- Commits(NonEmpty<Oid>),
- Tags(NonEmpty<Oid>),
+ /// Mark the `objects` provided as found, removing them from the [`Missing`]
+ /// set.
+ pub fn found_objects(&mut self, objects: impl IntoIterator<Item = (Did, Object)>) {
+ let objects = objects.into_iter();
+ for (did, object) in objects {
+ self.missing.found(&did, &self.refname);
+ self.objects.insert(did, object);
}
+ }
- impl Objects {
- fn new(oid: Oid, kind: CanonicalObjectType) -> Self {
- match kind {
- CanonicalObjectType::Commit => Self::Commits(NonEmpty::new(oid)),
- CanonicalObjectType::Tag => Self::Tags(NonEmpty::new(oid)),
+ fn convert_failures(
+ commit: CommitQuorumFailure,
+ tag: TagQuorumFailure,
+ refname: String,
+ threshold: usize,
+ ) -> QuorumError {
+ match (commit, tag) {
+ (CommitQuorumFailure::NoCandidates, TagQuorumFailure::NoCandidates) => {
+ QuorumError::NoCandidates { refname, threshold }
+ }
+ (CommitQuorumFailure::NoCandidates, TagQuorumFailure::DivergingTags { candidates }) => {
+ QuorumError::DivergingTags {
+ refname,
+ threshold,
+ candidates,
}
}
+ (
+ CommitQuorumFailure::DivergingCommits {
+ base,
+ longest,
+ candidate,
+ },
+ _,
+ ) => QuorumError::DivergingCommits {
+ refname,
+ threshold,
+ base,
+ longest,
+ head: candidate,
+ },
+ (CommitQuorumFailure::NoMergeBase { a, b }, _) => {
+ #[derive(thiserror::Error, Debug)]
+ #[error("no existing merge base found for commit quorum")]
+ struct NoMergeBase;
- fn insert(
- mut self,
- oid: Oid,
- kind: CanonicalObjectType,
- ) -> Result<Self, CanonicalObjectType> {
- match self {
- Objects::Commits(ref mut commits) => match kind {
- CanonicalObjectType::Commit => {
- commits.push(oid);
- Ok(self)
- }
- CanonicalObjectType::Tag => Err(CanonicalObjectType::Tag),
- },
- Objects::Tags(ref mut tags) => match kind {
- CanonicalObjectType::Commit => {
- tags.push(oid);
- Ok(self)
- }
- CanonicalObjectType::Tag => Err(CanonicalObjectType::Commit),
- },
- }
+ effects::MergeBaseError::new(a, b, NoMergeBase).into()
}
}
+ }
+}
- let heads = {
- let heads = self
- .tips
- .iter()
- .filter_map(|(did, tip)| (did != candidate).then_some((did, tip)));
-
- let mut objects = None;
-
- for (did, (oid, _)) in heads {
- let kind = find_object_for(did, *oid, repo)?;
- let oid = *oid;
- match objects {
- None => objects = Some(Objects::new(oid, kind)),
- Some(objs) => {
- objects = Some(objs.insert(oid, kind).map_err(|expected| {
- ConvergesError::mismatched_object(
- repo.path().to_path_buf(),
- oid,
- kind,
- expected,
- )
- })?)
- }
+impl<'a, 'b, 'r, R> CanonicalWithConvergence<'a, 'b, 'r, R>
+where
+ R: effects::Ancestry + effects::FindMergeBase + effects::FindObjects,
+{
+ /// Find the [`QuorumWithConvergence`] for the canonical computation.
+ pub fn quorum(mut self) -> Result<QuorumWithConvergence<'a>, QuorumError> {
+ let converges = match self.convergence.check(self.canonical.objects.iter())? {
+ Some((candidate, object)) => {
+ if self.canonical.objects.is_empty()
+ || self.canonical.rule.allowed().is_only(&candidate)
+ {
+ self.canonical.objects.insert(candidate, object);
}
+ true
}
-
- objects
+ None => false,
};
-
- match heads {
- None => Ok(true),
- Some(Objects::Tags(_)) => Ok(true),
- Some(Objects::Commits(heads)) => {
- for head in heads {
- let (ahead, behind) = repo
- .graph_ahead_behind(**commit, *head)
- .map_err(|err| ConvergesError::graph_descendant(*commit, head, err))?;
- if ahead * behind == 0 {
- return Ok(true);
- }
- }
- Ok(false)
- }
- }
+ let quorum = self.canonical.quorum()?;
+ Ok(QuorumWithConvergence { quorum, converges })
}
+}
- fn quorum_tag(&self) -> Result<Oid, QuorumError> {
- let voting =
- TagVoting::from_targets(self.tips.values().filter_map(|(commit, kind)| {
- (*kind == CanonicalObjectType::Tag).then_some(*commit)
- }));
- let mut votes = voting.votes();
-
- // Keep tags which pass the threshold.
- votes.votes_past_threshold(self.threshold());
+/// The result of finding a quorum.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct Quorum<'a> {
+ /// The reference the quorum has been found for.
+ pub refname: Qualified<'a>,
+ /// The object the reference should be updated to.
+ pub object: Object,
+}
- if votes.number_of_candidates() > 1 {
- return Err(QuorumError::DivergingTags {
- refname: self.refname.to_string(),
- threshold: self.threshold(),
- candidates: votes.candidates().cloned().collect(),
- });
- }
+/// Similar to [`Quorum`], but also reports whether the candidate converged with
+/// one of the other voters.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct QuorumWithConvergence<'a> {
+ pub quorum: Quorum<'a>,
+ pub converges: bool,
+}
- let tag = votes
- .pop_first_candidate()
- .ok_or(QuorumError::NoCandidates {
- refname: self.refname.to_string(),
- threshold: self.threshold(),
- })?;
+/// Helper to perform the quorum check for both a [`TagQuorum`] and
+/// [`CommitQuorum`].
+#[derive(Debug)]
+struct QuorumFinder<'a, 'b> {
+ refname: Qualified<'a>,
+ rule: &'b ValidRule,
+ tag_quorum: TagQuorum,
+ commit_quorum: CommitQuorum,
+}
- Ok((*tag).into())
+impl<'a, 'b> QuorumFinder<'a, 'b> {
+ fn new<'c, I>(refname: Qualified<'a>, rule: &'b ValidRule, objects: I) -> Self
+ where
+ I: Iterator<Item = &'c Object> + Clone,
+ {
+ let threshold = *rule.threshold();
+ let tag_quorum = TagQuorum::new(objects.clone(), threshold.into());
+ let commit_quorum = CommitQuorum::new(objects, threshold.into());
+ Self {
+ refname,
+ rule,
+ tag_quorum,
+ commit_quorum,
+ }
}
- /// Computes the quorum or "canonical" tip based on the tips, of `Canonical`,
- /// and the threshold. This can be described as the latest commit that is
- /// included in at least `threshold` histories. In case there are multiple tips
- /// passing the threshold, and they are divergent, an error is returned.
- ///
- /// Also returns an error if `heads` is empty or `threshold` cannot be
- /// satisified with the number of heads given.
- fn quorum_commit(&self, repo: &raw::Repository) -> Result<Oid, QuorumError> {
- let mut voting =
- CommitVoting::from_targets(self.tips.values().filter_map(|(commit, kind)| {
- (*kind == CanonicalObjectType::Commit).then_some(*commit)
- }));
- while let Some(targets) = voting.next_candidate() {
- for (candidate, other) in targets {
- let base = Oid::from(repo.merge_base(*candidate, *other)?);
- voting.found_merge_base(MergeBase {
- candidate,
- other,
- base,
- });
- }
+ fn find_merge_bases(&mut self) -> ControlFlow<(), impl Iterator<Item = (Oid, Oid)>> {
+ match self.commit_quorum.next_candidate() {
+ Some(candidate) => ControlFlow::Continue(candidate),
+ None => ControlFlow::Break(()),
}
- let mut votes = voting.votes();
-
- // Keep commits which pass the threshold.
- votes.votes_past_threshold(self.threshold());
-
- let mut longest = votes
- .pop_first_candidate()
- .ok_or(QuorumError::NoCandidates {
- refname: self.refname.to_string(),
- threshold: self.threshold(),
- })?;
-
- // Now that all scores are calculated, figure out what is the longest branch
- // that passes the threshold. In case of divergence, return an error.
- for head in votes.candidates() {
- let base = repo.merge_base(**head, *longest)?;
-
- if base == *longest {
- // `head` is a successor of `longest`. Update `longest`.
- //
- // o head
- // |
- // o longest (base)
- // |
- //
- longest = *head;
- } else if base == **head || *head == longest {
- // `head` is an ancestor of `longest`, or equal to it. Do nothing.
- //
- // o longest o longest, head (base)
- // | |
- // o head (base) OR o
- // | |
- //
- } else {
- // The merge base between `head` and `longest` (`base`)
- // is neither `head` nor `longest`. Therefore, the branches have
- // diverged.
- //
- // longest head
- // \ /
- // o (base)
- // |
- //
- return Err(QuorumError::DivergingCommits {
- refname: self.refname.to_string(),
- threshold: self.threshold(),
- base: base.into(),
- longest,
- head: *head,
- });
- }
- }
-
- Ok((*longest).into())
}
- /// Computes the quorum or "canonical" tip based on the tips, of `Canonical`,
- /// and the threshold. This can be described as the latest commit that is
- /// included in at least `threshold` histories. In case there are multiple tips
- /// passing the threshold, and they are divergent, an error is returned.
- ///
- /// Also returns an error if `heads` is empty or `threshold` cannot be
- /// satisified with the number of heads given.
- pub fn quorum(
- self,
- repo: &raw::Repository,
- ) -> Result<(Qualified<'a>, ObjectType, Oid), QuorumError> {
- let (oid, kind) = match (self.quorum_commit(repo), self.quorum_tag()) {
- (Ok(commit), Err(_)) => Ok((commit, ObjectType::Commit)),
- (Err(_), Ok(tag)) => Ok((tag, ObjectType::Tag)),
- (Ok(_), Ok(_)) => Err(QuorumError::DifferentTypes {
- refname: self.refname.clone().to_string(),
- }),
- (Err(commit), Err(QuorumError::NoCandidates { .. })) => Err(commit),
- (Err(QuorumError::NoCandidates { .. }), Err(tag)) => Err(tag),
- (Err(err), _) => Err(err),
- }?;
-
- Ok((self.refname, kind, oid))
+ fn found_merge_bases<I>(&mut self, bases: I)
+ where
+ I: Iterator<Item = MergeBase>,
+ {
+ self.commit_quorum.found_merge_bases(bases);
}
- fn threshold(&self) -> usize {
- (*self.rule.threshold()).into()
+ fn find_quorum(
+ self,
+ ) -> (
+ Result<Quorum<'a>, quorum::CommitQuorumFailure>,
+ Result<Quorum<'a>, quorum::TagQuorumFailure>,
+ ) {
+ let commit = self.commit_quorum.find_quorum().map(|id| Quorum {
+ refname: self.refname.clone(),
+ object: Object::Commit { id },
+ });
+ let tag = self.tag_quorum.find_quorum().map(|id| Quorum {
+ refname: self.refname.clone(),
+ object: Object::Tag { id },
+ });
+ (commit, tag)
}
}
-/// Keep track of [`Votes`] for quorums involving tag objects.
-struct TagVoting {
- votes: Votes,
+/// Record a merge base between `a` and `b`.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub struct MergeBase {
+ /// The first commit for the merge base.
+ pub a: Oid,
+ /// The second commit that is being compared against for the merge base.
+ pub b: Oid,
+ /// The computed merge base commit.
+ pub base: Oid,
}
-impl TagVoting {
- fn from_targets(targets: impl Iterator<Item = Oid>) -> Self {
- let votes = targets.fold(Votes::default(), |mut votes, oid| {
- votes.vote(oid);
- votes
- });
- Self { votes }
+impl MergeBase {
+ /// The merge base of the same commit is the commit itself.
+ #[cfg(test)]
+ pub fn trivial(oid: Oid) -> Self {
+ Self {
+ a: oid,
+ b: oid,
+ base: oid,
+ }
+ }
+
+ /// The result of a merge base computation is trivial.
+ pub fn is_trivial(&self) -> bool {
+ if self.a == self.b {
+ // By definition, the merge base of a commit and itself is itself.
+ // These asserts will catch our fall in case we set an invalid
+ // base in this case.
+ debug_assert_eq!(self.a, self.base);
+ debug_assert_eq!(self.b, self.base);
+ true
+ } else {
+ false
+ }
}
- fn votes(self) -> Votes {
- self.votes
+ /// Collapses a non-trivial and linear result of a merge base computation
+ /// into a single commit, if possible.
+ pub fn linear(self) -> Option<Oid> {
+ if self.is_trivial() || (self.a != self.base && self.b != self.base) {
+ None
+ } else {
+ Some(self.base)
+ }
}
}
-/// Keep track of [`Votes`] for quorums involving commit objects.
-///
-/// Build a list of candidate commits and count how many "votes" each of them
-/// has. Commits get a point for each direct vote, as well as for being part of
-/// the ancestry of a commit given to this function.
-#[derive(Debug)]
-struct CommitVoting {
- candidates: Vec<(Oid, Vec<Oid>)>,
- votes: Votes,
+/// The supported type of Git object and its [`Oid`], for canonical computation.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub enum Object {
+ Commit { id: Oid },
+ Tag { id: Oid },
}
-impl CommitVoting {
- /// Build the initial set voting.
- fn from_targets(targets: impl Iterator<Item = Oid> + Clone) -> Self {
- let ts = targets.clone();
- let (candidates, votes) = targets.enumerate().fold(
- (Vec::new(), Votes::default()),
- |(mut candidates, mut votes), (i, oid)| {
- candidates.push((oid, ts.clone().skip(i + 1).collect()));
- votes.vote(oid);
- (candidates, votes)
- },
- );
- Self { candidates, votes }
+impl Object {
+ pub fn new(obj: &crate::git::raw::Object) -> Option<Self> {
+ obj.kind().and_then(|kind| match kind {
+ crate::git::raw::ObjectType::Commit => Some(Self::Commit {
+ id: obj.id().into(),
+ }),
+ crate::git::raw::ObjectType::Tag => Some(Self::Tag {
+ id: obj.id().into(),
+ }),
+ _ => None,
+ })
}
- /// Get the next candidate to be considered for ancestry votes.
- ///
- /// The first of each pair will be the candidate commit, which should be
- /// compared to the other commit to see what their common merge base is. The
- /// merge base is then recorded using [`MergeBase`] and is recorded using
- /// [`CommitVoting::found_merge_base`].
- fn next_candidate(&mut self) -> Option<impl Iterator<Item = (Oid, Oid)>> {
- self.candidates
- .pop()
- .map(|(oid, others)| others.into_iter().map(move |other| (oid, other)))
- }
-
- /// Record a merge base, and add to the vote if necessary.
- fn found_merge_base(
- &mut self,
- MergeBase {
- candidate,
- other,
- base,
- }: MergeBase,
- ) {
- // Avoid double counting the same commits
- let is_same = candidate == other;
- if !is_same && (base == candidate || base == other) {
- self.votes.vote(base);
+ /// The [`Oid`] of the [`Object`]
+ pub fn id(&self) -> Oid {
+ match self {
+ Object::Commit { id } => *id,
+ Object::Tag { id } => *id,
}
}
- /// Finish the voting process and get the [`Votes`] from the
- /// [`CommitVoting`].
- fn votes(self) -> Votes {
- self.votes
+ /// Checks if the object is a Git commit.
+ pub fn is_commit(&self) -> bool {
+ matches!(self, Self::Commit { .. })
}
-}
-/// Record a merge base between `candidate` and `other`.
-struct MergeBase {
- /// The candidate commit for the merge base.
- candidate: Oid,
- /// The commit that is being compared against for the merge base.
- other: Oid,
- /// The computed merge base commit.
- base: Oid,
-}
+ /// Checks if the object is a Git tag.
+ pub fn is_tag(&self) -> bool {
+ matches!(self, Self::Commit { .. })
+ }
-/// Count the number of votes per [`Oid`].
-///
-/// Note that the count cannot exceed 255, since that is the maximum number the
-/// `threshold` value can be.
-#[derive(Debug, Default, PartialEq, Eq)]
-struct Votes {
- inner: BTreeMap<Oid, u8>,
+ /// Returns the [`ObjectType`] of the [`Object`].
+ pub fn object_type(&self) -> ObjectType {
+ match self {
+ Object::Commit { .. } => ObjectType::Commit,
+ Object::Tag { .. } => ObjectType::Tag,
+ }
+ }
}
-impl Votes {
- /// Increase the vote count for `oid`.
- ///
- /// If `oid` does not exist in the set of [`Votes`] yet, then no vote will
- /// be added.
- #[inline]
- fn vote(&mut self, oid: Oid) {
- self.safe_inc(oid, 1);
- }
+/// Supported Git object types for canonical computation
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum ObjectType {
+ /// The Git object corresponds to a commit.
+ Commit,
+ /// The Git object corresponds to a tag.
+ Tag,
+}
- /// Filter the candidates by the ones that have a number of votes that pass
- /// the `threshold`.
- #[inline]
- fn votes_past_threshold(&mut self, threshold: usize) {
- self.inner.retain(|_, votes| *votes as usize >= threshold);
+impl fmt::Display for ObjectType {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ ObjectType::Commit => f.write_str("commit"),
+ ObjectType::Tag => f.write_str("tag"),
+ }
}
+}
- /// Get the number of candidates this set of votes has.
- #[inline]
- fn number_of_candidates(&self) -> usize {
- self.inner.len()
- }
+/// The result of checking the relationship between two commits in the commit graph.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+pub struct GraphAheadBehind {
+ /// The number of commits the given commit is ahead of the other.
+ pub ahead: usize,
+ /// The number of commits the given commit is behind the other.
+ pub behind: usize,
+}
- /// Get the set candidates.
- #[inline]
- fn candidates(&self) -> impl Iterator<Item = &Oid> {
- self.inner.keys()
+impl GraphAheadBehind {
+ /// Whether self represents a linear history between two commits.
+ ///
+ /// The following three conditions are equivalent characterizations of
+ /// a linear history:
+ /// 1. One commit is ahead and not behind of the other.
+ /// 2. One commit is behind and not ahead of the other.
+ /// 3. One commit can be "fast-forwarded" to the other.
+ pub fn is_linear(&self) -> bool {
+ self.ahead * self.behind == 0
}
+}
- /// Pop off the first candidate from the set of votes.
- #[inline]
- fn pop_first_candidate(&mut self) -> Option<Oid> {
- self.inner.pop_first().map(|(oid, _)| oid)
- }
+/// The result of finding a set of objects in a Git repository.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct FoundObjects {
+ /// The found objects, and under which [`Did`] they were found.
+ pub objects: BTreeMap<Did, Object>,
+ /// Any missing references while attempting to find the objects.
+ pub missing_refs: BTreeSet<Namespaced<'static>>,
+ // TODO(finto): I think this doesn't make sense now that we use only one
+ // repository.
+ /// Any missing objects, where the reference was found, but the object was
+ /// missing.
+ pub missing_objects: BTreeMap<Did, Oid>,
+}
- #[inline]
- fn safe_inc(&mut self, oid: Oid, n: u8) {
- let votes = self.inner.entry(oid).or_default();
- *votes = votes.saturating_add(n);
- }
+/// [`Missing`] marks whether there were any missing references or objects.
+#[derive(Clone, Debug, Default, PartialEq, Eq)]
+pub struct Missing {
+ pub refs: BTreeSet<Namespaced<'static>>,
+ pub objects: BTreeMap<Did, Oid>,
}
-fn find_object_for(
- did: &Did,
- oid: Oid,
- repo: &raw::Repository,
-) -> Result<CanonicalObjectType, FindObjectError> {
- match repo.find_object(*oid, None) {
- Ok(object) => object
- .kind()
- .and_then(CanonicalObjectType::new)
- .ok_or_else(|| {
- FindObjectError::invalid_object_type(
- repo.path().to_path_buf(),
- *did,
- oid,
- object.kind(),
- )
- }),
- Err(err) if super::ext::is_not_found_err(&err) => Err(FindObjectError::missing_object(
- repo.path().to_path_buf(),
- *did,
- oid,
- err,
- )),
- Err(err) => Err(FindObjectError::find_object(oid, err)),
+impl Missing {
+ fn found<'a>(&mut self, did: &Did, refname: &Qualified<'a>) {
+ self.objects.remove(did);
+ self.refs
+ .remove(&refname.with_namespace((did.as_key()).into()).to_owned());
}
}
@@ -578,39 +514,43 @@ mod tests {
threshold: usize,
repo: &git::raw::Repository,
) -> Result<Oid, QuorumError> {
- let tips: BTreeMap<Did, (Oid, CanonicalObjectType)> = heads
- .iter()
- .enumerate()
- .map(|(i, head)| {
- let signer = Device::mock_from_seed([(i + 1) as u8; 32]);
- let did = Did::from(signer.public_key());
- let kind = repo
- .find_object(*head, None)
- .unwrap()
- .kind()
- .and_then(CanonicalObjectType::new)
- .unwrap();
- (did, ((*head).into(), kind))
- })
- .collect();
-
let refname =
git::refs::branch(git_ext::ref_format::RefStr::try_from_str("master").unwrap());
+ let mut delegates = Vec::new();
+ for (i, head) in heads.iter().enumerate() {
+ let signer = Device::mock_from_seed([(i + 1) as u8; 32]);
+ let did = Did::from(signer.public_key());
+ delegates.push(did);
+ let ns = git::Component::from(signer.public_key());
+ repo.reference(refname.with_namespace(ns).as_str(), *head, true, "")
+ .unwrap();
+ }
+
let rule: RawRule = crate::git::canonical::rules::Rule::new(
crate::git::canonical::rules::Allowed::Delegates,
threshold,
);
- let delegates = crate::identity::doc::Delegates::new(tips.keys().cloned()).unwrap();
+ let delegates = crate::identity::doc::Delegates::new(delegates).unwrap();
let rule = rule.validate(&mut || delegates.clone()).unwrap();
- Canonical {
- refname,
- tips,
- rule: &rule,
+ Canonical::new(refname, &rule, repo)
+ .find_objects()
+ .unwrap()
+ .quorum()
+ .map(|Quorum { object, .. }| object.id())
+ }
+
+ fn commit(id: &str) -> Object {
+ Object::Commit {
+ id: id.parse().unwrap(),
+ }
+ }
+
+ fn tag(id: &str) -> Object {
+ Object::Tag {
+ id: id.parse().unwrap(),
}
- .quorum(repo)
- .map(|(_, _, oid)| oid)
}
#[test]
@@ -648,202 +588,625 @@ mod tests {
}
#[test]
- fn test_quorum_groups() {
+ fn test_quorum_different_types() {
let tmp = tempfile::tempdir().unwrap();
let (repo, c0) = fixtures::repository(tmp.path());
let c0: git::Oid = c0.into();
- let c1 = fixtures::commit("C1", &[*c0], &repo);
- let c2 = fixtures::commit("C2", &[*c0], &repo);
+ let t0 = fixtures::tag("v1", "", *c0, &repo);
- eprintln!("C0: {c0}");
- eprintln!("C1: {c1}");
- eprintln!("C2: {c2}");
+ assert_matches!(
+ quorum(&[*c0, *t0], 1, &repo),
+ Err(QuorumError::DifferentTypes { .. })
+ );
+ }
+ #[test]
+ fn test_commit_quorum_groups() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+
+ // C1 C2
+ // \ /
+ // C0
+
+ let mut cq = CommitQuorum::new([c1, c2, c1, c2].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: c1.id(),
+ b: c2.id(),
+ base: c0.id(),
+ }]);
assert_matches!(
- quorum(&[*c1, *c2, *c1, *c2], 2, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+ let mut cq = CommitQuorum::new([c1, c2].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: c1.id(),
+ b: c2.id(),
+ base: c0.id(),
+ }]);
assert_matches!(
- quorum(&[*c1, *c2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
}
#[test]
- fn test_quorum_tag() {
- let tmp = tempfile::tempdir().unwrap();
- let (repo, c0) = fixtures::repository(tmp.path());
- let c0: git::Oid = c0.into();
- let c1 = fixtures::commit("C1", &[*c0], &repo);
- let t1 = fixtures::tag("v1", "T1", *c1, &repo);
- let t2 = fixtures::tag("v2", "T2", *c1, &repo);
-
- eprintln!("C0: {c0}");
- eprintln!("C1: {c1}");
- eprintln!("T1: {t1}");
- eprintln!("T2: {t2}");
-
- assert_eq!(quorum(&[*t1], 1, &repo).unwrap(), t1);
- assert_eq!(quorum(&[*t1, *t1], 2, &repo).unwrap(), t1);
+ fn test_tag_quorum() {
+ let t1 = tag("0480391dd7312d35c79a455ec5d004657260b358");
+ let t2 = tag("a2eec713ec5c287ecdf13a0180f68acfef7962d0");
- assert_matches!(
- quorum(&[*t1, *t2], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ assert_eq!(
+ TagQuorum::new([t1].iter(), 1).find_quorum().unwrap(),
+ t1.id()
);
-
- assert_matches!(
- quorum(&[*t1, *c1], 1, &repo),
- Err(QuorumError::DifferentTypes { .. })
+ assert_eq!(
+ TagQuorum::new([t1, t1].iter(), 2).find_quorum().unwrap(),
+ t1.id()
);
-
assert_matches!(
- quorum(&[*t1, *t2], 1, &repo),
- Err(QuorumError::DivergingTags { .. })
+ TagQuorum::new([t1, t2].iter(), 1).find_quorum(),
+ Err(TagQuorumFailure::DivergingTags { .. })
);
}
#[test]
- fn test_quorum() {
- let tmp = tempfile::tempdir().unwrap();
- let (repo, c0) = fixtures::repository(tmp.path());
- let c0: git::Oid = c0.into();
- let c1 = fixtures::commit("C1", &[*c0], &repo);
- let c2 = fixtures::commit("C2", &[*c1], &repo);
- let c3 = fixtures::commit("C3", &[*c1], &repo);
- let b2 = fixtures::commit("B2", &[*c1], &repo);
- let a1 = fixtures::commit("A1", &[*c0], &repo);
- let m1 = fixtures::commit("M1", &[*c2, *b2], &repo);
- let m2 = fixtures::commit("M2", &[*a1, *b2], &repo);
-
- eprintln!("C0: {c0}");
- eprintln!("C1: {c1}");
- eprintln!("C2: {c2}");
- eprintln!("C3: {c3}");
- eprintln!("B2: {b2}");
- eprintln!("A1: {a1}");
- eprintln!("M1: {m1}");
- eprintln!("M2: {m2}");
-
- assert_eq!(quorum(&[*c0], 1, &repo).unwrap(), c0);
- assert_eq!(quorum(&[*c1], 1, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*c2], 1, &repo).unwrap(), c2);
-
- // C1
- // |
- // C0
- assert_eq!(quorum(&[*c1], 1, &repo).unwrap(), c1);
+ fn test_commit_quorum_single() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ assert_eq!(
+ CommitQuorum::new([c0].iter(), 1).find_quorum().unwrap(),
+ c0.id()
+ );
+ assert_eq!(
+ CommitQuorum::new([c1].iter(), 1).find_quorum().unwrap(),
+ c1.id()
+ );
+ assert_eq!(
+ CommitQuorum::new([c2].iter(), 1).find_quorum().unwrap(),
+ c2.id()
+ );
+ }
+ #[test]
+ fn test_commit_quorum_linear() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
// C2
// |
// C1
// |
// C0
- assert_eq!(quorum(&[*c1, *c2], 1, &repo).unwrap(), c2);
- assert_eq!(quorum(&[*c1, *c2], 2, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*c0, *c1, *c2], 3, &repo).unwrap(), c0);
- assert_eq!(quorum(&[*c1, *c1, *c2], 2, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*c1, *c1, *c2], 1, &repo).unwrap(), c2);
- assert_eq!(quorum(&[*c2, *c2, *c1], 1, &repo).unwrap(), c2);
+ let merge_bases = [
+ MergeBase {
+ a: c2.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase::trivial(c2.id()),
+ MergeBase::trivial(c1.id()),
+ MergeBase::trivial(c0.id()),
+ ];
+
+ let mut cq = CommitQuorum::new([c1, c2].iter(), 1);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c2.id());
+
+ let mut cq = CommitQuorum::new([c1, c2].iter(), 2);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([c0, c1, c2].iter(), 3);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c0.id());
+
+ let mut cq = CommitQuorum::new([c1, c1, c2].iter(), 2);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([c1, c1, c2].iter(), 1);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c2.id());
+
+ let mut cq = CommitQuorum::new([c2, c2, c1].iter(), 1);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c2.id());
+ }
+
+ #[test]
+ fn test_commit_quorum_two_way_fork() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ let b2 = commit("037a148170e3d41524b7c482a4798e5c2daeaa00");
+
+ eprintln!("C0: {}", c0.id());
+ eprintln!("C1: {}", c1.id());
+ eprintln!("C2: {}", c2.id());
+ eprintln!("B2: {}", b2.id());
// B2 C2
// \|
// C1
// |
// C0
+ let merge_bases = [
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase::trivial(b2.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase::trivial(c1.id()),
+ MergeBase::trivial(c0.id()),
+ ];
+
+ let mut cq = CommitQuorum::new([c1, c2, b2].iter(), 1);
+ cq.found_merge_bases(merge_bases);
assert_matches!(
- quorum(&[*c1, *c2, *b2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*c2, *b2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*b2, *c2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([c2, b2].iter(), 1);
+ cq.found_merge_bases(merge_bases);
assert_matches!(
- quorum(&[*c2, *b2], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([b2, c2].iter(), 1);
+ cq.found_merge_bases(merge_bases);
assert_matches!(
- quorum(&[*b2, *c2], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
- assert_eq!(quorum(&[*c1, *c2, *b2], 2, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*c1, *c2, *b2], 3, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*b2, *b2, *c2], 2, &repo).unwrap(), b2);
- assert_eq!(quorum(&[*b2, *c2, *c2], 2, &repo).unwrap(), c2);
+
+ // Note for the next two cases we only give enough merge base
+ // information so that the quorum fails. If we provided all
+ // `merge_bases`, it would mean that c0 could be chosen as the quourum.
+ let mut cq = CommitQuorum::new([c2, b2].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ }]);
+ assert_matches!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([b2, c2].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ }]);
+ assert_matches!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([c1, c2, b2].iter(), 2);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([c1, c2, b2].iter(), 3);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([b2, b2, c2].iter(), 2);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), b2.id());
+
+ let mut cq = CommitQuorum::new([b2, c2, c2].iter(), 2);
+ cq.found_merge_bases(merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c2.id());
+
+ let mut cq = CommitQuorum::new([b2, b2, c2, c2].iter(), 2);
+ cq.found_merge_bases(merge_bases);
assert_matches!(
- quorum(&[*b2, *b2, *c2, *c2], 2, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+ }
+
+ #[test]
+ fn test_commit_quorum_three_way_fork() {
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ let c3 = commit("07c2a0f856e0d6b08115f98a265df88c4e507fa0");
+ let b2 = commit("037a148170e3d41524b7c482a4798e5c2daeaa00");
// B2 C2 C3
// \ | /
// C1
// |
// C0
- assert_eq!(quorum(&[*b2, *c2, *c2], 2, &repo).unwrap(), c2);
- assert_matches!(
- quorum(&[*b2, *c2, *c2], 3, &repo),
- Err(QuorumError::NoCandidates { .. })
- );
- assert_matches!(
- quorum(&[*b2, *c2, *b2, *c2], 3, &repo),
- Err(QuorumError::NoCandidates { .. })
- );
- assert_matches!(
- quorum(&[*c3, *b2, *c2, *b2, *c2, *c3], 3, &repo),
- Err(QuorumError::NoCandidates { .. })
- );
+ let mut cq = CommitQuorum::new([b2, c2, c2].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase::trivial(b2.id()),
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), c2.id());
+
+ let mut cq = CommitQuorum::new([b2, c2, c2].iter(), 3);
+ cq.found_merge_bases([
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase::trivial(c2.id()),
+ ]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([b2, c2, b2, c2].iter(), 3);
+ cq.found_merge_bases([
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase::trivial(b2.id()),
+ MergeBase::trivial(c2.id()),
+ ]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([c3, b2, c2, b2, c2, c3].iter(), 3);
+ cq.found_merge_bases([
+ MergeBase {
+ a: c3.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c3.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase::trivial(b2.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase::trivial(c3.id()),
+ ]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+ }
+
+ #[test]
+ fn test_commit_quorum_fork_of_a_fork() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ let b2 = commit("037a148170e3d41524b7c482a4798e5c2daeaa00");
+ let a1 = commit("2224468e22b30359611d880ccf0850d023f86f9b");
// B2 C2
// \|
// A1 C1
// \|
// C0
+ let mut cq = CommitQuorum::new([c2, b2, a1].iter(), 1);
+ cq.found_merge_bases([
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*c2, *b2, *a1], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*c2, *b2, *a1], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
- );
- assert_matches!(
- quorum(&[*c2, *b2, *a1], 3, &repo),
- Err(QuorumError::NoCandidates { .. })
- );
- assert_matches!(
- quorum(&[*c1, *c2, *b2, *a1], 4, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
- assert_eq!(quorum(&[*c0, *c1, *c2, *b2, *a1], 2, &repo).unwrap(), c1,);
- assert_eq!(quorum(&[*c0, *c1, *c2, *b2, *a1], 3, &repo).unwrap(), c1,);
- assert_eq!(quorum(&[*c0, *c2, *b2, *a1], 3, &repo).unwrap(), c0);
- assert_eq!(quorum(&[*c0, *c1, *c2, *b2, *a1], 4, &repo).unwrap(), c0,);
+ let mut cq = CommitQuorum::new([c2, b2, a1].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([c2, b2, a1].iter(), 3);
+ cq.found_merge_bases([
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([c1, c2, b2, a1].iter(), 4);
+ cq.found_merge_bases([
+ MergeBase {
+ a: c1.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let all_merge_bases = [
+ MergeBase {
+ a: c0.id(),
+ b: c1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c0.id(),
+ b: c2.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c0.id(),
+ b: b2.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c0.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: b2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ ];
+ let mut cq = CommitQuorum::new([c0, c1, c2, b2, a1].iter(), 2);
+ cq.found_merge_bases(all_merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([c0, c1, c2, b2, a1].iter(), 3);
+ cq.found_merge_bases(all_merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([c0, c2, b2, a1].iter(), 3);
+ cq.found_merge_bases(all_merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c0.id());
+
+ let mut cq = CommitQuorum::new([c0, c1, c2, b2, a1].iter(), 4);
+ cq.found_merge_bases(all_merge_bases);
+ assert_eq!(cq.find_quorum().unwrap(), c0.id());
+
+ let mut cq = CommitQuorum::new([a1, a1, c2, c2, c1].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(a1.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase {
+ a: a1.id(),
+ b: c2.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: a1.id(),
+ b: c1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: c1.id(),
+ base: c0.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*a1, *a1, *c2, *c2, *c1], 2, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([a1, a1, c2, c2, c1].iter(), 1);
+ cq.found_merge_bases([
+ MergeBase::trivial(a1.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase {
+ a: a1.id(),
+ b: c2.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: a1.id(),
+ b: c1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: c1.id(),
+ base: c0.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*a1, *a1, *c2, *c2, *c1], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([a1, a1, c2, c2, c1].iter(), 1);
+ cq.found_merge_bases([
+ MergeBase::trivial(a1.id()),
+ MergeBase {
+ a: a1.id(),
+ b: c2.id(),
+ base: c0.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*a1, *a1, *c2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([b2, b2, c2, c2].iter(), 1);
+ cq.found_merge_bases([
+ MergeBase::trivial(b2.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*b2, *b2, *c2, *c2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([b2, b2, c2, c2, a1].iter(), 1);
+ cq.found_merge_bases([
+ MergeBase::trivial(b2.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase {
+ a: b2.id(),
+ b: c2.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c2.id(),
+ b: a1.id(),
+ base: c0.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*b2, *b2, *c2, *c2, *a1], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+ }
+
+ #[test]
+ fn test_commit_quorum_forked_merge_commits() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ let b2 = commit("037a148170e3d41524b7c482a4798e5c2daeaa00");
+ let a1 = commit("2224468e22b30359611d880ccf0850d023f86f9b");
+ let m1 = commit("dd7ee5bca2fc7288a6efcb4303278e26a2dbaa45");
+ let m2 = commit("d54e505e3fb5c0c7e4b9a4b8a1cdeefb3fc9ef18");
// M2 M1
// /\ /\
@@ -852,105 +1215,347 @@ mod tests {
// A1 C1
// \|
// C0
- assert_eq!(quorum(&[*m1], 1, &repo).unwrap(), m1);
- assert_matches!(
- quorum(&[*m1, *m2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*m2, *m1], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
+ let cq = CommitQuorum::new([m1].iter(), 1);
+ assert_eq!(cq.find_quorum().unwrap(), m1.id());
+
+ let mut cq = CommitQuorum::new([m1, m2].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: m2.id(),
+ base: b2.id(),
+ }]);
assert_matches!(
- quorum(&[*m1, *m2], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([m2, m1].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m2.id(),
+ b: m1.id(),
+ base: b2.id(),
+ }]);
assert_matches!(
- quorum(&[*m1, *m2, *c2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([m1, m2].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: m2.id(),
+ base: b2.id(),
+ }]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([m1, m2, c2].iter(), 1);
+ cq.found_merge_bases([
+ MergeBase {
+ a: m1.id(),
+ b: m2.id(),
+ base: b2.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: c2.id(),
+ base: c2.id(),
+ },
+ MergeBase {
+ a: m2.id(),
+ b: c2.id(),
+ base: c0.id(),
+ },
+ ]);
assert_matches!(
- quorum(&[*m1, *a1], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([m1, a1].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: a1.id(),
+ base: c0.id(),
+ }]);
assert_matches!(
- quorum(&[*m1, *a1], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
- assert_eq!(quorum(&[*m1, *m2, *b2, *c1], 4, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*m1, *m1, *b2], 2, &repo).unwrap(), m1);
- assert_eq!(quorum(&[*m1, *m1, *c2], 2, &repo).unwrap(), m1);
- assert_eq!(quorum(&[*m2, *m2, *b2], 2, &repo).unwrap(), m2);
- assert_eq!(quorum(&[*m2, *m2, *a1], 2, &repo).unwrap(), m2);
- assert_eq!(quorum(&[*m1, *m1, *b2, *b2], 2, &repo).unwrap(), m1);
- assert_eq!(quorum(&[*m1, *m1, *c2, *c2], 2, &repo).unwrap(), m1);
- assert_eq!(quorum(&[*m1, *b2, *c1, *c0], 3, &repo).unwrap(), c1);
- assert_eq!(quorum(&[*m1, *b2, *c1, *c0], 4, &repo).unwrap(), c0);
+
+ let mut cq = CommitQuorum::new([m1, a1].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: a1.id(),
+ base: c0.id(),
+ }]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([m1, m2, b2, c1].iter(), 4);
+ cq.found_merge_bases([
+ MergeBase {
+ a: m1.id(),
+ b: m2.id(),
+ base: b2.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: m2.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ MergeBase {
+ a: m2.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([m1, m1, b2].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(m1.id()),
+ MergeBase {
+ a: m1.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), m1.id());
+
+ let mut cq = CommitQuorum::new([m1, m1, c2].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(m1.id()),
+ MergeBase {
+ a: m1.id(),
+ b: c2.id(),
+ base: c2.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), m1.id());
+
+ let mut cq = CommitQuorum::new([m2, m2, b2].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(m2.id()),
+ MergeBase {
+ a: m2.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), m2.id());
+
+ let mut cq = CommitQuorum::new([m2, m2, a1].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(m2.id()),
+ MergeBase {
+ a: m2.id(),
+ b: a1.id(),
+ base: a1.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), m2.id());
+
+ let mut cq = CommitQuorum::new([m1, m1, b2, b2].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(m1.id()),
+ MergeBase::trivial(b2.id()),
+ MergeBase {
+ a: m1.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), m1.id());
+
+ let mut cq = CommitQuorum::new([m1, m1, c2, c2].iter(), 2);
+ cq.found_merge_bases([
+ MergeBase::trivial(m1.id()),
+ MergeBase::trivial(c2.id()),
+ MergeBase {
+ a: m1.id(),
+ b: c2.id(),
+ base: c2.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), m1.id());
+
+ let mut cq = CommitQuorum::new([m1, b2, c1, c0].iter(), 3);
+ cq.found_merge_bases([
+ MergeBase {
+ a: m1.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), c1.id());
+
+ let mut cq = CommitQuorum::new([m1, b2, c1, c0].iter(), 4);
+ cq.found_merge_bases([
+ MergeBase {
+ a: m1.id(),
+ b: b2.id(),
+ base: b2.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: c1.id(),
+ base: c1.id(),
+ },
+ MergeBase {
+ a: m1.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c1.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: b2.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ MergeBase {
+ a: c1.id(),
+ b: c0.id(),
+ base: c0.id(),
+ },
+ ]);
+ assert_eq!(cq.find_quorum().unwrap(), c0.id());
}
#[test]
- fn test_quorum_merges() {
- let tmp = tempfile::tempdir().unwrap();
- let (repo, c0) = fixtures::repository(tmp.path());
- let c0: git::Oid = c0.into();
- let c1 = fixtures::commit("C1", &[*c0], &repo);
- let c2 = fixtures::commit("C2", &[*c0], &repo);
- let c3 = fixtures::commit("C3", &[*c0], &repo);
-
- let m1 = fixtures::commit("M1", &[*c1, *c2], &repo);
- let m2 = fixtures::commit("M2", &[*c2, *c3], &repo);
-
- eprintln!("C0: {c0}");
- eprintln!("C1: {c1}");
- eprintln!("C2: {c2}");
- eprintln!("C3: {c3}");
- eprintln!("M1: {m1}");
- eprintln!("M2: {m2}");
+ fn test_commit_quorum_merges() {
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ let m1 = commit("dd7ee5bca2fc7288a6efcb4303278e26a2dbaa45");
+ let m2 = commit("d54e505e3fb5c0c7e4b9a4b8a1cdeefb3fc9ef18");
+ let m3 = commit("2224468e22b30359611d880ccf0850d023f86f9b");
// M2 M1
// /\ /\
// C1 C2 C3
// \| /
// C0
+
+ let mut cq = CommitQuorum::new([m1, m2].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: m2.id(),
+ base: c2.id(),
+ }]);
assert_matches!(
- quorum(&[*m1, *m2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*m1, *m2], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
- let m3 = fixtures::commit("M3", &[*c2, *c1], &repo);
+ let mut cq = CommitQuorum::new([m1, m2].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: m2.id(),
+ base: c2.id(),
+ }]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
// M3/M2 M1
// /\ /\
// C1 C2 C3
// \| /
// C0
+ let mut cq = CommitQuorum::new([m1, m3].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: m3.id(),
+ base: c2.id(),
+ }]);
assert_matches!(
- quorum(&[*m1, *m3], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*m1, *m3], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
- );
- assert_matches!(
- quorum(&[*m3, *m1], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
- );
- assert_matches!(
- quorum(&[*m3, *m1], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([m1, m3].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: m1.id(),
+ b: m3.id(),
+ base: c2.id(),
+ }]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([m3, m1].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m3.id(),
+ b: m1.id(),
+ base: c2.id(),
+ }]);
assert_matches!(
- quorum(&[*m3, *m2], 1, &repo),
- Err(QuorumError::DivergingCommits { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([m3, m1].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: m3.id(),
+ b: m1.id(),
+ base: c2.id(),
+ }]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
+
+ let mut cq = CommitQuorum::new([m3, m2].iter(), 1);
+ cq.found_merge_bases([MergeBase {
+ a: m3.id(),
+ b: m2.id(),
+ base: c2.id(),
+ }]);
assert_matches!(
- quorum(&[*m3, *m2], 2, &repo),
- Err(QuorumError::NoCandidates { .. })
+ cq.find_quorum(),
+ Err(CommitQuorumFailure::DivergingCommits { .. })
);
+
+ let mut cq = CommitQuorum::new([m3, m2].iter(), 2);
+ cq.found_merge_bases([MergeBase {
+ a: m3.id(),
+ b: m2.id(),
+ base: c2.id(),
+ }]);
+ assert_eq!(cq.find_quorum(), Err(CommitQuorumFailure::NoCandidates));
}
}
diff --git a/crates/radicle/src/git/canonical/convergence.rs b/crates/radicle/src/git/canonical/convergence.rs
new file mode 100644
index 000000000..ca5e2deae
--- /dev/null
+++ b/crates/radicle/src/git/canonical/convergence.rs
@@ -0,0 +1,125 @@
+use std::{fmt, ops::ControlFlow};
+
+use crate::git::Oid;
+use crate::prelude::Did;
+
+use super::{effects, error, Object};
+
+/// Checks for convergence and ensures that compared objects are of the same
+/// type, i.e. commit or tag, to the [`Candidate`].
+pub(super) struct Convergence<'r, R> {
+ repo: &'r R,
+ checker: Candidate,
+}
+
+impl<'r, R> fmt::Debug for Convergence<'r, R> {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ f.debug_struct("Convergence")
+ .field("checker", &self.checker)
+ .finish()
+ }
+}
+
+impl<'r, R> Convergence<'r, R>
+where
+ R: effects::Ancestry,
+{
+ pub fn new(repo: &'r R, candidate: Did, object: Object) -> Self {
+ Self {
+ repo,
+ checker: Candidate::new(candidate, object),
+ }
+ }
+
+ /// For each voter in `voters`:
+ /// 1. If the [`Object`] is a commit:
+ ///
+ /// a. Ensure that the candidate and voting commit have a linear
+ /// relationship.
+ /// b. That [`Object`]'s type matches type of the [`Candidate`].
+ ///
+ /// 2. If the [`Object`] is a tag, then ensure the [`Candidate`] object is
+ /// a tag.
+ /// 3. Always skip a vote that is the same as the [`Candidate`].
+ pub fn check<'a, I>(self, voters: I) -> Result<Option<(Did, Object)>, error::ConvergesError>
+ where
+ I: Iterator<Item = (&'a Did, &'a Object)>,
+ {
+ let mut converges = false;
+ for (did, object) in voters {
+ match self.checker.compare_to_candidate(did, *object) {
+ ControlFlow::Continue(c) => match c {
+ Effect::GraphCheck { commit, upstream } => {
+ converges |= self.repo.graph_ahead_behind(commit, upstream)?.is_linear();
+ }
+ Effect::TagConverges => {
+ converges = true;
+ continue;
+ }
+ Effect::SkipSelf => continue,
+ },
+ ControlFlow::Break(ConvergenceMismatch { expected, found }) => {
+ return Err(error::ConvergesError::mismatched_object(
+ expected.id(),
+ found.object_type(),
+ expected.object_type(),
+ ));
+ }
+ }
+ }
+ Ok(converges.then_some((self.checker.candidate, self.checker.object)))
+ }
+}
+
+/// The candidate and their [`Object`] they are attempting to converge with.
+#[derive(Debug)]
+struct Candidate {
+ candidate: Did,
+ object: Object,
+}
+
+/// The "effect" that needs to be performed due to the result of
+/// [`Candidate::compare_to_candidate`].
+enum Effect {
+ /// Perform a check of the commit graph using the `commit` and `upstream`.
+ GraphCheck { commit: Oid, upstream: Oid },
+ /// Mark that tags always converge – there is no ancestry check.
+ TagConverges,
+ /// Skip the [`Did`] since it is the same as the [`Candidate`].
+ SkipSelf,
+}
+
+/// The two [`Object`]s have different types.
+pub(super) struct ConvergenceMismatch {
+ expected: Object,
+ found: Object,
+}
+
+impl Candidate {
+ fn new(candidate: Did, object: Object) -> Self {
+ Self { candidate, object }
+ }
+
+ fn compare_to_candidate(
+ &self,
+ did: &Did,
+ object: Object,
+ ) -> ControlFlow<ConvergenceMismatch, Effect> {
+ if &self.candidate == did {
+ return ControlFlow::Continue(Effect::SkipSelf);
+ }
+ match (self.object, object) {
+ (e @ Object::Commit { .. }, f @ Object::Tag { .. })
+ | (e @ Object::Tag { .. }, f @ Object::Commit { .. }) => {
+ ControlFlow::Break(ConvergenceMismatch {
+ expected: e,
+ found: f,
+ })
+ }
+ (Object::Commit { id: commit }, Object::Commit { id: upstream }) => {
+ ControlFlow::Continue(Effect::GraphCheck { commit, upstream })
+ }
+ (Object::Tag { .. }, Object::Tag { .. }) => ControlFlow::Continue(Effect::TagConverges),
+ }
+ }
+}
diff --git a/crates/radicle/src/git/canonical/effects.rs b/crates/radicle/src/git/canonical/effects.rs
new file mode 100644
index 000000000..c985f7c68
--- /dev/null
+++ b/crates/radicle/src/git/canonical/effects.rs
@@ -0,0 +1,252 @@
+use std::collections::{BTreeMap, BTreeSet};
+
+use crate::git;
+use crate::git::{Oid, Qualified};
+use crate::prelude::Did;
+
+use super::{FoundObjects, GraphAheadBehind, MergeBase, Object};
+
+/// Find objects for the canonical computation.
+///
+/// Typically implemented by a Git repository.
+pub trait FindObjects {
+ /// Find the objects for the given [`Qualified`] reference name, for each
+ /// [`Did`]'s namespace.
+ ///
+ /// The resulting [`FoundObjects`] includes all objects that were found, the
+ /// references that were missing, and the objects that were missing (if the
+ /// reference was found).
+ fn find_objects<'a, 'b, I>(
+ &self,
+ refname: &Qualified<'a>,
+ dids: I,
+ ) -> Result<FoundObjects, FindObjectsError>
+ where
+ I: Iterator<Item = &'b Did>;
+}
+
+/// Error produced by the [`FindObjects::find_objects`] method.
+#[derive(Debug, thiserror::Error)]
+pub enum FindObjectsError {
+ #[error(transparent)]
+ InvalidObjectType(#[from] InvalidObjectType),
+ #[error(transparent)]
+ MissingObject(#[from] MissingObject),
+ #[error("failed to find object {oid} due to: {source}")]
+ FindObject {
+ oid: Oid,
+ source: Box<dyn std::error::Error + Send + Sync + 'static>,
+ },
+ #[error("failed to find reference {refname} due to: {source}")]
+ FindReference {
+ refname: git::Namespaced<'static>,
+ source: Box<dyn std::error::Error + Send + Sync + 'static>,
+ },
+ #[error("failed to find objects")]
+ Other {
+ source: Box<dyn std::error::Error + Send + Sync + 'static>,
+ },
+}
+
+impl FindObjectsError {
+ pub fn find_object<E>(oid: Oid, err: E) -> Self
+ where
+ E: std::error::Error + Send + Sync + 'static,
+ {
+ Self::FindObject {
+ oid,
+ source: Box::new(err),
+ }
+ }
+
+ pub fn find_reference<E>(refname: git::Namespaced<'static>, err: E) -> Self
+ where
+ E: std::error::Error + Send + Sync + 'static,
+ {
+ Self::FindReference {
+ refname,
+ source: Box::new(err),
+ }
+ }
+
+ pub fn missing_object<E>(did: Did, oid: Oid, err: E) -> Self
+ where
+ E: std::error::Error + Send + Sync + 'static,
+ {
+ MissingObject {
+ did,
+ commit: oid,
+ source: Box::new(err),
+ }
+ .into()
+ }
+
+ pub fn invalid_object_type(did: Did, oid: Oid, kind: Option<String>) -> Self {
+ InvalidObjectType { did, oid, kind }.into()
+ }
+
+ pub fn other<E>(err: E) -> Self
+ where
+ E: std::error::Error + Send + Sync + 'static,
+ {
+ Self::Other {
+ source: Box::new(err),
+ }
+ }
+}
+
+#[derive(Debug, thiserror::Error)]
+#[error("the object {oid} for {did} is of unexpected type {kind:?}")]
+pub struct InvalidObjectType {
+ did: Did,
+ oid: Oid,
+ kind: Option<String>,
+}
+
+#[derive(Debug, thiserror::Error)]
+#[error("the commit {commit} for {did} is missing")]
+pub struct MissingObject {
+ did: Did,
+ commit: Oid,
+ source: Box<dyn std::error::Error + Send + Sync + 'static>,
+}
+
+/// Find the merge base of two commits.
+///
+/// Typically implemented by a Git repository.
+pub trait FindMergeBase {
+ /// Produce the [`MergeBase`] of commits `a` and `b`.
+ fn merge_base(&self, a: Oid, b: Oid) -> Result<MergeBase, MergeBaseError>;
+}
+
+#[derive(Debug, thiserror::Error)]
+#[error("failed to find merge base for {a} and {b} due to: {source}")]
+pub struct MergeBaseError {
+ a: Oid,
+ b: Oid,
+ source: Box<dyn std::error::Error + Send + Sync + 'static>,
+}
+
+impl MergeBaseError {
+ pub fn new<E>(a: Oid, b: Oid, source: E) -> Self
+ where
+ E: std::error::Error + Send + Sync + 'static,
+ {
+ Self {
+ a,
+ b,
+ source: Box::new(source),
+ }
+ }
+}
+
+/// Calculate the ancestry of two commits.
+///
+/// Typically implemented by a Git repository.
+pub trait Ancestry {
+ /// Produce the [`GraphAheadBehind`] of `commit` and `upstream`.
+ ///
+ /// The result should provide how many commits are ahead and behind when
+ /// comparing the `commit` and `upstream`.
+ fn graph_ahead_behind(
+ &self,
+ commit: Oid,
+ upstream: Oid,
+ ) -> Result<GraphAheadBehind, GraphDescendant>;
+}
+
+#[derive(Debug, thiserror::Error)]
+#[error("failed to check if {commit} is an ancestor of {upstream} due to: {source}")]
+pub struct GraphDescendant {
+ commit: Oid,
+ upstream: Oid,
+ source: Box<dyn std::error::Error + Send + Sync + 'static>,
+}
+
+// ===========================================
+// `git2` implementations of the above effects
+// ===========================================
+
+impl FindMergeBase for git2::Repository {
+ fn merge_base(&self, a: Oid, b: Oid) -> Result<MergeBase, MergeBaseError> {
+ self.merge_base(*a, *b)
+ .map_err(|err| MergeBaseError {
+ a,
+ b,
+ source: Box::new(err),
+ })
+ .map(|base| MergeBase {
+ a,
+ b,
+ base: base.into(),
+ })
+ }
+}
+
+impl Ancestry for git2::Repository {
+ fn graph_ahead_behind(
+ &self,
+ commit: Oid,
+ upstream: Oid,
+ ) -> Result<GraphAheadBehind, GraphDescendant> {
+ self.graph_ahead_behind(*commit, *upstream)
+ .map_err(|err| GraphDescendant {
+ commit,
+ upstream,
+ source: Box::new(err),
+ })
+ .map(|(ahead, behind)| GraphAheadBehind { ahead, behind })
+ }
+}
+
+impl FindObjects for git2::Repository {
+ fn find_objects<'a, 'b, I>(
+ &self,
+ refname: &Qualified,
+ dids: I,
+ ) -> Result<FoundObjects, FindObjectsError>
+ where
+ I: Iterator<Item = &'b Did>,
+ {
+ let mut objects = BTreeMap::new();
+ let mut missing_refs = BTreeSet::new();
+ let mut missing_objects = BTreeMap::new();
+ for did in dids {
+ let name = &refname.with_namespace(did.as_key().into());
+ let reference = match self.find_reference(name.as_str()) {
+ Ok(reference) => reference,
+ Err(e) if git::ext::is_not_found_err(&e) => {
+ missing_refs.insert(name.to_owned());
+ continue;
+ }
+ Err(e) => {
+ return Err(FindObjectsError::find_reference(name.to_owned(), e));
+ }
+ };
+ let Some(oid) = reference.target().map(Oid::from) else {
+ log::warn!(target: "radicle", "Missing target for reference `{name}`");
+ continue;
+ };
+ let object = match self.find_object(*oid, None) {
+ Ok(object) => Object::new(&object).ok_or_else(|| {
+ FindObjectsError::invalid_object_type(
+ *did,
+ oid,
+ object.kind().map(|kind| kind.to_string()),
+ )
+ }),
+ Err(err) if git::ext::is_not_found_err(&err) => {
+ missing_objects.insert(*did, oid);
+ continue;
+ }
+ Err(err) => Err(FindObjectsError::find_object(oid, err)),
+ };
+ objects.insert(*did, object?);
+ }
+ Ok(FoundObjects {
+ objects,
+ missing_refs,
+ missing_objects,
+ })
+ }
+}
diff --git a/crates/radicle/src/git/canonical/error.rs b/crates/radicle/src/git/canonical/error.rs
index 4903f9a7a..d6b1529c2 100644
--- a/crates/radicle/src/git/canonical/error.rs
+++ b/crates/radicle/src/git/canonical/error.rs
@@ -1,17 +1,20 @@
-use std::path::PathBuf;
-
use thiserror::Error;
-use crate::{git::raw, git::Oid, prelude::Did};
+use crate::git::Oid;
-use super::CanonicalObjectType;
+use super::{effects, ObjectType};
+pub use effects::{FindObjectsError, MergeBaseError};
-/// Error that can occur when calculation the [`Canonical::quorum`].
-///
-/// [`Canonical::quorum`]: super::Canonical
#[derive(Debug, Error)]
pub enum QuorumError {
- /// Could not determine a quorum [`Oid`], due to diverging tips.
+ #[error("could not determine target for canonical reference '{refname}', found objects of different types")]
+ DifferentTypes { refname: String },
+ #[error(transparent)]
+ Convergence(#[from] ConvergesError),
+ #[error(transparent)]
+ MergeBase(#[from] MergeBaseError),
+ #[error("could not determine target for canonical reference '{refname}', no object with at least {threshold} vote(s) found (threshold not met)")]
+ NoCandidates { refname: String, threshold: usize },
#[error("could not determine target commit for canonical reference '{refname}', found diverging commits {longest} and {head}, with base commit {base} and threshold {threshold}")]
DivergingCommits {
refname: String,
@@ -26,178 +29,27 @@ pub enum QuorumError {
threshold: usize,
candidates: Vec<Oid>,
},
- #[error("could not determine target for canonical reference '{refname}', found objects of different types")]
- DifferentTypes { refname: String },
- /// Could not determine a base candidate from the given set of delegates.
- #[error("could not determine target for canonical reference '{refname}', no object with at least {threshold} vote(s) found (threshold not met)")]
- NoCandidates { refname: String, threshold: usize },
- /// An error occurred from [`git2`].
- #[error(transparent)]
- Git(#[from] git2::Error),
-}
-
-#[derive(Debug, Error)]
-#[error("failed to check if {head} is an ancestor of {canonical} due to: {source}")]
-pub struct GraphDescendant {
- head: Oid,
- canonical: Oid,
- source: raw::Error,
}
#[derive(Debug, Error)]
-#[error("the commit {commit} for {did} is missing from the repository {repo:?}")]
-pub struct MissingObject {
- repo: PathBuf,
- did: Did,
- commit: Oid,
- source: raw::Error,
-}
-
-#[derive(Debug, Error)]
-#[error("could not determine whether the commit {commit} for {did} is part of the repository {repo:?} due to: {source}")]
-pub struct InvalidObject {
- repo: PathBuf,
- did: Did,
- commit: Oid,
- source: raw::Error,
-}
-
-#[derive(Debug, Error)]
-#[error("the object {oid} for {did} in the repository {repo:?} is of unexpected type {kind:?}")]
-pub struct InvalidObjectType {
- repo: PathBuf,
- did: Did,
- oid: Oid,
- kind: Option<git2::ObjectType>,
-}
-
-#[derive(Debug, Error)]
-#[error("the object {oid} in the repository {repo:?} is of unexpected type {found} and was expected to be {expected}")]
+#[error("the object {oid} is of unexpected type {found} and was expected to be {expected}")]
pub struct MismatchedObject {
- repo: PathBuf,
oid: Oid,
- found: CanonicalObjectType,
- expected: CanonicalObjectType,
-}
-
-#[derive(Debug, Error)]
-pub enum CanonicalError {
- #[error(transparent)]
- InvalidObjectType(#[from] InvalidObjectType),
- #[error(transparent)]
- MissingObject(#[from] MissingObject),
- #[error("failed to find object {oid} due to: {source}")]
- FindObject { oid: Oid, source: git2::Error },
- #[error("failed to find reference {name} due to: {source}")]
- FindReference { name: String, source: git2::Error },
-}
-
-impl CanonicalError {
- pub(super) fn invalid_object_type(
- repo: PathBuf,
- did: Did,
- oid: Oid,
- kind: Option<git2::ObjectType>,
- ) -> Self {
- InvalidObjectType {
- repo,
- did,
- oid,
- kind,
- }
- .into()
- }
-
- pub(super) fn missing_object(repo: PathBuf, did: Did, oid: Oid, err: git2::Error) -> Self {
- MissingObject {
- repo,
- did,
- commit: oid,
- source: err,
- }
- .into()
- }
-
- pub(super) fn find_object(oid: Oid, err: git2::Error) -> Self {
- Self::FindObject { oid, source: err }
- }
-
- pub(crate) fn find_reference(name: &str, e: git2::Error) -> CanonicalError {
- Self::FindReference {
- name: name.to_string(),
- source: e,
- }
- }
-}
-
-#[derive(Debug, Error)]
-pub enum FindObjectError {
- #[error(transparent)]
- InvalidObjectType(#[from] InvalidObjectType),
- #[error(transparent)]
- MissingObject(#[from] MissingObject),
- #[error("failed to find object {oid} due to: {source}")]
- FindObject { oid: Oid, source: git2::Error },
-}
-
-impl FindObjectError {
- pub(super) fn find_object(oid: Oid, err: git2::Error) -> Self {
- Self::FindObject { oid, source: err }
- }
-
- pub(super) fn missing_object(repo: PathBuf, did: Did, oid: Oid, err: git2::Error) -> Self {
- MissingObject {
- repo,
- did,
- commit: oid,
- source: err,
- }
- .into()
- }
-
- pub(super) fn invalid_object_type(
- repo: PathBuf,
- did: Did,
- oid: Oid,
- kind: Option<git2::ObjectType>,
- ) -> Self {
- InvalidObjectType {
- repo,
- did,
- oid,
- kind,
- }
- .into()
- }
+ found: ObjectType,
+ expected: ObjectType,
}
#[derive(Debug, Error)]
pub enum ConvergesError {
#[error(transparent)]
- GraphDescendant(#[from] GraphDescendant),
+ GraphDescendant(#[from] effects::GraphDescendant),
#[error(transparent)]
MismatchedObject(#[from] MismatchedObject),
- #[error(transparent)]
- FindObjectError(#[from] FindObjectError),
}
impl ConvergesError {
- pub(super) fn graph_descendant(head: Oid, canonical: Oid, source: raw::Error) -> Self {
- Self::GraphDescendant(GraphDescendant {
- head,
- canonical,
- source,
- })
- }
-
- pub(super) fn mismatched_object(
- repo: PathBuf,
- oid: Oid,
- found: CanonicalObjectType,
- expected: CanonicalObjectType,
- ) -> Self {
+ pub(super) fn mismatched_object(oid: Oid, found: ObjectType, expected: ObjectType) -> Self {
Self::MismatchedObject(MismatchedObject {
- repo,
oid,
found,
expected,
diff --git a/crates/radicle/src/git/canonical/quorum.rs b/crates/radicle/src/git/canonical/quorum.rs
new file mode 100644
index 000000000..d3a9521f1
--- /dev/null
+++ b/crates/radicle/src/git/canonical/quorum.rs
@@ -0,0 +1,315 @@
+use std::{cmp::Ordering, collections::BTreeMap};
+
+use crate::git::Oid;
+
+use super::voting::{CommitVoting, TagVoting};
+use super::{MergeBase, Object};
+
+/// [`TagQuorum`] encapsulates the process of voting on tag objects and
+/// producing a quorum, if any.
+#[derive(Debug)]
+pub struct TagQuorum {
+ threshold: usize,
+ voting: TagVoting,
+}
+
+impl TagQuorum {
+ /// Construct a new [`TagQuorum`] given a set of [`Object`]s and a
+ /// `threshold`.
+ pub fn new<'a, I>(objects: I, threshold: usize) -> Self
+ where
+ I: Iterator<Item = &'a Object>,
+ {
+ let voting = TagVoting::from_targets(objects.filter_map(|object| match object {
+ Object::Commit { .. } => None,
+ Object::Tag { id } => Some(*id),
+ }));
+ Self { threshold, voting }
+ }
+
+ /// Perform the quorum calculation and produce the [`Oid`] of the Git tag
+ /// that passes the quorum, if any.
+ pub fn find_quorum(self) -> Result<Oid, TagQuorumFailure> {
+ let mut votes = self.voting.votes();
+ votes.candidates_past_threshold(self.threshold);
+ if votes.number_of_candidates() > 1 {
+ Err(TagQuorumFailure::DivergingTags {
+ candidates: votes.candidates().cloned().collect(),
+ })
+ } else {
+ votes
+ .max_candidate()
+ .cloned()
+ .ok_or(TagQuorumFailure::NoCandidates)
+ }
+ }
+}
+
+#[derive(Debug, PartialEq, Eq)]
+pub enum TagQuorumFailure {
+ NoCandidates,
+ DivergingTags { candidates: Vec<Oid> },
+}
+
+/// [`CommitQuorum`] encapsulates the process of voting on commit objects and
+/// producing a quorum, if any.
+///
+/// Once constructed with [`CommitQuorum::new`],
+/// [`CommitQuorum::next_candidate`] should be called. This produces a candidate
+/// commit, and for each of the other commits, a merge base should be
+/// calculated.
+///
+/// When a set of [`MergeBase`]s are found, it should be recorded using
+/// [`CommitQuorum::found_merge_bases`].
+///
+/// Finally, [`CommitQuorum::find_quorum`] is used to calculate if there is a
+/// quorum commit.
+#[derive(Debug)]
+pub struct CommitQuorum {
+ threshold: usize,
+ voting: CommitVoting,
+ merge_bases: MergeBases,
+}
+
+/// The `MergeBaseKey` ensures that our [`MergeBases`] lookup table is
+/// commutative when looking up a given merge base pair.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+struct MergeBaseKey {
+ a: Oid,
+ b: Oid,
+}
+
+impl MergeBaseKey {
+ /// Ensure the ordering is always stable
+ fn new(a: Oid, b: Oid) -> Self {
+ if a < b {
+ Self { a, b }
+ } else {
+ Self { a: b, b: a }
+ }
+ }
+}
+
+impl PartialOrd for MergeBaseKey {
+ fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+ Some(self.cmp(other))
+ }
+}
+
+impl Ord for MergeBaseKey {
+ fn cmp(&self, other: &Self) -> Ordering {
+ (self.a, self.b).cmp(&(other.a, other.b))
+ }
+}
+
+/// A lookup table for merge bases, that is commutative in its keys. That is,
+/// the following invariant should hold:
+/// ```text, no_run
+/// MergeBases::lookup(a, b) == MergeBases::lookup(b, a)
+/// ```
+#[derive(Clone, Debug, Default, PartialEq, Eq)]
+struct MergeBases {
+ lookup: BTreeMap<MergeBaseKey, Oid>,
+}
+
+impl MergeBases {
+ /// Mark a [`MergeBase`] as found in the lookup table.
+ fn found(
+ &mut self,
+ MergeBase {
+ a: candidate,
+ b: other,
+ base,
+ }: MergeBase,
+ ) {
+ self.lookup
+ .insert(MergeBaseKey::new(candidate, other), base);
+ }
+
+ /// Lookup the base for two commits, `a` and `b` – note that this operation
+ /// is commutative.
+ fn lookup(&self, a: Oid, b: Oid) -> Option<&Oid> {
+ self.lookup.get(&MergeBaseKey::new(a, b))
+ }
+}
+
+impl CommitQuorum {
+ /// Construct a new [`CommitQuorum`] given a set of [`Object`]s and a
+ /// `threshold`.
+ pub fn new<'a, I>(objects: I, threshold: usize) -> Self
+ where
+ I: Clone + Iterator<Item = &'a Object>,
+ {
+ let voting = CommitVoting::from_targets(objects.filter_map(|object| match object {
+ Object::Commit { id } => Some(*id),
+ Object::Tag { .. } => None,
+ }));
+ Self {
+ threshold,
+ voting,
+ merge_bases: MergeBases::default(),
+ }
+ }
+
+ /// Produces an iterator of the candidate commit paired with commits to
+ /// compare against.
+ ///
+ /// A [`MergeBase`] should be calculated for each, and these should be
+ /// recorded using [`CommitQuorum::found_merge_bases`].
+ pub fn next_candidate(&mut self) -> Option<impl Iterator<Item = (Oid, Oid)>> {
+ self.voting.next_candidate()
+ }
+
+ /// Record the [`MergeBase`]s for the [`CommitQuorum`].
+ pub fn found_merge_bases(&mut self, bases: impl IntoIterator<Item = MergeBase>) {
+ for base in bases {
+ self.voting.found_merge_base(base);
+ self.merge_bases.found(base);
+ }
+ }
+
+ /// Perform the quorum calculation and produce the [`Oid`] of the Git commit
+ /// that passes the quorum, if any.
+ pub fn find_quorum(self) -> Result<Oid, CommitQuorumFailure> {
+ let mut votes = self.voting.votes();
+ votes.candidates_past_threshold(self.threshold);
+ let mut longest = votes
+ .pop_first_candidate()
+ .ok_or(CommitQuorumFailure::NoCandidates)?;
+ for candidate in votes.candidates() {
+ let base = self.merge_bases.lookup(*candidate, longest).ok_or(
+ CommitQuorumFailure::NoMergeBase {
+ a: *candidate,
+ b: longest,
+ },
+ )?;
+ if *base == longest {
+ // `head` is a successor of `longest`. Update `longest`.
+ //
+ // o head
+ // |
+ // o longest (base)
+ // |
+ //
+ longest = *candidate;
+ } else if base == candidate || *candidate == longest {
+ // `head` is an ancestor of `longest`, or equal to it. Do nothing.
+ //
+ // o longest o longest, head (base)
+ // | |
+ // o head (base) OR o
+ // | |
+ //
+ continue;
+ } else {
+ // The merge base between `head` and `longest` (`base`)
+ // is neither `head` nor `longest`. Therefore, the branches have
+ // diverged.
+ //
+ // longest head
+ // \ /
+ // o (base)
+ // |
+ //
+ return Err(CommitQuorumFailure::DivergingCommits {
+ base: *base,
+ longest,
+ candidate: *candidate,
+ });
+ }
+ }
+ Ok(longest)
+ }
+}
+
+#[derive(Debug, PartialEq, Eq)]
+pub enum CommitQuorumFailure {
+ NoCandidates,
+ DivergingCommits {
+ base: Oid,
+ longest: Oid,
+ candidate: Oid,
+ },
+ NoMergeBase {
+ a: Oid,
+ b: Oid,
+ },
+}
+
+#[allow(clippy::unwrap_used)]
+#[cfg(test)]
+mod test {
+ use crate::git::{canonical::MergeBase, Oid};
+
+ use super::MergeBases;
+
+ fn commit(id: &str) -> Oid {
+ id.parse().unwrap()
+ }
+
+ #[test]
+ fn merge_base_commutative() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+
+ let mut bases = MergeBases::default();
+ bases.found(MergeBase {
+ a: c2,
+ b: c1,
+ base: c0,
+ });
+ bases.found(MergeBase {
+ a: c1,
+ b: c2,
+ base: c0,
+ });
+ assert_eq!(bases.lookup(c1, c2), Some(&c0));
+ assert_eq!(bases.lookup(c2, c1), Some(&c0));
+ }
+
+ #[test]
+ fn test_merge_bases() {
+ let c0 = commit("f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354");
+ let c1 = commit("bfb1a513e420eade90b0e6be64117b861b16ecb5");
+ let c2 = commit("8fc5160702365f231c77732a8fa162379e54f57a");
+ let b2 = commit("037a148170e3d41524b7c482a4798e5c2daeaa00");
+
+ // B2 C2
+ // \|
+ // C1
+ // |
+ // C0
+ let input = [
+ MergeBase {
+ a: b2,
+ b: c2,
+ base: c1,
+ },
+ MergeBase {
+ a: c2,
+ b: c1,
+ base: c1,
+ },
+ MergeBase {
+ a: b2,
+ b: c1,
+ base: c1,
+ },
+ MergeBase {
+ a: c1,
+ b: c0,
+ base: c0,
+ },
+ MergeBase::trivial(b2),
+ MergeBase::trivial(c2),
+ MergeBase::trivial(c1),
+ MergeBase::trivial(c0),
+ ];
+ let mut merge_bases = MergeBases::default();
+ for i in input {
+ merge_bases.found(i);
+ }
+ assert_eq!(merge_bases.lookup(b2, c2), Some(&c1));
+ }
+}
diff --git a/crates/radicle/src/git/canonical/rules.rs b/crates/radicle/src/git/canonical/rules.rs
index 592334567..ed0f6271a 100644
--- a/crates/radicle/src/git/canonical/rules.rs
+++ b/crates/radicle/src/git/canonical/rules.rs
@@ -26,7 +26,6 @@ use crate::git::fmt::{refname, RefString};
use crate::git::refspec::QualifiedPattern;
use crate::git::Qualified;
use crate::identity::{doc, Did};
-use crate::storage::git::Repository;
const ASTERISK: char = '*';
@@ -631,16 +630,19 @@ impl Rules {
///
/// N.b. it will find the first rule that is most specific for the given
/// `refname`.
- pub fn canonical<'a, 'b>(
+ pub fn canonical<'a, 'b, 'r, R>(
&'a self,
refname: Qualified<'b>,
- repo: &Repository,
- ) -> Result<Option<Canonical<'b, 'a>>, canonical::error::CanonicalError> {
- if let Some((_, rule)) = self.matches(&refname).next() {
- Ok(Some(Canonical::new(&repo.backend, refname, rule)?))
- } else {
- Ok(None)
- }
+ repo: &'r R,
+ ) -> Option<Canonical<'b, 'a, 'r, R, canonical::Initial>>
+ where
+ R: canonical::effects::Ancestry
+ + canonical::effects::FindMergeBase
+ + canonical::effects::FindObjects,
+ {
+ self.matches(&refname)
+ .next()
+ .map(|(_, rule)| Canonical::new(refname, rule, repo))
}
}
@@ -1196,18 +1198,22 @@ mod tests {
for (refname, oid) in tags.into_iter() {
let canonical = rules
.canonical(refname.clone(), &stored)
- .unwrap()
.unwrap_or_else(|| {
panic!("there should be a matching rule for {refname}, rules: {rules:#?}")
});
if refname == failing {
- assert!(canonical.quorum(&repo).is_err());
+ assert!(canonical.find_objects().unwrap().quorum().is_err());
} else {
assert_eq!(
canonical
- .quorum(&repo)
+ .find_objects()
+ .unwrap()
+ .quorum()
.unwrap_or_else(|e| panic!("quorum error for {refname}: {e}")),
- (refname, git::raw::ObjectType::Tag, oid),
+ canonical::Quorum {
+ refname,
+ object: canonical::Object::Tag { id: oid },
+ }
)
}
}
diff --git a/crates/radicle/src/git/canonical/voting.rs b/crates/radicle/src/git/canonical/voting.rs
new file mode 100644
index 000000000..51c23d0b3
--- /dev/null
+++ b/crates/radicle/src/git/canonical/voting.rs
@@ -0,0 +1,144 @@
+use std::collections::BTreeMap;
+
+use crate::git::Oid;
+
+use super::MergeBase;
+
+/// Keep track of [`Votes`] for quorums involving tag objects.
+#[derive(Debug, Default)]
+pub struct TagVoting {
+ votes: Votes,
+}
+
+impl TagVoting {
+ /// Build the initial set of votes given the set of `targets`. Each [`Oid`]
+ /// will provide a single vote, where repeated [`Oid`]s will increment the
+ /// vote count.
+ pub fn from_targets(targets: impl Iterator<Item = Oid>) -> Self {
+ let votes = targets.fold(Votes::default(), |mut votes, oid| {
+ votes.vote(oid);
+ votes
+ });
+ Self { votes }
+ }
+
+ /// Finish the voting process and get the [`Votes`] from the
+ /// [`TagVoting`].
+ pub fn votes(self) -> Votes {
+ self.votes
+ }
+}
+
+/// Keep track of [`Votes`] for quorums involving commit objects.
+///
+/// Build a list of candidate commits and count how many "votes" each of them
+/// has. Commits get a point for each direct vote, as well as for being part of
+/// the ancestry of a commit given to this function.
+#[derive(Debug, Default)]
+pub struct CommitVoting {
+ candidates: Vec<(Oid, Vec<Oid>)>,
+ votes: Votes,
+}
+
+impl CommitVoting {
+ /// Build the initial set of votes given the set of `targets`. Each [`Oid`]
+ /// will provide a single vote, where repeated [`Oid`]s will increment the
+ /// vote count.
+ ///
+ /// It will also build the candidates which can be produced using the
+ /// [`CommitVoting::next_candidate`] method.
+ pub fn from_targets(targets: impl Iterator<Item = Oid> + Clone) -> Self {
+ let ts = targets.clone();
+ let (candidates, votes) = targets.enumerate().fold(
+ (Vec::new(), Votes::default()),
+ |(mut candidates, mut votes), (i, oid)| {
+ candidates.push((oid, ts.clone().skip(i + 1).collect()));
+ votes.vote(oid);
+ (candidates, votes)
+ },
+ );
+ Self { candidates, votes }
+ }
+
+ /// Get the next candidate to be considered for ancestry votes.
+ ///
+ /// The first of each pair will be the candidate commit, which should be
+ /// compared to the other commit to see what their common merge base is. The
+ /// merge base is then recorded using [`MergeBase`] and is recorded using
+ /// [`CommitVoting::found_merge_base`].
+ pub fn next_candidate(&mut self) -> Option<impl Iterator<Item = (Oid, Oid)>> {
+ self.candidates
+ .pop()
+ .map(|(oid, others)| others.into_iter().map(move |other| (oid, other)))
+ }
+
+ /// Record a merge base, and add to the vote if it counts towards the
+ /// result.
+ pub fn found_merge_base(&mut self, merge_base: MergeBase) {
+ // Avoid double counting the same commits
+ if let Some(oid) = merge_base.linear() {
+ self.votes.vote(oid)
+ }
+ }
+
+ /// Finish the voting process and get the [`Votes`] from the
+ /// [`CommitVoting`].
+ pub fn votes(self) -> Votes {
+ self.votes
+ }
+}
+
+/// Count the number of votes per [`Oid`].
+///
+/// Note that the count cannot exceed 255, since that is the maximum number the
+/// `threshold` value can be.
+#[derive(Debug, Default, PartialEq, Eq)]
+pub struct Votes {
+ inner: BTreeMap<Oid, u8>,
+}
+
+impl Votes {
+ /// Increase the vote count for `oid`.
+ ///
+ /// If `oid` does not exist in the set of [`Votes`] yet, then no vote will
+ /// be added.
+ #[inline]
+ fn vote(&mut self, oid: Oid) {
+ let votes = self.inner.entry(oid).or_default();
+ *votes = votes.saturating_add(1);
+ }
+
+ /// Filter the candidates by the ones that have a number of votes that pass
+ /// the `threshold`.
+ #[inline]
+ pub fn candidates_past_threshold(&mut self, threshold: usize) {
+ self.inner.retain(|_, votes| *votes as usize >= threshold);
+ }
+
+ /// Get the number of candidates this set of votes has.
+ #[inline]
+ pub fn number_of_candidates(&self) -> usize {
+ self.inner.len()
+ }
+
+ /// Get the set candidates.
+ #[inline]
+ pub fn candidates(&self) -> impl Iterator<Item = &Oid> {
+ self.inner.keys()
+ }
+
+ /// Pop off the first candidate from the set of votes.
+ #[inline]
+ pub fn pop_first_candidate(&mut self) -> Option<Oid> {
+ self.inner.pop_first().map(|(oid, _)| oid)
+ }
+
+ /// Get the candidate with the most votes.
+ #[inline]
+ pub fn max_candidate(&self) -> Option<&Oid> {
+ self.inner
+ .iter()
+ .max_by(|(_, x), (_, y)| x.cmp(y))
+ .map(|(oid, _)| oid)
+ }
+}
diff --git a/crates/radicle/src/storage.rs b/crates/radicle/src/storage.rs
index 7f487df99..92892959e 100644
--- a/crates/radicle/src/storage.rs
+++ b/crates/radicle/src/storage.rs
@@ -127,7 +127,7 @@ pub enum RepositoryError {
#[error("failed to get canonical reference rules: {0}")]
CanonicalRefs(#[from] doc::CanonicalRefsError),
#[error(transparent)]
- Canonical(#[from] canonical::error::CanonicalError),
+ FindObjects(#[from] canonical::effects::FindObjectsError),
}
impl RepositoryError {
diff --git a/crates/radicle/src/storage/git.rs b/crates/radicle/src/storage/git.rs
index be025611d..92bb19b5d 100644
--- a/crates/radicle/src/storage/git.rs
+++ b/crates/radicle/src/storage/git.rs
@@ -11,6 +11,7 @@ use std::{fs, io};
use crypto::Verified;
use tempfile::TempDir;
+use crate::git::canonical::Quorum;
use crate::identity::crefs::GetCanonicalRefs as _;
use crate::identity::doc::DocError;
use crate::identity::{CanonicalRefs, Doc, DocAt, RepoId};
@@ -284,6 +285,39 @@ pub struct Repository {
pub backend: git2::Repository,
}
+impl git::canonical::effects::Ancestry for Repository {
+ fn graph_ahead_behind(
+ &self,
+ commit: Oid,
+ upstream: Oid,
+ ) -> Result<git::canonical::GraphAheadBehind, git::canonical::effects::GraphDescendant> {
+ git::canonical::effects::Ancestry::graph_ahead_behind(&self.backend, commit, upstream)
+ }
+}
+
+impl git::canonical::effects::FindMergeBase for Repository {
+ fn merge_base(
+ &self,
+ a: Oid,
+ b: Oid,
+ ) -> Result<git::canonical::MergeBase, git::canonical::effects::MergeBaseError> {
+ git::canonical::effects::FindMergeBase::merge_base(&self.backend, a, b)
+ }
+}
+
+impl git::canonical::effects::FindObjects for Repository {
+ fn find_objects<'a, 'b, I>(
+ &self,
+ refname: &Qualified<'a>,
+ dids: I,
+ ) -> Result<git::canonical::FoundObjects, git::canonical::effects::FindObjectsError>
+ where
+ I: Iterator<Item = &'b crate::prelude::Did>,
+ {
+ git::canonical::effects::FindObjects::find_objects(&self.backend, refname, dids)
+ }
+}
+
/// A set of [`Validation`] errors that a caller **must use**.
#[must_use]
#[derive(Debug, Default)]
@@ -761,10 +795,15 @@ impl ReadRepository for Repository {
};
Ok(crefs
.rules()
- .canonical(refname, self)?
+ .canonical(refname, self)
.ok_or(RepositoryError::MissingBranchRule)?
- .quorum(self.raw())?)
- .map(|(refname, _, oid)| (refname, oid))
+ .find_objects()?
+ .quorum()?)
+ .map(
+ |Quorum {
+ refname, object, ..
+ }| (refname, object.id()),
+ )
}
fn identity_head(&self) -> Result<Oid, RepositoryError> {
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 ef21c432-d317-4408-b8af-de56b0b52452 -v /opt/radcis/ci.rad.levitte.org/cci/state/ef21c432-d317-4408-b8af-de56b0b52452/s:/ef21c432-d317-4408-b8af-de56b0b52452/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/ef21c432-d317-4408-b8af-de56b0b52452/w:/ef21c432-d317-4408-b8af-de56b0b52452/w -w /ef21c432-d317-4408-b8af-de56b0b52452/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /ef21c432-d317-4408-b8af-de56b0b52452/s/script.sh
+ cargo --version
info: syncing channel updates for '1.88-x86_64-unknown-linux-gnu'
info: latest update on 2025-06-26, rust version 1.88.0 (6b00bc388 2025-06-23)
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.88.0 (873a06493 2025-05-10)
+ rustc --version
rustc 1.88.0 (6b00bc388 2025-06-23)
+ cargo fmt --check
+ cargo clippy --all-targets --workspace -- --deny warnings
Updating crates.io index
Downloading crates ...
Downloaded aes-gcm v0.10.3
Downloaded base16ct v0.2.0
Downloaded bytesize v2.0.1
Downloaded const-oid v0.9.6
Downloaded faster-hex v0.9.0
Downloaded escargot v0.5.10
Downloaded filetime v0.2.23
Downloaded fast-glob v0.3.3
Downloaded crossbeam-utils v0.8.19
Downloaded serde_derive_internals v0.29.1
Downloaded shlex v1.3.0
Downloaded cypheraddr v0.4.0
Downloaded rfc6979 v0.4.0
Downloaded dunce v1.0.5
Downloaded fastrand v2.1.0
Downloaded home v0.5.9
Downloaded ed25519 v1.5.3
Downloaded serde_spanned v1.0.0
Downloaded human-panic v2.0.3
Downloaded itoa v1.0.11
Downloaded rand_core v0.6.4
Downloaded localtime v1.3.1
Downloaded shell-words v1.1.0
Downloaded newline-converter v0.3.0
Downloaded noise-framework v0.4.0
Downloaded multibase v0.9.1
Downloaded iana-time-zone v0.1.60
Downloaded tree-sitter-language v0.1.2
Downloaded snapbox-macros v0.3.8
Downloaded test-log-macros v0.2.18
Downloaded litemap v0.7.5
Downloaded git-ref-format v0.3.1
Downloaded sqlite3-sys v0.15.2
Downloaded thiserror v2.0.12
Downloaded subtle v2.5.0
Downloaded stable_deref_trait v1.2.0
Downloaded vsimd v0.8.0
Downloaded unicode-display-width v0.3.0
Downloaded yoke-derive v0.7.5
Downloaded siphasher v1.0.1
Downloaded gix-revwalk v0.17.0
Downloaded gix-traverse v0.43.1
Downloaded num v0.4.3
Downloaded streaming-iterator v0.1.9
Downloaded normalize-line-endings v0.3.0
Downloaded yoke v0.7.5
Downloaded pkcs1 v0.7.5
Downloaded gix-credentials v0.26.0
Downloaded gix-chunk v0.4.11
Downloaded gix-utils v0.1.14
Downloaded toml_datetime v0.7.0
Downloaded tree-sitter-toml-ng v0.6.0
Downloaded tree-sitter-json v0.24.8
Downloaded typenum v1.17.0
Downloaded gix-fs v0.12.1
Downloaded icu_properties v1.5.1
Downloaded utf16_iter v1.0.5
Downloaded git-ref-format-macro v0.3.1
Downloaded gix-actor v0.33.2
Downloaded xattr v1.3.1
Downloaded fxhash v0.2.1
Downloaded gix-sec v0.10.12
Downloaded gix-date v0.9.4
Downloaded idna_adapter v1.2.0
Downloaded icu_locid_transform_data v1.5.1
Downloaded ssh-encoding v0.2.0
Downloaded mio v0.8.11
Downloaded lazy_static v1.5.0
Downloaded tinyvec_macros v0.1.1
Downloaded gix-shallow v0.1.0
Downloaded yansi v0.5.1
Downloaded serde v1.0.219
Downloaded getrandom v0.3.3
Downloaded lexopt v0.3.0
Downloaded tinyvec v1.6.0
Downloaded uuid-simd v0.8.0
Downloaded pkcs8 v0.10.2
Downloaded gix-trace v0.1.12
Downloaded tracing-core v0.1.34
Downloaded miniz_oxide v0.8.8
Downloaded maybe-async v0.2.10
Downloaded winnow v0.6.26
Downloaded gix-refspec v0.27.0
Downloaded gix-tempfile v15.0.0
Downloaded unicode-segmentation v1.11.0
Downloaded num-bigint v0.4.6
Downloaded hashbrown v0.14.3
Downloaded gix-diff v0.49.0
Downloaded serde_derive v1.0.219
Downloaded socket2 v0.5.7
Downloaded once_cell v1.21.3
Downloaded similar v2.5.0
Downloaded toml v0.9.5
Downloaded tree-sitter v0.24.4
Downloaded syn v2.0.89
Downloaded indexmap v2.2.6
Downloaded tracing v0.1.41
Downloaded tree-sitter-md v0.3.2
Downloaded ssh-key v0.6.6
Downloaded jsonschema v0.30.0
Downloaded serde_json v1.0.140
Downloaded tree-sitter-rust v0.23.2
Downloaded p521 v0.13.3
Downloaded tracing-subscriber v0.3.19
Downloaded radicle-surf v0.22.0
Downloaded vcpkg v0.2.15
Downloaded git2 v0.19.0
Downloaded tree-sitter-ruby v0.23.1
Downloaded regex-syntax v0.6.29
Downloaded tree-sitter-bash v0.23.3
Downloaded regex-syntax v0.8.5
Downloaded rustix v0.38.34
Downloaded rustix v1.0.7
Downloaded object v0.36.7
Downloaded regex v1.11.1
Downloaded p384 v0.13.0
Downloaded jiff v0.2.1
Downloaded num-bigint-dig v0.8.4
Downloaded unicode-normalization v0.1.23
Downloaded tree-sitter-go v0.23.4
Downloaded schemars v1.0.4
Downloaded regex-automata v0.1.10
Downloaded fraction v0.15.3
Downloaded bstr v1.9.1
Downloaded libc v0.2.174
Downloaded tree-sitter-typescript v0.23.2
Downloaded regex-automata v0.4.9
Downloaded memchr v2.7.2
Downloaded gimli v0.31.1
Downloaded bloomy v1.2.0
Downloaded rand v0.8.5
Downloaded prodash v29.0.2
Downloaded uuid v1.16.0
Downloaded tree-sitter-c v0.23.2
Downloaded syn v1.0.109
Downloaded pretty_assertions v1.4.0
Downloaded icu_properties_data v1.5.1
Downloaded sha3 v0.10.8
Downloaded signals_receipts v0.2.0
Downloaded proc-macro2 v1.0.92
Downloaded parking_lot v0.12.3
Downloaded p256 v0.13.2
Downloaded zerocopy v0.7.35
Downloaded unicode-ident v1.0.12
Downloaded smallvec v1.13.2
Downloaded tinystr v0.7.6
Downloaded timeago v0.4.2
Downloaded signal-hook-registry v1.4.5
Downloaded signal-hook v0.3.18
Downloaded poly1305 v0.8.0
Downloaded os_info v3.12.0
Downloaded chrono v0.4.38
Downloaded jobserver v0.1.31
Downloaded gix-commitgraph v0.25.1
Downloaded zerovec v0.10.4
Downloaded idna v1.0.3
Downloaded tree-sitter-python v0.23.4
Downloaded spin v0.9.8
Downloaded spki v0.7.3
Downloaded referencing v0.30.0
Downloaded sec1 v0.7.3
Downloaded qcheck v1.0.0
Downloaded pin-project-lite v0.2.16
Downloaded linux-raw-sys v0.4.13
Downloaded overload v0.1.1
Downloaded libm v0.2.8
Downloaded rustc-demangle v0.1.26
Downloaded rsa v0.9.6
Downloaded gix-lock v15.0.1
Downloaded crossterm v0.29.0
Downloaded gix-features v0.39.1
Downloaded getrandom v0.2.15
Downloaded typeid v1.0.3
Downloaded keccak v0.1.5
Downloaded num-traits v0.2.19
Downloaded version_check v0.9.4
Downloaded zeroize v1.7.0
Downloaded toml_writer v1.0.2
Downloaded nonempty v0.5.0
Downloaded memmap2 v0.9.4
Downloaded utf8_iter v1.0.4
Downloaded gix-command v0.4.1
Downloaded mio v1.0.4
Downloaded inquire v0.7.5
Downloaded serde-untagged v0.1.7
Downloaded schemars_derive v1.0.4
Downloaded primeorder v0.13.6
Downloaded ssh-cipher v0.2.0
Downloaded libgit2-sys v0.17.0+1.8.1
Downloaded utf8parse v0.2.1
Downloaded gix-hashtable v0.6.0
Downloaded gix-hash v0.15.1
Downloaded generic-array v0.14.7
Downloaded hmac v0.12.1
Downloaded quote v1.0.36
Downloaded pkg-config v0.3.30
Downloaded snapbox v0.4.17
Downloaded num-complex v0.4.6
Downloaded ryu v1.0.17
Downloaded tree-sitter-html v0.23.2
Downloaded url v2.5.4
Downloaded ppv-lite86 v0.2.17
Downloaded num-integer v0.1.46
Downloaded signature v1.6.4
Downloaded group v0.13.0
Downloaded zerovec-derive v0.10.3
Downloaded gix-url v0.28.2
Downloaded linux-raw-sys v0.9.4
Downloaded derive_more-impl v2.0.1
Downloaded icu_provider v1.5.0
Downloaded icu_normalizer_data v1.5.1
Downloaded gix-transport v0.44.0
Downloaded gix-odb v0.66.0
Downloaded socks5-client v0.4.1
Downloaded tree-sitter-highlight v0.24.4
Downloaded gix-validate v0.9.4
Downloaded icu_normalizer v1.5.0
Downloaded sha1_smol v1.0.0
Downloaded popol v3.0.0
Downloaded tracing-log v0.2.0
Downloaded crossterm v0.25.0
Downloaded crossbeam-channel v0.5.15
Downloaded cc v1.2.2
Downloaded tree-sitter-css v0.23.1
Downloaded thread_local v1.1.9
Downloaded log v0.4.27
Downloaded nu-ansi-term v0.46.0
Downloaded icu_collections v1.5.0
Downloaded icu_locid_transform v1.5.0
Downloaded gix-revision v0.31.1
Downloaded tar v0.4.40
Downloaded radicle-git-ext v0.8.1
Downloaded cyphernet v0.5.2
Downloaded sem_safe v0.2.0
Downloaded nonempty v0.9.0
Downloaded sqlite3-src v0.5.1
Downloaded gix-object v0.46.1
Downloaded gix-pack v0.56.0
Downloaded lock_api v0.4.11
Downloaded proc-macro-error v1.0.4
Downloaded phf v0.11.3
Downloaded chacha20poly1305 v0.10.1
Downloaded icu_provider_macros v1.5.0
Downloaded thiserror-impl v2.0.12
Downloaded parking_lot_core v0.9.9
Downloaded tempfile v3.10.1
Downloaded num-cmp v0.1.0
Downloaded gix-config-value v0.14.12
Downloaded zerofrom-derive v0.1.6
Downloaded zerofrom v0.1.6
Downloaded scrypt v0.11.0
Downloaded base64 v0.21.7
Downloaded thiserror-impl v1.0.69
Downloaded opaque-debug v0.3.1
Downloaded writeable v0.5.5
Downloaded walkdir v2.5.0
Downloaded thiserror v1.0.69
Downloaded icu_locid v1.5.0
Downloaded gix-ref v0.49.1
Downloaded sqlite v0.32.0
Downloaded signature v2.2.0
Downloaded rand_chacha v0.3.1
Downloaded flate2 v1.1.1
Downloaded derive_more v2.0.1
Downloaded crypto-bigint v0.5.5
Downloaded litrs v0.4.1
Downloaded num-iter v0.1.45
Downloaded matchers v0.1.0
Downloaded gix-negotiate v0.17.0
Downloaded git-ref-format-core v0.3.1
Downloaded unicode-width v0.1.11
Downloaded test-log v0.2.18
Downloaded systemd-journal-logger v2.2.2
Downloaded same-file v1.0.6
Downloaded salsa20 v0.10.2
Downloaded pbkdf2 v0.12.2
Downloaded fancy-regex v0.14.0
Downloaded der v0.7.9
Downloaded synstructure v0.13.1
Downloaded num-rational v0.4.2
Downloaded fluent-uri v0.3.2
Downloaded sha2 v0.10.8
Downloaded ghash v0.5.1
Downloaded write16 v1.0.0
Downloaded universal-hash v0.5.1
Downloaded netservices v0.8.0
Downloaded scopeguard v1.2.0
Downloaded qcheck-macros v1.0.0
Downloaded percent-encoding v2.3.1
Downloaded signal-hook-mio v0.2.4
Downloaded radicle-std-ext v0.1.0
Downloaded outref v0.5.2
Downloaded arc-swap v1.7.1
Downloaded io-reactor v0.5.2
Downloaded gix-protocol v0.47.0
Downloaded polyval v0.6.2
Downloaded gix-prompt v0.9.1
Downloaded gix-path v0.10.15
Downloaded env_logger v0.11.8
Downloaded ref-cast v1.0.24
Downloaded proc-macro-error-attr v1.0.4
Downloaded emojis v0.6.4
Downloaded elliptic-curve v0.13.8
Downloaded libz-sys v1.1.16
Downloaded bytes v1.10.1
Downloaded diff v0.1.13
Downloaded email_address v0.2.9
Downloaded crc32fast v1.4.0
Downloaded inout v0.1.3
Downloaded gix-quote v0.4.15
Downloaded gix-packetline v0.18.4
Downloaded byteorder v1.5.0
Downloaded ref-cast-impl v1.0.24
Downloaded phf_shared v0.11.3
Downloaded anyhow v1.0.82
Downloaded ff v0.13.0
Downloaded digest v0.10.7
Downloaded ecdsa v0.16.9
Downloaded ec25519 v0.1.0
Downloaded displaydoc v0.2.5
Downloaded colored v2.1.0
Downloaded cipher v0.4.4
Downloaded siphasher v0.3.11
Downloaded sharded-slab v0.1.7
Downloaded chacha20 v0.9.1
Downloaded cbc v0.1.2
Downloaded data-encoding v2.5.0
Downloaded block-padding v0.3.3
Downloaded base64 v0.22.1
Downloaded ascii v1.1.0
Downloaded blowfish v0.9.1
Downloaded anstyle v1.0.6
Downloaded colorchoice v1.0.0
Downloaded base-x v0.2.11
Downloaded pem-rfc7468 v0.7.0
Downloaded form_urlencoded v1.2.1
Downloaded data-encoding-macro v0.1.14
Downloaded cpufeatures v0.2.12
Downloaded backtrace v0.3.75
Downloaded document-features v0.2.11
Downloaded ctr v0.9.2
Downloaded crypto-common v0.1.6
Downloaded convert_case v0.7.1
Downloaded bytecount v0.6.8
Downloaded autocfg v1.2.0
Downloaded anstyle-parse v0.2.3
Downloaded cfg-if v1.0.0
Downloaded borrow-or-share v0.2.2
Downloaded bit-set v0.8.0
Downloaded errno v0.3.13
Downloaded erased-serde v0.4.6
Downloaded equivalent v1.0.1
Downloaded either v1.11.0
Downloaded dyn-clone v1.0.17
Downloaded data-encoding-macro-internal v0.1.12
Downloaded cyphergraphy v0.3.0
Downloaded bcrypt-pbkdf v0.10.0
Downloaded base64ct v1.6.0
Downloaded ct-codecs v1.1.1
Downloaded bitflags v2.9.1
Downloaded base64 v0.13.1
Downloaded anstyle-query v1.0.2
Downloaded aho-corasick v1.1.3
Downloaded env_filter v0.1.3
Downloaded block-buffer v0.10.4
Downloaded base32 v0.4.0
Downloaded anstream v0.6.13
Downloaded amplify_syn v2.0.1
Downloaded amplify_num v0.5.2
Downloaded bitflags v1.3.2
Downloaded bit-vec v0.8.0
Downloaded aes v0.8.4
Downloaded addr2line v0.24.2
Downloaded amplify_derive v4.0.0
Downloaded amplify v4.6.0
Downloaded ahash v0.8.11
Downloaded aead v0.5.2
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
Compiling syn v2.0.89
Compiling jobserver v0.1.31
Checking log v0.4.27
Compiling cc v1.2.2
Checking getrandom v0.2.15
Checking smallvec v1.13.2
Checking aho-corasick v1.1.3
Checking regex-syntax v0.8.5
Compiling typenum v1.17.0
Compiling generic-array v0.14.7
Checking rand_core v0.6.4
Checking regex-automata v0.4.9
Checking fastrand v2.1.0
Checking bitflags v2.9.1
Compiling lock_api v0.4.11
Compiling parking_lot_core v0.9.9
Checking scopeguard v1.2.0
Checking crypto-common v0.1.6
Checking stable_deref_trait v1.2.0
Checking subtle v2.5.0
Checking parking_lot v0.12.3
Compiling synstructure v0.13.1
Checking once_cell v1.21.3
Compiling syn v1.0.109
Checking tinyvec_macros v0.1.1
Checking tinyvec v1.6.0
Checking zeroize v1.7.0
Checking unicode-normalization v0.1.23
Checking bstr v1.9.1
Checking cpufeatures v0.2.12
Checking writeable v0.5.5
Compiling icu_locid_transform_data v1.5.1
Compiling serde_derive v1.0.219
Compiling zerofrom-derive v0.1.6
Compiling yoke-derive v0.7.5
Checking zerofrom v0.1.6
Compiling zerovec-derive v0.10.3
Checking yoke v0.7.5
Compiling displaydoc v0.2.5
Compiling crc32fast v1.4.0
Checking zerovec v0.10.4
Compiling thiserror v2.0.12
Checking litemap v0.7.5
Compiling icu_provider_macros v1.5.0
Compiling thiserror-impl v2.0.12
Checking tinystr v0.7.6
Checking icu_locid 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
Compiling icu_normalizer_data v1.5.1
Checking hashbrown v0.14.3
Compiling pkg-config v0.3.30
Checking itoa v1.0.11
Checking icu_locid_transform v1.5.0
Checking digest v0.10.7
Checking cipher v0.4.4
Checking icu_collections v1.5.0
Checking write16 v1.0.0
Checking utf8_iter v1.0.4
Compiling thiserror v1.0.69
Checking utf16_iter v1.0.5
Checking adler2 v2.0.0
Compiling thiserror-impl v1.0.69
Checking miniz_oxide v0.8.8
Checking icu_properties v1.5.1
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
Compiling vcpkg v0.2.15
Compiling amplify_syn v2.0.1
Checking icu_normalizer v1.5.0
Checking idna_adapter v1.2.0
Compiling libz-sys v1.1.16
Checking idna v1.0.3
Compiling data-encoding v2.5.0
Checking gix-trace v0.1.12
Checking url v2.5.4
Compiling amplify_derive v4.0.0
Checking tempfile v3.10.1
Checking ascii v1.1.0
Compiling data-encoding-macro-internal v0.1.12
Checking signature v1.6.4
Checking amplify_num v0.5.2
Checking ed25519 v1.5.3
Checking faster-hex v0.9.0
Checking data-encoding-macro v0.1.14
Compiling libgit2-sys v0.17.0+1.8.1
Checking aead v0.5.2
Compiling num-traits v0.2.19
Compiling proc-macro-error-attr v1.0.4
Checking ct-codecs v1.1.1
Checking base-x v0.2.11
Checking byteorder v1.5.0
Checking multibase v0.9.1
Checking amplify v4.6.0
Checking ec25519 v0.1.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 cyphergraphy v0.3.0
Checking gix-hash v0.15.1
Checking keccak v0.1.5
Checking same-file v1.0.6
Compiling crossbeam-utils v0.8.19
Checking walkdir v2.5.0
Checking sha3 v0.10.8
Checking flate2 v1.1.1
Compiling git-ref-format-core v0.3.1
Checking polyval v0.6.2
Checking hmac v0.12.1
Compiling sqlite3-src v0.5.1
Checking prodash v29.0.2
Checking sha1_smol v1.0.0
Checking base64ct v1.6.0
Checking equivalent v1.0.1
Checking base32 v0.4.0
Checking ppv-lite86 v0.2.17
Compiling serde_json v1.0.140
Checking pem-rfc7468 v0.7.0
Checking cypheraddr v0.4.0
Checking rand_chacha v0.3.1
Checking gix-features v0.39.1
Checking indexmap v2.2.6
Compiling git-ref-format-macro v0.3.1
Checking pbkdf2 v0.12.2
Checking ghash v0.5.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 crossbeam-channel v0.5.15
Checking noise-framework v0.4.0
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 home v0.5.9
Checking radicle-std-ext v0.1.0
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.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/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
Compiling serde_derive_internals v0.29.1
Checking radicle-dag v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-dag)
Checking erased-serde v0.4.6
Checking iana-time-zone v0.1.60
Checking jiff v0.2.1
Compiling schemars_derive v1.0.4
Checking schemars v1.0.4
Checking chrono v0.4.38
Checking gix-date v0.9.4
Checking serde-untagged v0.1.7
Checking colored v2.1.0
Checking bytesize v2.0.1
Checking localtime v1.3.1
Checking winnow v0.6.26
Checking dunce v1.0.5
Checking tree-sitter-language v0.1.2
Checking anstyle-query v1.0.2
Checking base64 v0.21.7
Checking fast-glob v0.3.3
Checking gix-hashtable v0.6.0
Checking gix-validate v0.9.4
Checking utf8parse v0.2.1
Checking anstyle-parse v0.2.3
Checking memmap2 v0.9.4
Checking gix-actor v0.33.2
Compiling rustix v1.0.7
Checking gix-object v0.46.1
Checking colorchoice v1.0.0
Compiling anyhow v1.0.82
Checking anstyle v1.0.6
Checking anstream v0.6.13
Checking gix-chunk v0.4.11
Checking linux-raw-sys v0.9.4
Checking gix-commitgraph v0.25.1
Checking gix-revwalk v0.17.0
Checking gix-fs v0.12.1
Checking errno v0.3.13
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
Compiling getrandom v0.3.3
Checking shell-words v1.1.0
Checking gix-command v0.4.1
Checking radicle-signals v0.11.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-signals)
Compiling tree-sitter v0.24.4
Checking mio v0.8.11
Checking mio v1.0.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-url v0.28.2
Checking gix-config-value v0.14.12
Checking gix-quote v0.4.15
Checking regex v1.11.1
Checking gix-sec v0.10.12
Checking gix-prompt v0.9.1
Compiling xattr v1.3.1
Checking uuid v1.16.0
Compiling derive_more-impl v2.0.1
Compiling filetime v0.2.23
Checking gix-revision v0.31.1
Checking gix-traverse v0.43.1
Checking gix-diff v0.49.0
Checking gix-packetline v0.18.4
Compiling object v0.36.7
Checking lexopt v0.3.0
Checking bitflags v1.3.2
Compiling litrs v0.4.1
Checking crossterm v0.25.0
Compiling document-features v0.2.11
Checking gix-transport v0.44.0
Checking gix-pack v0.56.0
Checking derive_more v2.0.1
Checking gix-refspec v0.27.0
Compiling tar v0.4.40
Checking gix-credentials v0.26.0
Checking newline-converter v0.3.0
Checking gix-ref v0.49.1
Checking gix-shallow v0.1.0
Checking gix-negotiate v0.17.0
Checking fxhash v0.2.1
Compiling maybe-async v0.2.10
Checking unicode-width v0.1.11
Checking arc-swap v1.7.1
Checking streaming-iterator v0.1.9
Checking gimli v0.31.1
Checking gix-protocol v0.47.0
Checking sqlite3-sys v0.15.2
Checking sqlite v0.32.0
Checking gix-odb v0.66.0
Checking inquire v0.7.5
Compiling radicle-surf v0.22.0
Checking crossterm v0.29.0
Checking addr2line v0.24.2
Checking unicode-display-width v0.3.0
Checking toml_datetime v0.7.0
Checking serde_spanned v1.0.0
Compiling tree-sitter-bash v0.23.3
Compiling tree-sitter-rust v0.23.2
Compiling tree-sitter-go v0.23.4
Compiling tree-sitter-html v0.23.2
Compiling tree-sitter-toml-ng v0.6.0
Compiling tree-sitter-python v0.23.4
Compiling tree-sitter-typescript v0.23.2
Compiling tree-sitter-ruby v0.23.1
Compiling tree-sitter-md v0.3.2
Compiling tree-sitter-c v0.23.2
Compiling tree-sitter-css v0.23.1
Compiling tree-sitter-json v0.24.8
Checking rustc-demangle v0.1.26
Checking either v1.11.0
Checking toml_writer v1.0.2
Checking backtrace v0.3.75
Checking toml v0.9.5
Checking snapbox-macros v0.3.8
Checking salsa20 v0.10.2
Checking os_info v3.12.0
Checking normalize-line-endings v0.3.0
Checking nonempty v0.5.0
Checking similar v2.5.0
Compiling radicle-cli v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli)
Checking base64 v0.13.1
Checking siphasher v0.3.11
Checking snapbox v0.4.17
Checking bloomy v1.2.0
Checking human-panic v2.0.3
Checking scrypt v0.11.0
Checking tree-sitter-highlight v0.24.4
Checking systemd-journal-logger v2.2.2
Checking popol v3.0.0
Checking timeago v0.4.2
Checking bytes v1.10.1
Checking io-reactor v0.5.2
Checking socket2 v0.5.7
Checking yansi v0.5.1
Checking diff v0.1.13
Compiling radicle-node v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-node)
Checking netservices v0.8.0
Checking pretty_assertions v1.4.0
Checking radicle-systemd v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-systemd)
Checking num-integer v0.1.46
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.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-remote-helper)
Checking num-iter v0.1.45
Checking num-complex v0.4.6
Checking env_filter v0.1.3
Checking num-rational v0.4.2
Checking bit-vec v0.8.0
Checking borrow-or-share v0.2.2
Checking zerocopy v0.7.35
Checking bit-set v0.8.0
Checking fluent-uri v0.3.2
Checking num v0.4.3
Checking env_logger v0.11.8
Checking phf_shared v0.11.3
Compiling test-log-macros v0.2.18
Checking vsimd v0.8.0
Checking outref v0.5.2
Checking referencing v0.30.0
Checking uuid-simd v0.8.0
Checking phf v0.11.3
Checking test-log v0.2.18
Checking fraction v0.15.3
Checking fancy-regex v0.14.0
Checking email_address v0.2.9
Checking bytecount v0.6.8
Checking num-cmp v0.1.0
Checking base64 v0.22.1
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.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-term)
Checking radicle-crypto v0.13.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-crypto)
Checking radicle-cob v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cob)
Checking radicle v0.18.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle)
Checking radicle-fetch v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-fetch)
Checking radicle-cli-test v0.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli-test)
Checking radicle-schemars v0.4.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-schemars)
Checking radicle-protocol v0.2.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-protocol)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 48.41s
+ cargo build --all-targets --workspace
Compiling cfg-if v1.0.0
Compiling libc v0.2.174
Compiling shlex v1.3.0
Compiling serde v1.0.219
Compiling memchr v2.7.2
Compiling log v0.4.27
Compiling smallvec v1.13.2
Compiling jobserver v0.1.31
Compiling getrandom v0.2.15
Compiling aho-corasick v1.1.3
Compiling cc v1.2.2
Compiling regex-syntax v0.8.5
Compiling typenum v1.17.0
Compiling rand_core v0.6.4
Compiling generic-array v0.14.7
Compiling bitflags v2.9.1
Compiling regex-automata v0.4.9
Compiling crypto-common v0.1.6
Compiling fastrand v2.1.0
Compiling scopeguard v1.2.0
Compiling lock_api v0.4.11
Compiling zerofrom v0.1.6
Compiling parking_lot_core v0.9.9
Compiling stable_deref_trait v1.2.0
Compiling subtle v2.5.0
Compiling yoke v0.7.5
Compiling parking_lot v0.12.3
Compiling once_cell v1.21.3
Compiling tinyvec_macros v0.1.1
Compiling tinyvec v1.6.0
Compiling zerovec v0.10.4
Compiling zeroize v1.7.0
Compiling unicode-normalization v0.1.23
Compiling cpufeatures v0.2.12
Compiling litemap v0.7.5
Compiling tinystr v0.7.6
Compiling writeable v0.5.5
Compiling adler2 v2.0.0
Compiling icu_locid v1.5.0
Compiling miniz_oxide v0.8.8
Compiling block-padding v0.3.3
Compiling thiserror v2.0.12
Compiling bstr v1.9.1
Compiling icu_provider v1.5.0
Compiling inout v0.1.3
Compiling icu_locid_transform_data v1.5.1
Compiling block-buffer v0.10.4
Compiling itoa v1.0.11
Compiling hashbrown v0.14.3
Compiling digest v0.10.7
Compiling icu_locid_transform v1.5.0
Compiling cipher v0.4.4
Compiling crc32fast v1.4.0
Compiling icu_properties_data v1.5.1
Compiling icu_collections v1.5.0
Compiling icu_normalizer_data v1.5.1
Compiling write16 v1.0.0
Compiling utf8_iter v1.0.4
Compiling utf16_iter v1.0.5
Compiling icu_properties v1.5.1
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 ascii v1.1.0
Compiling icu_normalizer v1.5.0
Compiling data-encoding v2.5.0
Compiling idna_adapter v1.2.0
Compiling idna v1.0.3
Compiling url v2.5.4
Compiling tempfile v3.10.1
Compiling amplify_num v0.5.2
Compiling signature v1.6.4
Compiling ed25519 v1.5.3
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 ct-codecs v1.1.1
Compiling byteorder v1.5.0
Compiling base-x v0.2.11
Compiling multibase v0.9.1
Compiling ec25519 v0.1.0
Compiling poly1305 v0.8.0
Compiling amplify v4.6.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 walkdir v2.5.0
Compiling sha3 v0.10.8
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 base32 v0.4.0
Compiling equivalent v1.0.1
Compiling sha1_smol v1.0.0
Compiling base64ct v1.6.0
Compiling ppv-lite86 v0.2.17
Compiling pem-rfc7468 v0.7.0
Compiling rand_chacha v0.3.1
Compiling gix-features v0.39.1
Compiling indexmap v2.2.6
Compiling cypheraddr v0.4.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 aes v0.8.4
Compiling ctr v0.9.2
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 socks5-client v0.4.1
Compiling rand v0.8.5
Compiling ssh-encoding v0.2.0
Compiling blowfish v0.9.1
Compiling cbc v0.1.2
Compiling radicle-std-ext v0.1.0
Compiling home v0.5.9
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.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/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 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-dag)
Compiling nonempty v0.9.0
Compiling erased-serde v0.4.6
Compiling jiff v0.2.1
Compiling iana-time-zone v0.1.60
Compiling chrono v0.4.38
Compiling serde-untagged v0.1.7
Compiling schemars v1.0.4
Compiling gix-date v0.9.4
Compiling colored v2.1.0
Compiling bytesize v2.0.1
Compiling localtime v1.3.1
Compiling winnow v0.6.26
Compiling tree-sitter-language v0.1.2
Compiling dunce v1.0.5
Compiling anstyle-query v1.0.2
Compiling base64 v0.21.7
Compiling fast-glob v0.3.3
Compiling gix-hashtable v0.6.0
Compiling gix-validate v0.9.4
Compiling gix-actor v0.33.2
Compiling utf8parse v0.2.1
Compiling anstyle-parse v0.2.3
Compiling gix-object v0.46.1
Compiling memmap2 v0.9.4
Compiling colorchoice v1.0.0
Compiling anstyle v1.0.6
Compiling anstream v0.6.13
Compiling gix-chunk v0.4.11
Compiling linux-raw-sys v0.9.4
Compiling gix-commitgraph v0.25.1
Compiling rustix v1.0.7
Compiling gix-revwalk v0.17.0
Compiling anyhow v1.0.82
Compiling gix-fs v0.12.1
Compiling sem_safe v0.2.0
Compiling errno v0.3.13
Compiling unicode-segmentation v1.11.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 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-signals)
Compiling tree-sitter v0.24.4
Compiling mio v0.8.11
Compiling mio v1.0.4
Compiling signal-hook-mio v0.2.4
Compiling getrandom v0.3.3
Compiling gix-lock v15.0.1
Compiling convert_case v0.7.1
Compiling gix-url v0.28.2
Compiling gix-config-value v0.14.12
Compiling gix-quote v0.4.15
Compiling regex v1.11.1
Compiling gix-sec v0.10.12
Compiling sqlite3-sys v0.15.2
Compiling sqlite v0.32.0
Compiling gix-prompt v0.9.1
Compiling derive_more-impl v2.0.1
Compiling uuid v1.16.0
Compiling xattr v1.3.1
Compiling gix-traverse v0.43.1
Compiling gix-revision v0.31.1
Compiling gix-diff v0.49.0
Compiling gix-packetline v0.18.4
Compiling filetime v0.2.23
Compiling lexopt v0.3.0
Compiling bitflags v1.3.2
Compiling crossterm v0.25.0
Compiling gix-transport v0.44.0
Compiling tar v0.4.40
Compiling derive_more v2.0.1
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 streaming-iterator v0.1.9
Compiling unicode-width v0.1.11
Compiling arc-swap v1.7.1
Compiling gimli v0.31.1
Compiling gix-odb v0.66.0
Compiling inquire v0.7.5
Compiling addr2line v0.24.2
Compiling gix-protocol v0.47.0
Compiling radicle-surf v0.22.0
Compiling crossterm v0.29.0
Compiling object v0.36.7
Compiling unicode-display-width v0.3.0
Compiling tree-sitter-c v0.23.2
Compiling tree-sitter-ruby v0.23.1
Compiling tree-sitter-bash v0.23.3
Compiling tree-sitter-typescript v0.23.2
Compiling tree-sitter-html v0.23.2
Compiling tree-sitter-json v0.24.8
Compiling tree-sitter-go v0.23.4
Compiling tree-sitter-css v0.23.1
Compiling tree-sitter-md v0.3.2
Compiling tree-sitter-rust v0.23.2
Compiling tree-sitter-toml-ng v0.6.0
Compiling tree-sitter-python v0.23.4
Compiling serde_spanned v1.0.0
Compiling toml_datetime v0.7.0
Compiling rustc-demangle v0.1.26
Compiling toml_writer v1.0.2
Compiling either v1.11.0
Compiling backtrace v0.3.75
Compiling toml v0.9.5
Compiling snapbox-macros v0.3.8
Compiling salsa20 v0.10.2
Compiling os_info v3.12.0
Compiling radicle-cli v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli)
Compiling siphasher v0.3.11
Compiling base64 v0.13.1
Compiling normalize-line-endings v0.3.0
Compiling similar v2.5.0
Compiling nonempty v0.5.0
Compiling bloomy v1.2.0
Compiling human-panic v2.0.3
Compiling scrypt v0.11.0
Compiling snapbox v0.4.17
Compiling tree-sitter-highlight v0.24.4
Compiling systemd-journal-logger v2.2.2
Compiling popol v3.0.0
Compiling timeago v0.4.2
Compiling bytes v1.10.1
Compiling io-reactor v0.5.2
Compiling socket2 v0.5.7
Compiling diff v0.1.13
Compiling radicle-node v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-node)
Compiling yansi v0.5.1
Compiling netservices v0.8.0
Compiling pretty_assertions v1.4.0
Compiling radicle-systemd v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-systemd)
Compiling num-integer v0.1.46
Compiling escargot v0.5.10
Compiling radicle-remote-helper v0.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-remote-helper)
Compiling num-bigint v0.4.6
Compiling num-iter v0.1.45
Compiling num-complex v0.4.6
Compiling env_filter v0.1.3
Compiling bit-vec v0.8.0
Compiling num-rational v0.4.2
Compiling borrow-or-share v0.2.2
Compiling zerocopy v0.7.35
Compiling num v0.4.3
Compiling ahash v0.8.11
Compiling fluent-uri v0.3.2
Compiling bit-set v0.8.0
Compiling env_logger v0.11.8
Compiling phf_shared v0.11.3
Compiling outref v0.5.2
Compiling vsimd v0.8.0
Compiling test-log v0.2.18
Compiling referencing v0.30.0
Compiling phf v0.11.3
Compiling fancy-regex v0.14.0
Compiling uuid-simd v0.8.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.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-term)
Compiling radicle-crypto v0.13.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-crypto)
Compiling radicle-cob v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cob)
Compiling radicle v0.18.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle)
Compiling radicle-fetch v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-fetch)
Compiling radicle-protocol v0.2.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-protocol)
Compiling radicle-cli-test v0.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli-test)
Compiling radicle-schemars v0.4.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-schemars)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 14s
+ 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.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-ssh)
Compiling num-traits v0.2.19
Checking url v2.5.4
Checking radicle-dag v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-dag)
Checking git2 v0.19.0
Checking chrono v0.4.38
Compiling amplify_syn v2.0.1
Checking bstr v1.9.1
Compiling proc-macro-error v1.0.4
Checking radicle-signals v0.11.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-signals)
Checking git-ref-format-core v0.3.1
Checking gix-path v0.10.15
Compiling amplify_derive v4.0.0
Compiling data-encoding-macro-internal v0.1.12
Compiling git-ref-format-macro v0.3.1
Checking gix-date v0.9.4
Checking gix-actor v0.33.2
Checking gix-validate v0.9.4
Checking gix-object v0.46.1
Checking git-ref-format v0.3.1
Checking radicle-git-ext v0.8.1
Checking data-encoding-macro v0.1.14
Checking multibase v0.9.1
Checking gix-commitgraph v0.25.1
Checking gix-command v0.4.1
Checking regex v1.11.1
Checking tree-sitter v0.24.4
Checking gix-config-value v0.14.12
Checking gix-revwalk v0.17.0
Checking gix-url v0.28.2
Checking gix-quote v0.4.15
Checking uuid v1.16.0
Checking gix-prompt v0.9.1
Checking gix-revision v0.31.1
Checking gix-traverse v0.43.1
Checking gix-diff v0.49.0
Checking gix-packetline v0.18.4
Compiling radicle-cli v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli)
Checking radicle-surf v0.22.0
Checking gix-pack v0.56.0
Checking gix-transport v0.44.0
Checking human-panic v2.0.3
Checking gix-refspec v0.27.0
Checking gix-credentials v0.26.0
Checking amplify v4.6.0
Checking tree-sitter-toml-ng v0.6.0
Checking gix-shallow v0.1.0
Checking gix-ref v0.49.1
Checking cyphergraphy v0.3.0
Checking radicle-term v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-term)
Checking cypheraddr v0.4.0
Checking socks5-client v0.4.1
Checking noise-framework v0.4.0
Checking tree-sitter-highlight v0.24.4
Checking gix-negotiate v0.17.0
Checking gix-odb v0.66.0
Checking cyphernet v0.5.2
Checking io-reactor v0.5.2
Checking radicle-crypto v0.13.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-crypto)
Checking gix-protocol v0.47.0
Compiling radicle-node v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-node)
Checking radicle-cob v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cob)
Checking netservices v0.8.0
Checking radicle-systemd v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-systemd)
Checking radicle v0.18.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle)
Documenting radicle v0.18.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle)
Documenting radicle-cob v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cob)
Documenting radicle-crypto v0.13.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-crypto)
Documenting radicle-systemd v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-systemd)
Documenting radicle-term v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-term)
Documenting radicle-signals v0.11.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-signals)
Documenting radicle-ssh v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-ssh)
Documenting radicle-dag v0.10.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-dag)
Checking radicle-fetch v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-fetch)
Documenting radicle-cli v0.15.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli)
Documenting radicle-schemars v0.4.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-schemars)
Checking radicle-protocol v0.2.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-protocol)
Documenting radicle-protocol v0.2.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-protocol)
Documenting radicle-node v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-node)
Documenting radicle-fetch v0.14.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-fetch)
Documenting radicle-cli-test v0.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-cli-test)
Documenting radicle-remote-helper v0.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-remote-helper)
Checking radicle-remote-helper v0.12.0 (/ef21c432-d317-4408-b8af-de56b0b52452/w/crates/radicle-remote-helper)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.48s
Generated /ef21c432-d317-4408-b8af-de56b0b52452/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.13s
Running unittests src/lib.rs (target/debug/deps/radicle-ec77ac8e387e942c)
running 237 tests
test canonical::formatter::test::ascii_control_characters ... ok
test canonical::formatter::test::ordered_nested_object ... ok
test cob::cache::migrations::_2::tests::test_migration_2 ... ok
test canonical::formatter::test::securesystemslib_asserts ... ok
test cob::common::test::test_color ... ok
test cob::cache::tests::test_migrate_to ... ok
test cob::cache::migrations::_2::tests::test_patch_json_deserialization ... ok
test cob::common::test::test_emojis ... ok
test cob::cache::tests::test_check_version ... 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_remove_delegate_concurrent ... ok
test cob::identity::test::test_identity_update_rejected ... ok
test cob::identity::test::test_identity_reject_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_identity_updates_concurrent ... ok
test cob::identity::test::test_valid_identity ... ok
test cob::issue::test::test_embeds ... 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_actions ... ok
test cob::issue::test::test_invalid_tx ... ok
test cob::issue::test::test_invalid_cob ... ok
test cob::issue::test::test_invalid_tx_reference ... ok
test cob::issue::test::test_concurrency ... ok
test cob::issue::test::test_issue_all ... 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_get ... ok
test cob::issue::test::test_issue_create_and_change_state ... 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_edit_description ... 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_edit ... ok
test cob::issue::test::test_issue_label ... ok
test cob::issue::test::test_issue_react ... ok
test cob::issue::test::test_issue_reply ... ok
test cob::patch::cache::tests::test_is_empty ... ok
test cob::patch::cache::tests::test_counts ... ok
test cob::patch::cache::tests::test_list ... 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::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_by_status ... ok
test cob::patch::test::test_patch_create_and_get ... ok
test cob::patch::test::test_patch_discussion ... ok
test cob::patch::test::test_patch_merge ... ok
test cob::patch::test::test_patch_review ... ok
test cob::patch::test::test_patch_redact ... ok
test cob::patch::test::test_patch_review_comment ... ok
test cob::patch::test::test_patch_review_edit ... 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_comment ... ok
test cob::patch::test::test_reactions_json_serialization ... ok
test cob::patch::test::test_revision_edit_redact ... ok
test cob::patch::test::test_revision_reaction ... ok
test cob::patch::test::test_revision_review_merge_redacted ... ok
test cob::stream::tests::test_all_from ... ok
test cob::patch::test::test_patch_review_revision_redact ... ok
test cob::stream::tests::test_all_until ... ok
test cob::stream::tests::test_all_from_until ... ok
test cob::stream::tests::test_regression_from_until ... ok
test cob::stream::tests::test_from_until ... 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::patch::test::test_patch_update ... ok
test cob::thread::tests::test_edit_comment ... ok
test cob::thread::tests::test_duplicate_comments ... ok
test cob::thread::tests::test_redact_comment ... ok
test git::canonical::quorum::test::merge_base_commutative ... ok
test git::canonical::quorum::test::test_merge_bases ... 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 git::canonical::rules::tests::test_canonical ... ok
test git::canonical::rules::tests::test_rule_validate_success ... ok
test git::canonical::rules::tests::test_special_branches ... ok
test git::canonical::tests::test_commit_quorum_fork_of_a_fork ... ok
test git::canonical::tests::test_commit_quorum_forked_merge_commits ... ok
test git::canonical::tests::test_commit_quorum_groups ... ok
test git::canonical::tests::test_commit_quorum_linear ... ok
test git::canonical::tests::test_commit_quorum_merges ... ok
test git::canonical::tests::test_commit_quorum_single ... ok
test git::canonical::tests::test_commit_quorum_three_way_fork ... ok
test git::canonical::tests::test_commit_quorum_two_way_fork ... ok
test git::canonical::rules::tests::test_rule_validate_failures ... ok
test git::canonical::tests::test_quorum_different_types ... ok
test git::canonical::tests::test_tag_quorum ... 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 cob::thread::tests::prop_ordering ... ok
test identity::doc::test::test_canonical_doc ... ok
test identity::doc::test::test_canonical_example ... 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 git::canonical::tests::test_quorum_properties ... 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 identity::doc::update::test::test_default_branch_rule_exists_after_verification ... ok
test identity::project::test::test_project_name ... 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 node::address::store::test::test_empty ... ok
test identity::doc::test::test_max_delegates ... 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_entries ... ok
test node::address::store::test::test_remove_nothing ... ok
test node::address::store::test::test_node_aliases ... ok
test node::config::test::partial ... 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_policies ... ok
test node::policy::store::test::test_node_aliases ... 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_delete ... ok
test node::refs::store::test::test_set_and_get ... ok
test node::routing::test::test_count ... ok
test node::routing::test::test_entries ... ok
test node::routing::test::test_insert_and_get_resources ... ok
test node::routing::test::test_insert_and_get ... ok
test node::routing::test::test_insert_duplicate ... 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_len ... ok
test node::routing::test::test_remove_many ... ok
test node::routing::test::test_remove_redundant ... ok
test node::routing::test::test_update_existing_multi ... ok
test node::routing::test::test_prune ... ok
test node::sync::announce::test::all_synced_nodes_are_preferred_seeds ... ok
test node::sync::announce::test::announcer_preferred_seeds_or_replica_factor ... ok
test node::sync::announce::test::announcer_adapts_target_to_reach ... ok
test node::sync::announce::test::announcer_reached_max_replication_target ... ok
test node::sync::announce::test::announcer_reached_min_replication_target ... ok
test node::sync::announce::test::announcer_synced_with_unknown_node ... ok
test node::sync::announce::test::announcer_timed_out ... ok
test node::sync::announce::test::announcer_reached_preferred_seeds ... ok
test node::sync::announce::test::cannot_construct_announcer ... ok
test node::sync::announce::test::announcer_with_replication_factor_zero_and_preferred_seeds ... ok
test node::sync::announce::test::construct_node_appears_in_multiple_input_sets ... ok
test node::sync::announce::test::construct_only_preferred_seeds_provided ... ok
test node::sync::announce::test::invariant_progress_should_match_state ... ok
test node::sync::announce::test::local_node_in_multiple_sets ... ok
test node::sync::announce::test::local_node_in_preferred_seeds ... ok
test node::sync::announce::test::local_node_in_synced_set ... ok
test node::sync::announce::test::local_node_only_in_all_sets_results_in_no_seeds_error ... ok
test node::sync::announce::test::local_node_in_unsynced_set ... ok
test node::sync::announce::test::preferred_seeds_already_synced ... ok
test node::sync::announce::test::synced_with_local_node_is_ignored ... ok
test node::sync::announce::test::timed_out_after_reaching_success ... ok
test cob::patch::cache::tests::test_find_by_revision ... ok
test node::sync::fetch::test::all_nodes_are_fetchable ... ok
test node::sync::announce::test::synced_with_same_node_multiple_times ... ok
test node::sync::fetch::test::ignores_duplicates_and_local_node ... ok
test node::sync::fetch::test::could_not_reach_target ... ok
test node::sync::fetch::test::all_nodes_are_candidates ... 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::fetch::test::reaches_target_of_replicas ... ok
test node::sync::test::ensure_replicas_construction ... ok
test node::sync::test::replicas_constrain_to ... 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 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 rad::tests::test_init ... ok
test storage::git::tests::test_references_of ... ok
test profile::config::test::schema ... 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. 237 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.53s
Running unittests src/lib.rs (target/debug/deps/radicle_cli-f8dd795bc37ed550)
running 14 tests
test commands::rad_patch::review::builder::tests::test_review_comments_before ... ok
test commands::rad_inspect::test::test_tree ... ok
test commands::rad_patch::review::builder::tests::test_review_comments_basic ... ok
test git::pretty_diff::test::test_pretty ... ignored
test commands::rad_patch::review::builder::tests::test_review_comments_split_hunk ... ok
test commands::rad_patch::review::builder::tests::test_review_comments_multiline ... ok
test git::ddiff::tests::diff_encode_decode_ddiff_hunk ... ok
test git::unified_diff::test::test_diff_content_encode_decode_content ... ok
test terminal::format::test::test_bytes ... ok
test git::unified_diff::test::test_diff_encode_decode_diff ... ok
test terminal::format::test::test_strip_comments ... ok
test terminal::patch::test::test_edit_display_message ... 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-a289f7ed8659ae22)
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-15a49647099454c2)
running 101 tests
test framework_home ... ok
test git_push_and_fetch ... ok
test git_push_amend ... ok
test git_push_canonical_annotated_tags ... ok
test git_push_canonical_lightweight_tags ... ok
test git_push_diverge ... ok
test rad_auth ... ok
test rad_auth_errors ... ok
test rad_block ... ok
test git_push_rollback ... ok
test git_tag ... ok
test rad_checkout ... ok
test git_push_converge ... ok
test rad_clone ... ok
test rad_clean ... ok
test rad_clone_connect ... 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_operations ... ok
test rad_cob_migrate ... ok
test rad_cob_update_identity ... ok
test rad_cob_show ... ok
test rad_cob_update ... ok
test rad_clone_partial_fail ... ok
test rad_config ... ok
test rad_diff ... ok
test rad_id_collaboration ... ignored, slow
test rad_id ... ok
test rad_id_conflict ... ok
test rad_id_private ... ok
test rad_id_multi_delegate ... ok
test rad_id_threshold ... ok
test rad_id_unknown_field ... ok
test rad_id_update_delete_field ... ok
test rad_id_threshold_soft_fork ... 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_inbox ... ok
test rad_init_private_clone ... ok
test rad_init_private_no_seed ... ok
test rad_init_private_clone_seed ... ok
test rad_init_private_seed ... ok
test rad_fork ... ok
test rad_fetch ... ok
test rad_init_sync_not_connected ... 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_patch ... ok
test rad_node ... 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_patch_diff ... ok
test rad_patch_draft ... ok
test rad_patch_edit ... ok
test rad_init_sync_and_clone ... ok
test rad_init_sync_timeout ... ok
test rad_patch_delete ... ok
test rad_patch_fetch_2 ... ok
test rad_patch_merge_draft ... ok
test rad_patch_revert_merge ... ok
test rad_patch_fetch_1 ... ok
test rad_patch_update ... ok
test rad_publish ... ok
test rad_patch_via_push ... ok
test rad_patch_open_explore ... ok
test rad_review_by_hunk ... ok
test rad_seed_and_follow ... ok
test rad_seed_many ... ok
test rad_remote ... ok
test rad_self ... ok
test rad_sync_without_node ... ok
test rad_unseed ... ok
test rad_push_and_pull_patches ... ok
test rad_unseed_many ... ok
test rad_warn_old_nodes ... ok
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
test result: ok. 99 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 75.33s
Running unittests src/lib.rs (target/debug/deps/radicle_cli_test-b96fb2279f7a3226)
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-2ed645dea51744bb)
running 8 tests
test object::tests::test_serde ... ok
test tests::parse_refstr ... ok
test tests::invalid_parse_refstr ... ok
test tests::roundtrip ... ok
test tests::traverse_cobs ... ok
test type_name::test::valid_typenames ... ok
test tests::list_cobs ... ok
test tests::update_cob ... 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-b4d9cbb5b8695904)
running 12 tests
test ssh::fmt::test::test_key ... ok
test ssh::fmt::test::test_fingerprint ... ok
test ssh::test::prop_encode_decode_sk ... ok
test ssh::test::test_agent_encoding_remove ... ok
test ssh::test::test_agent_encoding_sign ... ok
test ssh::keystore::tests::test_init_no_passphrase ... ok
test tests::prop_encode_decode ... ok
test tests::prop_key_equality ... ok
test tests::test_encode_decode ... ok
test tests::test_e25519_dh ... 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.83s
Running unittests src/lib.rs (target/debug/deps/radicle_dag-7d941d2839407890)
running 20 tests
test tests::test_contains ... ok
test tests::test_cycle ... ok
test tests::test_dependencies ... ok
test tests::test_fold_multiple_roots ... ok
test tests::test_diamond ... ok
test tests::test_fold_reject ... ok
test tests::test_complex ... ok
test tests::test_fold_sorting_1 ... ok
test tests::test_fold_sorting_2 ... ok
test tests::test_get ... ok
test tests::test_is_empty ... ok
test tests::test_merge_1 ... ok
test tests::test_len ... 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_siblings ... ok
test tests::test_fold_diamond ... 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-1bca959eefba4a81)
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-85ec7f657a193eee)
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 ... ok
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_replication_invalid ... ok
test tests::e2e::test_replication_ref_in_sigrefs ... ok
test tests::e2e::test_inventory_sync_bridge ... ok
test tests::e2e::test_inventory_sync_ring ... ok
test tests::e2e::test_inventory_sync_star ... ok
test tests::test_announcement_rebroadcast ... ok
test tests::test_announcement_rebroadcast_duplicates ... ok
test tests::test_announcement_rebroadcast_timestamp_filtered ... ok
test tests::test_announcement_relay ... ok
test tests::test_disconnecting_unresponsive_peer ... ok
test tests::test_connection_kept_alive ... 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_outbound_connection ... ok
test tests::test_inventory_pruning ... ok
test tests::test_persistent_peer_connect ... 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_ann_same_rid ... ok
test tests::test_queued_fetch_from_command_same_rid ... ok
test tests::test_queued_fetch_max_capacity ... ok
test tests::test_redundant_connect ... 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_seeding ... ok
test wire::test::test_inventory_ann_with_extension ... ok
test wire::test::test_pong_message_with_extension ... ok
test tests::test_seed_repo_subscribe ... ok
test tests::prop_inventory_exchange_dense ... ok
test tests::test_announcement_message_amplification ... ok
test result: ok. 69 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 16.38s
Running unittests src/main.rs (target/debug/deps/radicle_node-713549e8febd8f63)
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-9332fe9eb151ac09)
running 46 tests
test deserializer::test::test_decode_next ... ok
test deserializer::test::test_unparsed ... ok
test service::filter::test::test_parameters ... ok
test deserializer::test::prop_decode_next ... ok
test service::gossip::store::test::test_announced ... ok
test service::limiter::test::test_limitter_different_rates ... 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::message::tests::test_ref_remote_limit ... ok
test wire::frame::test::test_encode_git_large ... ok
test wire::frame::test::test_stream_id ... ok
test service::message::tests::test_inventory_limit ... ok
test wire::message::tests::prop_addr ... ok
test service::message::tests::prop_refs_announcement_signing ... ok
test wire::message::tests::prop_zero_bytes_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_message_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::test_refs_ann_max_size ... ok
test wire::message::tests::prop_message_decoder ... ok
test service::message::tests::test_node_announcement_validate ... ok
test result: ok. 46 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.43s
Running unittests src/lib.rs (target/debug/deps/radicle_remote_helper-968b926f067f11bd)
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-2e0057d90282bec9)
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-9d8f76979dc4ebc2)
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-3340fefd7bdb5980)
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-45829b725338b561)
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-fc0dd6bce1d89188)
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-7a06c171a2f669f6)
running 20 tests
test ansi::tests::colors_disabled ... ok
test cell::test::test_width ... ok
test ansi::tests::colors_enabled ... ok
test ansi::tests::wrapping ... ok
test element::test::test_truncate ... ok
test element::test::test_width ... ok
test table::test::test_table ... ok
test table::test::test_table_border ... ok
test table::test::test_table_border_maximized ... ok
test table::test::test_table_border_truncated ... ok
test table::test::test_table_truncate ... ok
test table::test::test_table_unicode ... ok
test table::test::test_truncate ... ok
test table::test::test_table_unicode_truncate ... ok
test textarea::test::test_wrapping ... ok
test textarea::test::test_wrapping_code_block ... ok
test textarea::test::test_wrapping_fenced_block ... ok
test vstack::test::test_vstack ... ok
test textarea::test::test_wrapping_paragraphs ... ok
test vstack::test::test_vstack_maximize ... 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 23) ... 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>::with_capacity (line 66) ... 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 result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.59s
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.46s
Exit code: 0
{
"response": "finished",
"result": "success"
}