rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwood0a3f98f29bb97771f41a6661c9e41890a96b4626
{
"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": "35e558c97c6c50fe548b0cf796ae878667dba95d",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"title": "cli: add \"debug\" subcommand",
"state": {
"status": "merged",
"conflicts": []
},
"before": "137961c1f72a6850325b05e65a232cd202cbd12c",
"after": "0a3f98f29bb97771f41a6661c9e41890a96b4626",
"commits": [
"0a3f98f29bb97771f41a6661c9e41890a96b4626",
"2f72aa1c8385dc3914276971d33f5939750d2f51"
],
"target": "919d5c780c4da0b5b9f18f1549bc59dffd7125af",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "35e558c97c6c50fe548b0cf796ae878667dba95d",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "This writes out information that may be useful when debugging Radicle\nremotely on a user's machine.\n\nSigned-off-by: Lars Wirzenius <liw@liw.fi>",
"base": "8928c5ee2628e0b4d738289b5030fc3e2a918e5e",
"oid": "1383c25e39d80340de238ad1a124217ea0f07104",
"timestamp": 1707150231
},
{
"id": "423c3f094ce57fe3b90cc00ad3276ae934094344",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "",
"base": "8928c5ee2628e0b4d738289b5030fc3e2a918e5e",
"oid": "c22212ee24070f60aea1be59d790ce3d26bed1ce",
"timestamp": 1707151581
},
{
"id": "0bb0e31afc1ac5abcb5ca12a548299a44bffb506",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "",
"base": "8928c5ee2628e0b4d738289b5030fc3e2a918e5e",
"oid": "7dd3c68cf118232c16a0d7a733e7e2faca4c3d67",
"timestamp": 1707228955
},
{
"id": "e1bc2ee32081c234016c464b1aa5ac7362b21b27",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "",
"base": "137961c1f72a6850325b05e65a232cd202cbd12c",
"oid": "2f72aa1c8385dc3914276971d33f5939750d2f51",
"timestamp": 1707398896
},
{
"id": "54e1fbba9a7da93877ea4a96f6cc9d3bdebc2f5d",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "cli: use camelCase for debug JSON output, for consistency\n\nSigned-off-by: Lars Wirzenius <liw@liw.fi>",
"base": "137961c1f72a6850325b05e65a232cd202cbd12c",
"oid": "0a3f98f29bb97771f41a6661c9e41890a96b4626",
"timestamp": 1709749294
},
{
"id": "97f1415642664f5117e5a4aeea2e9ab5f57f038d",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "Rebase.",
"base": "3bba7d16340a546b9ba34739bdea96ae4b4bf041",
"oid": "ccec3f80dc8557ad30bef100a73a395defd88b15",
"timestamp": 1709938215
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "990eeb8e-1825-4854-a760-f08b652f5192"
},
"info_url": "https://cci.rad.levitte.org//990eeb8e-1825-4854-a760-f08b652f5192.html"
}
Started at: 2026-09-07 15:24:03.221740+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/990eeb8e-1825-4854-a760-f08b652f5192/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 37 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 35e558c97c6c50fe548b0cf796ae878667dba95d
✓ Switched to branch patch/35e558c at revision 54e1fbb
✓ Branch patch/35e558c setup to track rad/patches/35e558c97c6c50fe548b0cf796ae878667dba95d
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout 0a3f98f29bb97771f41a6661c9e41890a96b4626
HEAD is now at 0a3f98f2 cli: use camelCase for debug JSON output, for consistency
Exit code: 0
$ rad patch show 35e558c97c6c50fe548b0cf796ae878667dba95d -p
╭────────────────────────────────────────────────────────────────────────────────╮
│ Title cli: add "debug" subcommand │
│ Patch 35e558c97c6c50fe548b0cf796ae878667dba95d │
│ Author liw z6MkgEM…1b2w2FV │
│ Head 0a3f98f29bb97771f41a6661c9e41890a96b4626 │
│ Base 137961c1f72a6850325b05e65a232cd202cbd12c │
│ Target master │
│ Branches patch/35e558c │
│ Commits ahead 2, behind 1612 │
│ Status merged │
│ │
│ This writes out information that may be useful when debugging Radicle │
│ remotely on a user's machine. │
│ │
│ Signed-off-by: Lars Wirzenius <liw@liw.fi> │
├────────────────────────────────────────────────────────────────────────────────┤
│ 0a3f98f cli: use camelCase for debug JSON output, for consistency │
│ 2f72aa1 cli: add "debug" subcommand │
├────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision 35e558c @ 8928c5e..1383c25 by liw z6MkgEM…1b2w2FV 2 years ago │
│ ↑ Revision 423c3f0 @ 8928c5e..c22212e by liw z6MkgEM…1b2w2FV 2 years ago │
│ ↑ Revision 0bb0e31 @ 8928c5e..7dd3c68 by liw z6MkgEM…1b2w2FV 2 years ago │
│ ↑ Revision e1bc2ee @ 137961c..2f72aa1 by liw z6MkgEM…1b2w2FV 2 years ago │
│ ↑ Revision 54e1fbb @ 137961c..0a3f98f by liw z6MkgEM…1b2w2FV 2 years ago │
│ ↑ Revision 97f1415 @ 3bba7d1..ccec3f8 by cloudhead z6MksFq…bS9wzpT 2 years ago │
│ └─ ✓ merged by cloudhead z6MksFq…bS9wzpT │
╰────────────────────────────────────────────────────────────────────────────────╯
commit 0a3f98f29bb97771f41a6661c9e41890a96b4626
Author: Lars Wirzenius <liw@liw.fi>
Date: Wed Mar 6 20:20:39 2024 +0200
cli: use camelCase for debug JSON output, for consistency
Signed-off-by: Lars Wirzenius <liw@liw.fi>
diff --git a/radicle-cli/src/commands/debug.rs b/radicle-cli/src/commands/debug.rs
index f92e6a9b6..55c71a5fb 100644
--- a/radicle-cli/src/commands/debug.rs
+++ b/radicle-cli/src/commands/debug.rs
@@ -90,6 +90,7 @@ fn debug(profile: &Profile) -> anyhow::Result<()> {
#[derive(Debug, Serialize)]
#[allow(dead_code)]
+#[serde(rename_all = "camelCase")]
struct DebugInfo {
rad_version: &'static str,
radicle_node_version: String,
@@ -106,6 +107,7 @@ struct DebugInfo {
#[derive(Debug, Serialize)]
#[allow(dead_code)]
+#[serde(rename_all = "camelCase")]
struct LogFile {
filename: PathBuf,
exists: bool,
commit 2f72aa1c8385dc3914276971d33f5939750d2f51
Author: Lars Wirzenius <liw@liw.fi>
Date: Mon Feb 5 17:52:28 2024 +0200
cli: add "debug" subcommand
This writes out information that may be useful when debugging Radicle
remotely on a user's machine. Things like versions of programs, and
values of relevant environment variables.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs
index 515a3ab42..2744def15 100644
--- a/radicle-cli/src/commands.rs
+++ b/radicle-cli/src/commands.rs
@@ -12,6 +12,8 @@ pub mod rad_clone;
pub mod rad_cob;
#[path = "commands/config.rs"]
pub mod rad_config;
+#[path = "commands/debug.rs"]
+pub mod rad_debug;
#[path = "commands/diff.rs"]
pub mod rad_diff;
#[path = "commands/follow.rs"]
diff --git a/radicle-cli/src/commands/debug.rs b/radicle-cli/src/commands/debug.rs
new file mode 100644
index 000000000..f92e6a9b6
--- /dev/null
+++ b/radicle-cli/src/commands/debug.rs
@@ -0,0 +1,147 @@
+#![allow(clippy::or_fun_call)]
+use std::collections::HashMap;
+use std::env;
+use std::ffi::OsString;
+use std::path::PathBuf;
+use std::process::Command;
+
+use anyhow::anyhow;
+use serde::Serialize;
+
+use radicle::Profile;
+
+use crate::terminal as term;
+use crate::terminal::args::{Args, Help};
+
+pub const NAME: &str = "rad";
+pub const VERSION: &str = env!("CARGO_PKG_VERSION");
+pub const DESCRIPTION: &str = "Radicle command line interface";
+pub const GIT_HEAD: &str = env!("GIT_HEAD");
+
+pub const HELP: Help = Help {
+ name: "debug",
+ description: "Write out information to help debug your Radicle node remotely",
+ version: env!("CARGO_PKG_VERSION"),
+ usage: r#"
+Usage
+
+ rad debug
+
+ Run this if you are reporting a problem in Radicle. The output is
+ helpful for Radicle developers to debug your problem remotely. The
+ output is meant to not include any sensitive information, but
+ please check it, and then forward to the Radicle developers.
+
+"#,
+};
+
+#[derive(Debug)]
+pub struct Options {}
+
+impl Args for Options {
+ fn from_args(_args: Vec<OsString>) -> anyhow::Result<(Self, Vec<OsString>)> {
+ Ok((Options {}, vec![]))
+ }
+}
+
+pub fn run(_options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
+ match ctx.profile() {
+ Ok(profile) => debug(&profile),
+ Err(e) => {
+ eprintln!("ERROR: {e}");
+ Err(e)
+ }
+ }
+}
+
+// Collect information about the local Radicle installation and write
+// it out.
+fn debug(profile: &Profile) -> anyhow::Result<()> {
+ let env = HashMap::from_iter(env::vars().filter_map(|(k, v)| {
+ if k == "RAD_PASSPHRASE" {
+ Some((k, "<REDACTED>".into()))
+ } else if k.starts_with("RAD_") || k.starts_with("SSH_") {
+ Some((k, v))
+ } else {
+ None
+ }
+ }));
+
+ let debug = DebugInfo {
+ rad_version: VERSION,
+ radicle_node_version: stdout_of("radicle-node", &["--version"])
+ .unwrap_or("<unknown>".into()),
+ git_remote_rad_version: stdout_of("git-remote-rad", &["--version"])
+ .unwrap_or("<unknown>".into()),
+ git_version: stdout_of("git", &["--version"]).unwrap_or("<unknown>".into()),
+ ssh_version: stderr_of("ssh", &["-V"]).unwrap_or("<unknown>".into()),
+ git_head: GIT_HEAD,
+ log: LogFile::new(profile.node().join("node.log")),
+ old_log: LogFile::new(profile.node().join("node.log.old")),
+ operating_system: std::env::consts::OS,
+ arch: std::env::consts::ARCH,
+ env,
+ };
+
+ println!("{}", serde_json::to_string_pretty(&debug).unwrap());
+
+ Ok(())
+}
+
+#[derive(Debug, Serialize)]
+#[allow(dead_code)]
+struct DebugInfo {
+ rad_version: &'static str,
+ radicle_node_version: String,
+ git_remote_rad_version: String,
+ git_version: String,
+ ssh_version: String,
+ git_head: &'static str,
+ log: LogFile,
+ old_log: LogFile,
+ operating_system: &'static str,
+ arch: &'static str,
+ env: HashMap<String, String>,
+}
+
+#[derive(Debug, Serialize)]
+#[allow(dead_code)]
+struct LogFile {
+ filename: PathBuf,
+ exists: bool,
+ len: Option<u64>,
+}
+
+impl LogFile {
+ fn new(filename: PathBuf) -> Self {
+ Self {
+ filename: filename.clone(),
+ exists: filename.exists(),
+ len: if let Ok(meta) = filename.metadata() {
+ Some(meta.len())
+ } else {
+ None
+ },
+ }
+ }
+}
+
+fn output_of(bin: &str, args: &[&str]) -> anyhow::Result<(String, String)> {
+ let output = Command::new(bin).args(args).output()?;
+ if !output.status.success() {
+ return Err(anyhow!("command failed: {bin:?} {args:?}"));
+ }
+ let stdout = String::from_utf8_lossy(&output.stdout).trim().to_string();
+ let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();
+ Ok((stdout, stderr))
+}
+
+fn stdout_of(bin: &str, args: &[&str]) -> anyhow::Result<String> {
+ let (stdout, _) = output_of(bin, args)?;
+ Ok(stdout)
+}
+
+fn stderr_of(bin: &str, args: &[&str]) -> anyhow::Result<String> {
+ let (_, stderr) = output_of(bin, args)?;
+ Ok(stderr)
+}
diff --git a/radicle-cli/src/main.rs b/radicle-cli/src/main.rs
index cda01c825..72d7f856e 100644
--- a/radicle-cli/src/main.rs
+++ b/radicle-cli/src/main.rs
@@ -152,6 +152,13 @@ fn run_other(exe: &str, args: &[OsString]) -> Result<(), Option<anyhow::Error>>
args.to_vec(),
);
}
+ "debug" => {
+ term::run_command_args::<rad_debug::Options, _>(
+ rad_debug::HELP,
+ rad_debug::run,
+ args.to_vec(),
+ );
+ }
"follow" => {
term::run_command_args::<rad_follow::Options, _>(
rad_follow::HELP,
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 990eeb8e-1825-4854-a760-f08b652f5192 -v /opt/radcis/ci.rad.levitte.org/cci/state/990eeb8e-1825-4854-a760-f08b652f5192/s:/990eeb8e-1825-4854-a760-f08b652f5192/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/990eeb8e-1825-4854-a760-f08b652f5192/w:/990eeb8e-1825-4854-a760-f08b652f5192/w -w /990eeb8e-1825-4854-a760-f08b652f5192/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /990eeb8e-1825-4854-a760-f08b652f5192/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"
}