rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwoodbbf03a6ae672b050324fe76aa4b3ec5aac8a372e
{
"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": "8dcb09175ad93067516a0a04858ce46a25e16549",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"title": "cli: show reviews on `rad patch list`",
"state": {
"status": "merged",
"conflicts": []
},
"before": "a48081f2717f069d456ec09f31d9e639b232dbed",
"after": "bbf03a6ae672b050324fe76aa4b3ec5aac8a372e",
"commits": [
"bbf03a6ae672b050324fe76aa4b3ec5aac8a372e"
],
"target": "3fc92f83fe089263c470b328414d923227cf0e4a",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "8dcb09175ad93067516a0a04858ce46a25e16549",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "When running `rad patch list`, show the set of delegate reviews for\neach patch, with the following meaning for the symbols:\n\n- \u2714: delegate has accepted the patch\n- \u2717: delegate has rejected the patch\n- \u25cf: delegate has not made a verdict on the patch",
"base": "a48081f2717f069d456ec09f31d9e639b232dbed",
"oid": "bbf03a6ae672b050324fe76aa4b3ec5aac8a372e",
"timestamp": 1709899729
},
{
"id": "516dac703202d88da5e428989039e6b0e9313e29",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Rebase.",
"base": "ce1e1f71ae7554711f4481faed9b66543434d3f7",
"oid": "14ce5fe7b177d57ab33872d90c5a819c5db13bb6",
"timestamp": 1710159794
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "9f02f929-93ae-42b3-bf76-69876bb12a71"
},
"info_url": "https://cci.rad.levitte.org//9f02f929-93ae-42b3-bf76-69876bb12a71.html"
}
Started at: 2026-09-08 00:39:16.123885+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/9f02f929-93ae-42b3-bf76-69876bb12a71/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 38 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 8dcb09175ad93067516a0a04858ce46a25e16549
✓ Switched to branch patch/8dcb091 at revision 8dcb091
✓ Branch patch/8dcb091 setup to track rad/patches/8dcb09175ad93067516a0a04858ce46a25e16549
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout bbf03a6ae672b050324fe76aa4b3ec5aac8a372e
HEAD is now at bbf03a6a cli: show reviews on `rad patch list`
Exit code: 0
$ rad patch show 8dcb09175ad93067516a0a04858ce46a25e16549 -p
╭────────────────────────────────────────────────────────────────────────────────╮
│ Title cli: show reviews on `rad patch list` │
│ Patch 8dcb09175ad93067516a0a04858ce46a25e16549 │
│ Author fintohaps z6Mkire…SQZ3voM │
│ Head bbf03a6ae672b050324fe76aa4b3ec5aac8a372e │
│ Base a48081f2717f069d456ec09f31d9e639b232dbed │
│ Target master │
│ Branches patch/8dcb091 │
│ Commits ahead 1, behind 1584 │
│ Status merged │
│ │
│ When running `rad patch list`, show the set of delegate reviews for │
│ each patch, with the following meaning for the symbols: │
│ │
│ - ✔: delegate has accepted the patch │
│ - ✗: delegate has rejected the patch │
│ - ●: delegate has not made a verdict on the patch │
├────────────────────────────────────────────────────────────────────────────────┤
│ bbf03a6 cli: show reviews on `rad patch list` │
├────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision 8dcb091 @ a48081f..bbf03a6 by fintohaps z6Mkire…SQZ3voM 2 years ago │
│ ↑ Revision 516dac7 @ ce1e1f7..14ce5fe by cloudhead z6MksFq…bS9wzpT 2 years ago │
│ └─ ✓ merged by cloudhead z6MksFq…bS9wzpT │
╰────────────────────────────────────────────────────────────────────────────────╯
commit bbf03a6ae672b050324fe76aa4b3ec5aac8a372e
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Fri Mar 8 12:05:33 2024 +0000
cli: show reviews on `rad patch list`
When running `rad patch list`, show the set of delegate reviews for
each patch, with the following meaning for the symbols:
- ✔: delegate has accepted the patch
- ✗: delegate has rejected the patch
- ●: delegate has not made a verdict on the patch
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
diff --git a/radicle-cli/examples/rad-cob.md b/radicle-cli/examples/rad-cob.md
index 02ab69a2b..f3a8296e4 100644
--- a/radicle-cli/examples/rad-cob.md
+++ b/radicle-cli/examples/rad-cob.md
@@ -42,11 +42,11 @@ Patch can be listed.
```
$ rad patch
-╭─────────────────────────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├─────────────────────────────────────────────────────────────────────────────────────────┤
-│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
-╰─────────────────────────────────────────────────────────────────────────────────────────╯
+╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├──────────────────────────────────────────────────────────────────────────────────────────────────┤
+│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) ● 3e674d1 +0 -0 now │
+╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
```
Both issue and patch COBs can be listed.
diff --git a/radicle-cli/examples/rad-merge-via-push.md b/radicle-cli/examples/rad-merge-via-push.md
index e07fe6d80..2e8206894 100644
--- a/radicle-cli/examples/rad-merge-via-push.md
+++ b/radicle-cli/examples/rad-merge-via-push.md
@@ -69,12 +69,12 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
```
```
$ rad patch --merged
-╭────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├────────────────────────────────────────────────────────────────────┤
-│ ✔ [ ... ] Second change alice (you) daf349f +0 -0 now │
-│ ✔ [ ... ] First change alice (you) 20aa5dd +0 -0 now │
-╰────────────────────────────────────────────────────────────────────╯
+╭─────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ ✔ [ ... ] Second change alice (you) ● daf349f +0 -0 now │
+│ ✔ [ ... ] First change alice (you) ● 20aa5dd +0 -0 now │
+╰─────────────────────────────────────────────────────────────────────────────╯
$ rad patch show 356f73863a8920455ff6e77cd9c805d68910551b
╭────────────────────────────────────────────────────────────────╮
│ Title Second change │
diff --git a/radicle-cli/examples/rad-patch-ahead-behind.md b/radicle-cli/examples/rad-patch-ahead-behind.md
index d04a66b6d..d670a9553 100644
--- a/radicle-cli/examples/rad-patch-ahead-behind.md
+++ b/radicle-cli/examples/rad-patch-ahead-behind.md
@@ -45,11 +45,11 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
When listing, we see that it has one addition:
```
$ rad patch list
-╭────────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├────────────────────────────────────────────────────────────────────────┤
-│ ● 217f050 Add Alan z6MknSL…StBU8Vi (you) 5c88a79 +1 -0 now │
-╰────────────────────────────────────────────────────────────────────────╯
+╭─────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├─────────────────────────────────────────────────────────────────────────────────┤
+│ ● 217f050 Add Alan z6MknSL…StBU8Vi (you) ● 5c88a79 +1 -0 now │
+╰─────────────────────────────────────────────────────────────────────────────────╯
```
When showing the patch, we see that it is `ahead 1, behind 1`, since master has
diff --git a/radicle-cli/examples/rad-patch-via-push.md b/radicle-cli/examples/rad-patch-via-push.md
index e00581b6b..392a9dae5 100644
--- a/radicle-cli/examples/rad-patch-via-push.md
+++ b/radicle-cli/examples/rad-patch-via-push.md
@@ -96,12 +96,12 @@ And both patches:
```
$ rad patch
-╭───────────────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├───────────────────────────────────────────────────────────────────────────────┤
-│ ● 6035d2f Add things #1 z6MknSL…StBU8Vi (you) 42d894a +0 -0 now │
-│ ● 9580891 Add more things z6MknSL…StBU8Vi (you) 8b0ea80 +0 -0 now │
-╰───────────────────────────────────────────────────────────────────────────────╯
+╭────────────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├────────────────────────────────────────────────────────────────────────────────────────┤
+│ ● 6035d2f Add things #1 z6MknSL…StBU8Vi (you) ● 42d894a +0 -0 now │
+│ ● 9580891 Add more things z6MknSL…StBU8Vi (you) ● 8b0ea80 +0 -0 now │
+╰────────────────────────────────────────────────────────────────────────────────────────╯
```
To update our patch, we simply push commits to the upstream branch:
diff --git a/radicle-cli/examples/rad-patch.md b/radicle-cli/examples/rad-patch.md
index 1ff174705..6a6042f32 100644
--- a/radicle-cli/examples/rad-patch.md
+++ b/radicle-cli/examples/rad-patch.md
@@ -35,11 +35,11 @@ It will now be listed as one of the project's open patches.
```
$ rad patch
-╭─────────────────────────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├─────────────────────────────────────────────────────────────────────────────────────────┤
-│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
-╰─────────────────────────────────────────────────────────────────────────────────────────╯
+╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├──────────────────────────────────────────────────────────────────────────────────────────────────┤
+│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) ● 3e674d1 +0 -0 now │
+╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
```
```
$ rad patch show aa45913e757cacd46972733bddee5472c78fa32a -p
@@ -75,11 +75,11 @@ We can also list only patches that we've authored.
```
$ rad patch list --authored
-╭─────────────────────────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├─────────────────────────────────────────────────────────────────────────────────────────┤
-│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
-╰─────────────────────────────────────────────────────────────────────────────────────────╯
+╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├──────────────────────────────────────────────────────────────────────────────────────────────────┤
+│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) ● 3e674d1 +0 -0 now │
+╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
```
We can also see that it set an upstream for our patch branch:
@@ -181,6 +181,12 @@ $ rad patch show aa45913
│ ↑ updated to 6e5a3b7b2ce27b32e7ccc2f0b3f4594897dde638 (27857ec) now │
│ └─ ✓ accepted by z6MknSL…StBU8Vi (you) now │
╰─────────────────────────────────────────────────────────────────────╯
+$ rad patch list
+╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├──────────────────────────────────────────────────────────────────────────────────────────────────┤
+│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) ✔ 27857ec +0 -0 now │
+╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
```
If you make a mistake on the patch description, you can always change it!
diff --git a/radicle-cli/examples/workflow/4-patching-contributor.md b/radicle-cli/examples/workflow/4-patching-contributor.md
index 4c73853a8..e0cb0e78f 100644
--- a/radicle-cli/examples/workflow/4-patching-contributor.md
+++ b/radicle-cli/examples/workflow/4-patching-contributor.md
@@ -35,11 +35,11 @@ It will now be listed as one of the project's open patches.
```
$ rad patch
-╭────────────────────────────────────────────────────────────────────────────────╮
-│ ● ID Title Author Head + - Updated │
-├────────────────────────────────────────────────────────────────────────────────┤
-│ ● e4934b6 Define power requirements bob (you) 3e674d1 +0 -0 now │
-╰────────────────────────────────────────────────────────────────────────────────╯
+╭─────────────────────────────────────────────────────────────────────────────────────────╮
+│ ● ID Title Author Reviews Head + - Updated │
+├─────────────────────────────────────────────────────────────────────────────────────────┤
+│ ● e4934b6 Define power requirements bob (you) ● 3e674d1 +0 -0 now │
+╰─────────────────────────────────────────────────────────────────────────────────────────╯
$ rad patch show e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
╭────────────────────────────────────────────────────╮
│ Title Define power requirements │
diff --git a/radicle-cli/src/commands/patch/list.rs b/radicle-cli/src/commands/patch/list.rs
index a96ee5a85..4361b3c79 100644
--- a/radicle-cli/src/commands/patch/list.rs
+++ b/radicle-cli/src/commands/patch/list.rs
@@ -1,4 +1,4 @@
-use std::collections::BTreeSet;
+use std::collections::{BTreeMap, BTreeSet};
use radicle::cob::patch;
use radicle::cob::patch::{Patch, PatchId};
@@ -46,7 +46,7 @@ pub fn run(
return Ok(());
}
- let mut table = Table::<9, term::Line>::new(TableOptions {
+ let mut table = Table::<10, term::Line>::new(TableOptions {
spacing: 2,
border: Some(term::colors::FAINT),
..TableOptions::default()
@@ -58,6 +58,7 @@ pub fn run(
term::format::bold(String::from("Title")).into(),
term::format::bold(String::from("Author")).into(),
term::Line::blank(),
+ term::format::bold(String::from("Reviews")).into(),
term::format::bold(String::from("Head")).into(),
term::format::bold(String::from("+")).into(),
term::format::bold(String::from("-")).into(),
@@ -98,13 +99,39 @@ pub fn row(
patch: &Patch,
repository: &Repository,
profile: &Profile,
-) -> anyhow::Result<[term::Line; 9]> {
+) -> anyhow::Result<[term::Line; 10]> {
let state = patch.state();
let (_, revision) = patch.latest();
let (from, to) = revision.range();
let stats = common::diff_stats(repository.raw(), &from, &to)?;
let author = patch.author().id;
let (alias, did) = Author::new(&author, profile).labels();
+ let mut delegates = repository
+ .delegates()?
+ .into_iter()
+ .map(|delegate| (*delegate, term::format::patch::verdict(None)))
+ .collect::<BTreeMap<_, _>>();
+ for (key, review) in revision.reviews() {
+ delegates
+ .entry(*key)
+ .and_modify(|verdict| *verdict = term::format::patch::verdict(review.verdict()));
+ }
+ let n = delegates.len();
+ let reviews = delegates
+ .values()
+ .cloned()
+ .map(term::Label::from)
+ // TODO(finto): poor man's intersperse
+ // https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.intersperse
+ .enumerate()
+ .flat_map(|(i, label)| {
+ if i == n - 1 {
+ vec![label].into_iter()
+ } else {
+ vec![label, term::Label::from(",")].into_iter()
+ }
+ })
+ .collect::<Vec<_>>();
Ok([
match state {
@@ -117,6 +144,7 @@ pub fn row(
term::format::default(patch.title().to_owned()).into(),
alias.into(),
did.into(),
+ reviews.into(),
term::format::secondary(term::format::oid(revision.head())).into(),
term::format::positive(format!("+{}", stats.insertions())).into(),
term::format::negative(format!("-{}", stats.deletions())).into(),
diff --git a/radicle-cli/src/terminal/format.rs b/radicle-cli/src/terminal/format.rs
index 23dfb49f8..7b627bde0 100644
--- a/radicle-cli/src/terminal/format.rs
+++ b/radicle-cli/src/terminal/format.rs
@@ -264,7 +264,15 @@ pub mod issue {
/// Patch formatting
pub mod patch {
use super::*;
- use radicle::patch::State;
+ use radicle::patch::{State, Verdict};
+
+ pub fn verdict(v: Option<Verdict>) -> term::Paint<String> {
+ match v {
+ Some(Verdict::Accept) => term::format::positive("✔".to_string()),
+ Some(Verdict::Reject) => term::format::negative("✗".to_string()),
+ None => term::format::secondary("●".to_string()),
+ }
+ }
/// Format patch state.
pub fn state(s: &State) -> term::Paint<String> {
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name 9f02f929-93ae-42b3-bf76-69876bb12a71 -v /opt/radcis/ci.rad.levitte.org/cci/state/9f02f929-93ae-42b3-bf76-69876bb12a71/s:/9f02f929-93ae-42b3-bf76-69876bb12a71/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/9f02f929-93ae-42b3-bf76-69876bb12a71/w:/9f02f929-93ae-42b3-bf76-69876bb12a71/w -w /9f02f929-93ae-42b3-bf76-69876bb12a71/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /9f02f929-93ae-42b3-bf76-69876bb12a71/s/script.sh
+ cargo --version
info: syncing channel updates for '1.74-x86_64-unknown-linux-gnu'
info: latest update on 2023-12-07, rust version 1.74.1 (a28077b28 2023-12-04)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.74.1 (ecb9851af 2023-10-18)
+ rustc --version
rustc 1.74.1 (a28077b28 2023-12-04)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.74-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.74-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}