rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwooddf44cee9ef009fbbb4a7d6ab741a8563c34ab139
{
"request": "trigger",
"version": 1,
"event_type": "push",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"pusher": {
"id": "did:key:z6MkguTxepMVyaC8nUdJHjiraV5atjooHKWsU5dvp8eYkB6S",
"alias": null
},
"before": "df44cee9ef009fbbb4a7d6ab741a8563c34ab139",
"after": "df44cee9ef009fbbb4a7d6ab741a8563c34ab139",
"branch": "master",
"commits": [
"df44cee9ef009fbbb4a7d6ab741a8563c34ab139"
]
}
{
"response": "triggered",
"run_id": {
"id": "87dfce17-baf1-4470-bf80-66c94f961dd2"
},
"info_url": "https://cci.rad.levitte.org//87dfce17-baf1-4470-bf80-66c94f961dd2.html"
}
Started at: 2025-10-21 17:37:31.625946+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW added
✓ Remote-tracking branch cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW/master created for z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz added
✓ Remote-tracking branch erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz/master created for z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz
✓ 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/87dfce17-baf1-4470-bf80-66c94f961dd2/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 125 issues · 15 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout df44cee9ef009fbbb4a7d6ab741a8563c34ab139
HEAD is now at df44cee9 cob: Add an experimental "job" COB
Exit code: 0
$ git show df44cee9ef009fbbb4a7d6ab741a8563c34ab139
commit df44cee9ef009fbbb4a7d6ab741a8563c34ab139
Author: Lars Wirzenius <liw@liw.fi>
Date: Thu Nov 2 11:32:16 2023 +0200
cob: Add an experimental "job" COB
This is meant to record in Radicle that automated "jobs" have been run
on a repository. The job might be, for example, a CI run that builds
the software and runs its tests. The recording is done in a "job COB",
which can be in three states:
* fresh -- when the job has been triggered, but has not yet started running
* running -- when it's running
* finished -- when it's finished running
The finished state also records whether the job was successful or if
it failed.
A job COB records the git commit that it runs on, and the "run ID" of
the job. The run ID represents an external identifier, such as one
assigned by a remote CI system. The COB can optionally store a URL
related to the job, such as to the build log from CI.
Add the "rad job" subcommand to create and manage job COBs. For
production use, the COBs should be created and updated using
`heartwood` as a library instead of running "rad job", if at all
possible. However, "rad job list" lists the jobs that have been run on
the repository.
The COB type name is xyz.radicle.beta.job, until we've gained
experience with the COB and its implementation and are ready to
declare it stable.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
diff --git a/radicle-cli/examples/rad-job.md b/radicle-cli/examples/rad-job.md
new file mode 100644
index 00000000..a28668b3
--- /dev/null
+++ b/radicle-cli/examples/rad-job.md
@@ -0,0 +1,87 @@
+The `rad job` command lets you manage job COBs. Let's first checkout the
+`heartwood` repository:
+
+```
+$ rad checkout rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
+✓ Repository checkout successful under ./heartwood
+$ cd heartwood
+```
+
+Using the `rad job` (or `rad job list`) command we can see that there are
+currently no jobs listed:
+
+```
+$ rad job
+Nothing to show.
+```
+
+Let's create a job to represent a new CI run. We check what the current `HEAD`
+of the repository is, and use the `rad job trigger` to start a fresh job for
+that commit:
+
+```
+$ git rev-parse HEAD
+f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
+$ rad job trigger f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
+╭──────────────────────────────────────────────────╮
+│ Job fbbda2447c30ebbab9b746498cd41a383ff05225 │
+│ Commit f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 │
+│ State fresh │
+╰──────────────────────────────────────────────────╯
+```
+
+Let's check the list again, and we should we see our fresh job there:
+
+```
+$ rad job
+╭───────────────────────────────╮
+│ ● ID Commit State │
+├───────────────────────────────┤
+│ ● fbbda24 f2de534 fresh │
+╰───────────────────────────────╯
+```
+
+From there we can start a new job, assigning an arbitrary identifier `xyzzy`,
+which would usually from the CI system that is running the job:
+
+```
+$ rad job start fbbda2447c30ebbab9b746498cd41a383ff05225 xyzzy
+```
+
+Checking the job again, we can now see that the job is `running`:
+
+```
+$ rad job
+╭─────────────────────────────────╮
+│ ● ID Commit State │
+├─────────────────────────────────┤
+│ ● fbbda24 f2de534 running │
+╰─────────────────────────────────╯
+$ rad job show fbbda2447c30ebbab9b746498cd41a383ff05225
+╭──────────────────────────────────────────────────╮
+│ Job fbbda2447c30ebbab9b746498cd41a383ff05225 │
+│ Commit f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 │
+│ State running │
+│ Run ID xyzzy │
+╰──────────────────────────────────────────────────╯
+```
+
+When a job has finished, we can mark it as done -- either with a `--success` or
+`--failed` flag -- using the `rad job finish` command:
+
+```
+$ rad job finish --success fbbda2447c30ebbab9b746498cd41a383ff05225
+$ rad job
+╭───────────────────────────────────╮
+│ ● ID Commit State │
+├───────────────────────────────────┤
+│ ● fbbda24 f2de534 succeeded │
+╰───────────────────────────────────╯
+$ rad job show fbbda2447c30ebbab9b746498cd41a383ff05225
+╭──────────────────────────────────────────────────╮
+│ Job fbbda2447c30ebbab9b746498cd41a383ff05225 │
+│ Commit f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 │
+│ State succeeded │
+│ Run ID xyzzy │
+╰──────────────────────────────────────────────────╯
+```
diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs
index e4df12c1..60d5eb14 100644
--- a/radicle-cli/src/commands.rs
+++ b/radicle-cli/src/commands.rs
@@ -32,6 +32,8 @@ pub mod rad_init;
pub mod rad_inspect;
#[path = "commands/issue.rs"]
pub mod rad_issue;
+#[path = "commands/job.rs"]
+pub mod rad_job;
#[path = "commands/ls.rs"]
pub mod rad_ls;
#[path = "commands/node.rs"]
diff --git a/radicle-cli/src/commands/help.rs b/radicle-cli/src/commands/help.rs
index 79ba11bf..93f3d3be 100644
--- a/radicle-cli/src/commands/help.rs
+++ b/radicle-cli/src/commands/help.rs
@@ -25,6 +25,7 @@ const COMMANDS: &[Help] = &[
rad_inbox::HELP,
rad_inspect::HELP,
rad_issue::HELP,
+ rad_job::HELP,
rad_ls::HELP,
rad_node::HELP,
rad_patch::HELP,
diff --git a/radicle-cli/src/commands/job.rs b/radicle-cli/src/commands/job.rs
new file mode 100644
index 00000000..ab1bfdc5
--- /dev/null
+++ b/radicle-cli/src/commands/job.rs
@@ -0,0 +1,362 @@
+#![allow(clippy::or_fun_call)]
+use std::ffi::OsString;
+
+use anyhow::{anyhow, Context as _};
+
+use radicle::cob::job::{JobStore, Reason, State};
+use radicle::crypto::Signer;
+use radicle::node::Handle;
+use radicle::storage::{WriteRepository, WriteStorage};
+use radicle::{cob, Node};
+
+use crate::git::Rev;
+use crate::terminal as term;
+use crate::terminal::args::{Args, Error, Help};
+use crate::terminal::Element;
+
+pub const HELP: Help = Help {
+ name: "job",
+ description: "Manage automated jobs on a repository",
+ version: env!("CARGO_PKG_VERSION"),
+ usage: r#"
+Usage
+
+ rad job [<option>...]
+ rad job trigger <commit-id>
+ rad job start <job-id> <run-id> [<url>]
+ rad job list
+ rad job show <job-id>
+ rad job finish <job-id> [--success | --failed]
+ rad job delete <job-id>
+
+Options
+
+ --no-announce Don't announce job records to peers
+ --quiet, -q Don't print anything
+ --help Print help
+"#,
+};
+
+#[derive(Default, Debug, PartialEq, Eq)]
+pub enum OperationName {
+ Trigger,
+ Start,
+ #[default]
+ List,
+ Show,
+ Finish,
+ Delete,
+}
+
+#[derive(Debug, PartialEq, Eq)]
+pub enum Operation {
+ Trigger {
+ commit: Rev,
+ },
+ Start {
+ job_id: Rev,
+ run_id: String,
+ info_url: Option<String>,
+ },
+ List,
+ Show {
+ job_id: Rev,
+ },
+ Finish {
+ job_id: Rev,
+ reason: Reason,
+ },
+ Delete {
+ job_id: Rev,
+ },
+}
+
+#[derive(Debug)]
+pub struct Options {
+ pub op: Operation,
+ pub announce: bool,
+ pub quiet: bool,
+}
+
+impl Args for Options {
+ fn from_args(args: Vec<OsString>) -> anyhow::Result<(Self, Vec<OsString>)> {
+ use lexopt::prelude::*;
+
+ let mut parser = lexopt::Parser::from_args(args);
+ let mut op: Option<OperationName> = None;
+ let mut commit: Option<Rev> = None;
+ let mut job_id: Option<Rev> = None;
+ let mut run_id: Option<String> = None;
+ let mut info_url: Option<String> = None;
+ let mut announce = true;
+ let mut quiet = false;
+ let mut succeeded = false;
+ let mut failed = false;
+
+ while let Some(arg) = parser.next()? {
+ match arg {
+ Long("help") | Short('h') => {
+ return Err(Error::Help.into());
+ }
+ Long("no-announce") => {
+ announce = false;
+ }
+ Long("quiet") | Short('q') => {
+ quiet = true;
+ }
+ Long("success") | Long("succeeded") | Short('s') => {
+ succeeded = true;
+ }
+ Long("failure") | Long("failed") | Short('f') => {
+ failed = true;
+ }
+ Value(val) if op.is_none() => match val.to_string_lossy().as_ref() {
+ "trigger" => op = Some(OperationName::Trigger),
+ "start" => op = Some(OperationName::Start),
+ "list" => op = Some(OperationName::List),
+ "show" => op = Some(OperationName::Show),
+ "finish" => op = Some(OperationName::Finish),
+ "delete" => op = Some(OperationName::Delete),
+
+ unknown => anyhow::bail!("unknown operation '{}'", unknown),
+ },
+ Value(val) if commit.is_none() && op == Some(OperationName::Trigger) => {
+ let val = term::args::oid(&val)?;
+ let val = Rev::from(val.to_string());
+ commit = Some(val);
+ }
+ Value(val)
+ if job_id.is_none()
+ && op.is_some()
+ && matches!(
+ op.as_ref().unwrap(),
+ OperationName::Start
+ | OperationName::Show
+ | OperationName::Finish
+ | OperationName::Delete
+ ) =>
+ {
+ let val = term::args::oid(&val)?;
+ let val = Rev::from(val.to_string());
+ job_id = Some(val);
+ }
+ Value(val)
+ if job_id.is_some()
+ && run_id.is_none()
+ && op.is_some()
+ && matches!(op.as_ref().unwrap(), OperationName::Start) =>
+ {
+ run_id = Some(val.to_str().unwrap().to_string());
+ }
+ Value(val)
+ if job_id.is_some()
+ && run_id.is_some()
+ && op.is_some()
+ && matches!(op.as_ref().unwrap(), OperationName::Start) =>
+ {
+ info_url = Some(val.to_str().unwrap().to_string());
+ }
+ _ => {
+ return Err(anyhow!(arg.unexpected()));
+ }
+ }
+ }
+
+ let op = match op.unwrap_or_default() {
+ OperationName::Trigger => Operation::Trigger {
+ commit: commit.ok_or_else(|| anyhow!("a commit id must be provided"))?,
+ },
+ OperationName::Start => Operation::Start {
+ job_id: job_id.ok_or_else(|| anyhow!("a job id must be provided"))?,
+ run_id: run_id.ok_or_else(|| anyhow!("a run id must be provided"))?,
+ info_url,
+ },
+ OperationName::List => Operation::List,
+ OperationName::Show => Operation::Show {
+ job_id: job_id.ok_or_else(|| anyhow!("a job id must be provided"))?,
+ },
+ OperationName::Finish => Operation::Finish {
+ job_id: job_id.ok_or_else(|| anyhow!("a job id must be provided"))?,
+ reason: if !succeeded && !failed {
+ return Err(anyhow!("must give one of --success or --failure"))?;
+ } else if succeeded && failed {
+ return Err(anyhow!("must give one of --success or --failure, not both"))?;
+ } else if succeeded {
+ Reason::Succeeded
+ } else {
+ Reason::Failed
+ },
+ },
+ OperationName::Delete => Operation::Delete {
+ job_id: job_id.ok_or_else(|| anyhow!("a job id to remove must be provided"))?,
+ },
+ };
+
+ Ok((
+ Options {
+ op,
+ announce,
+ quiet,
+ },
+ vec![],
+ ))
+ }
+}
+
+pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
+ let profile = ctx.profile()?;
+ let signer = term::signer(&profile)?;
+ let (_, rid) = radicle::rad::cwd()?;
+ let repo = profile.storage.repository_mut(rid)?;
+ let announce = options.announce
+ && matches!(
+ &options.op,
+ Operation::Trigger { .. }
+ | Operation::Start { .. }
+ | Operation::Finish { .. }
+ | Operation::Delete { .. }
+ );
+
+ let mut node = Node::new(profile.socket());
+ let mut ci_store = JobStore::open(&repo)?;
+
+ match options.op {
+ Operation::Trigger { commit } => {
+ trigger(&commit, &mut ci_store, &repo, &signer, options.quiet)?;
+ }
+ Operation::Start {
+ job_id,
+ run_id,
+ info_url,
+ } => {
+ start(&job_id, &run_id, info_url, &mut ci_store, &repo, &signer)?;
+ }
+ Operation::List => {
+ list(&ci_store)?;
+ }
+ Operation::Show { job_id } => {
+ show(&job_id, &ci_store, &repo)?;
+ }
+ Operation::Finish { job_id, reason } => {
+ finish(&job_id, reason, &mut ci_store, &repo, &signer)?;
+ }
+ Operation::Delete { job_id } => {
+ let job_id = job_id.resolve(&repo.backend)?;
+ ci_store.remove(&job_id, &signer)?;
+ }
+ }
+
+ if announce {
+ match node.announce_refs(rid) {
+ Ok(_) => {}
+ Err(e) if e.is_connection_err() => {}
+ Err(e) => return Err(e.into()),
+ }
+ }
+
+ Ok(())
+}
+
+fn trigger<R: WriteRepository + cob::Store, G: Signer>(
+ commit: &Rev,
+ store: &mut JobStore<R>,
+ repo: &radicle::storage::git::Repository,
+ signer: &G,
+ quiet: bool,
+) -> anyhow::Result<()> {
+ let commit = commit.resolve(&repo.backend)?;
+ let job = store.create(commit, signer)?;
+ if !quiet {
+ term::job::show(&job, job.id())?;
+ }
+ Ok(())
+}
+
+fn start<R: WriteRepository + cob::Store, G: Signer>(
+ job_id: &Rev,
+ run_id: &str,
+ info_url: Option<String>,
+ store: &mut JobStore<R>,
+ repo: &radicle::storage::git::Repository,
+ signer: &G,
+) -> anyhow::Result<()> {
+ let job_id = job_id.resolve(&repo.backend)?;
+ let mut job = store.get_mut(&job_id)?;
+
+ job.start(run_id.to_string(), info_url, signer)?;
+
+ Ok(())
+}
+
+// TODO: This should use the COB cache for performance.
+fn list<R: WriteRepository + cob::Store>(store: &JobStore<R>) -> anyhow::Result<()> {
+ if store.is_empty()? {
+ term::print(term::format::italic("Nothing to show."));
+ return Ok(());
+ }
+
+ let mut table = term::Table::new(term::table::TableOptions::bordered());
+ table.header([
+ term::format::dim(String::from("●")),
+ term::format::bold(String::from("ID")),
+ term::format::bold(String::from("Commit")),
+ term::format::bold(String::from("State")),
+ ]);
+ table.divider();
+
+ for result in store.all()? {
+ let Ok((id, ci)) = result else {
+ // Skip COBs that failed to load.
+ continue;
+ };
+ table.push([
+ match ci.state() {
+ State::Fresh => term::format::positive("●").into(),
+ State::Running => term::format::positive("●").into(),
+ State::Finished(Reason::Succeeded) => term::format::positive("●").into(),
+ State::Finished(Reason::Failed) => term::format::negative("●").into(),
+ },
+ term::format::tertiary(term::format::cob(&id).to_string()),
+ term::format::tertiary(term::format::oid(ci.commit()).to_string()),
+ term::format::tertiary(term::format::job_state(ci.state()).to_string()),
+ ]);
+ }
+
+ if table.is_empty() {
+ term::print(term::format::dim("No jobs to show."));
+ } else {
+ table.print();
+ }
+
+ Ok(())
+}
+
+fn show<R: WriteRepository + cob::Store>(
+ job_id: &Rev,
+ store: &JobStore<R>,
+ repo: &radicle::storage::git::Repository,
+) -> anyhow::Result<()> {
+ let job_id = job_id.resolve(&repo.backend)?;
+ let job = store
+ .get(&job_id)?
+ .context("No job with the given ID exists")?;
+
+ term::job::show(&job, &job_id)?;
+
+ Ok(())
+}
+
+fn finish<R: WriteRepository + cob::Store, G: Signer>(
+ job_id: &Rev,
+ reason: Reason,
+ store: &mut JobStore<R>,
+ repo: &radicle::storage::git::Repository,
+ signer: &G,
+) -> anyhow::Result<()> {
+ let job_id = job_id.resolve(&repo.backend)?;
+ let mut job = store.get_mut(&job_id)?;
+
+ job.finish(reason, signer)?;
+
+ Ok(())
+}
diff --git a/radicle-cli/src/main.rs b/radicle-cli/src/main.rs
index 3b397227..11b998ff 100644
--- a/radicle-cli/src/main.rs
+++ b/radicle-cli/src/main.rs
@@ -232,6 +232,13 @@ fn run_other(exe: &str, args: &[OsString]) -> Result<(), Option<anyhow::Error>>
args.to_vec(),
);
}
+ "job" => {
+ term::run_command_args::<rad_job::Options, _>(
+ rad_job::HELP,
+ rad_job::run,
+ args.to_vec(),
+ );
+ }
"ls" => {
term::run_command_args::<rad_ls::Options, _>(rad_ls::HELP, rad_ls::run, args.to_vec());
}
diff --git a/radicle-cli/src/terminal.rs b/radicle-cli/src/terminal.rs
index 5e351ec3..45f2edbc 100644
--- a/radicle-cli/src/terminal.rs
+++ b/radicle-cli/src/terminal.rs
@@ -2,6 +2,7 @@ pub mod args;
pub use args::{Args, Error, Help};
pub mod format;
pub mod io;
+pub mod job;
pub use io::signer;
pub mod comment;
pub mod highlight;
diff --git a/radicle-cli/src/terminal/format.rs b/radicle-cli/src/terminal/format.rs
index a8bf1690..bf8f1e5d 100644
--- a/radicle-cli/src/terminal/format.rs
+++ b/radicle-cli/src/terminal/format.rs
@@ -30,6 +30,11 @@ pub fn oid(oid: impl Into<radicle::git::Oid>) -> Paint<String> {
Paint::new(format!("{:.7}", oid.into()))
}
+/// Format a job COB state.
+pub fn job_state(state: radicle::cob::job::State) -> Paint<String> {
+ Paint::new(format!("{}", state))
+}
+
/// Wrap parenthesis around styled input, eg. `"input"` -> `"(input)"`.
pub fn parens<D: fmt::Display>(input: Paint<D>) -> Paint<String> {
Paint::new(format!("({})", input.item)).with_style(input.style)
diff --git a/radicle-cli/src/terminal/job.rs b/radicle-cli/src/terminal/job.rs
new file mode 100644
index 00000000..2a1b227c
--- /dev/null
+++ b/radicle-cli/src/terminal/job.rs
@@ -0,0 +1,51 @@
+use radicle::cob;
+use radicle::cob::job;
+use radicle_term::table::TableOptions;
+use radicle_term::{Table, VStack};
+
+use crate::terminal as term;
+use crate::terminal::Element;
+
+pub fn show(job: &job::Job, id: &cob::ObjectId) -> anyhow::Result<()> {
+ let mut attrs = Table::<2, term::Line>::new(TableOptions {
+ spacing: 2,
+ ..TableOptions::default()
+ });
+
+ attrs.push([
+ term::format::tertiary("Job".to_owned()).into(),
+ term::format::bold(id.to_string()).into(),
+ ]);
+
+ attrs.push([
+ term::format::tertiary("Commit".to_owned()).into(),
+ term::format::bold(job.commit().to_owned()).into(),
+ ]);
+
+ attrs.push([
+ term::format::tertiary("State".to_owned()).into(),
+ term::format::bold(job.state().to_string()).into(),
+ ]);
+
+ if let Some(run_id) = job.run_id() {
+ attrs.push([
+ term::format::tertiary("Run ID".to_owned()).into(),
+ term::format::bold(run_id.to_string()).into(),
+ ]);
+ }
+
+ if let Some(info_url) = job.info_url() {
+ attrs.push([
+ term::format::tertiary("Info URL".to_owned()).into(),
+ term::format::bold(info_url.to_string()).into(),
+ ]);
+ }
+
+ let widget = VStack::default()
+ .border(Some(term::colors::FAINT))
+ .child(attrs);
+
+ widget.print();
+
+ Ok(())
+}
diff --git a/radicle-cli/tests/commands.rs b/radicle-cli/tests/commands.rs
index 864106c5..d2cfad7d 100644
--- a/radicle-cli/tests/commands.rs
+++ b/radicle-cli/tests/commands.rs
@@ -3020,3 +3020,17 @@ fn rad_workflow() {
)
.unwrap();
}
+
+#[test]
+fn rad_job() {
+ let mut environment = Environment::new();
+ let profile = environment.profile(config::profile("alice"));
+ let home = &profile.home;
+ let working = environment.tmp().join("working");
+
+ // Setup a test repository.
+ fixtures::repository(&working);
+
+ test("examples/rad-init.md", &working, Some(home), []).unwrap();
+ test("examples/rad-job.md", &working, Some(home), []).unwrap();
+}
diff --git a/radicle/src/cob.rs b/radicle/src/cob.rs
index dd0b4797..4b9083cb 100644
--- a/radicle/src/cob.rs
+++ b/radicle/src/cob.rs
@@ -3,6 +3,7 @@ pub mod cache;
pub mod common;
pub mod identity;
pub mod issue;
+pub mod job;
pub mod op;
pub mod patch;
pub mod store;
diff --git a/radicle/src/cob/job.rs b/radicle/src/cob/job.rs
new file mode 100644
index 00000000..4f0e67f8
--- /dev/null
+++ b/radicle/src/cob/job.rs
@@ -0,0 +1,441 @@
+//! Track "jobs" related to a repository.
+//!
+//! The purpose of this COB is to allow users of Radicle to have a way
+//! of keeping track of what automated processing of changes to a
+//! repository have been done. A "job" might be a continuous
+//! integration automation building the software in a repository and
+//! running its automated tests. A delegate for the repository could
+//! track COBs emitted by trusted nodes to help with deciding when a
+//! patch is ready for them to merge.
+
+use std::{ops::Deref, str::FromStr};
+
+use once_cell::sync::Lazy;
+use serde::{Deserialize, Serialize};
+
+use crate::cob;
+use crate::cob::change::store::Entry;
+use crate::cob::store;
+use crate::cob::store::{Cob, CobAction, Store, Transaction};
+use crate::cob::{EntryId, ObjectId, TypeName};
+use crate::crypto::ssh::ExtendedSignature;
+use crate::crypto::Signer;
+use crate::git;
+use crate::prelude::ReadRepository;
+use crate::storage::{Oid, WriteRepository};
+
+/// The name of this COB type. Note that this is a "beta" COB, which
+/// means it's not meant for others to rely on yet, and we may change
+/// it without warning.
+pub static TYPENAME: Lazy<TypeName> =
+ Lazy::new(|| FromStr::from_str("xyz.radicle.beta.job").expect("type name is valid"));
+
+/// An identifier for the job.
+pub type JobId = ObjectId;
+
+/// All the possible errors from this type of COB.
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error("initialization failed: {0}")]
+ Init(&'static str),
+ #[error("op decoding failed: {0}")]
+ Op(#[from] cob::op::OpEncodingError),
+ #[error("store: {0}")]
+ Store(#[from] store::Error),
+ #[error("can't trigger a job which is not fresh")]
+ TriggerWhenNotFresh,
+ #[error("can't start a job which is not triggered")]
+ StartWhenNotFresh,
+ #[error("can't finish a job which is not running")]
+ FinishWhenNotRunning,
+}
+
+/// All the possible states of this COB.
+///
+/// This is primarily modeled for CI, for now. A COB is created by a
+/// node when it triggers a CI run, and then updated when the CI
+/// system actually starts executing the run, and finishes. The CI
+/// system assigns an identifier to the run, and may have a URL for
+/// the log. These can also be stored in the COB.
+///
+/// This COB is essentially a state machine that tracks the state of
+/// an automated run Ci. When the COB is created, in state `Fresh`, it
+/// just records the git commit the run uses. This can't be changed.
+/// The COB may be created before the run actually starts. Once the
+/// run starts, the COB state changes to `Running`. When the run
+/// finished, the state changes to `Finished`, and the state records
+/// why the run finished: `Succeeded` or `Failed`.
+///
+/// No other state changes are allowed for the COB.
+///
+/// Note that if CI runs again for the same commit, a new COB is
+/// created. The two runs may result in different outcomes, even if
+/// nothing in the source code has changed. For example, the CI system
+/// may run out of disk space, or use different versions of the
+/// software used in the run.
+#[derive(Debug, Default, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase", tag = "status")]
+pub enum State {
+ /// COB has been created, job has not yet started running.
+ #[default]
+ Fresh,
+ /// Job has started running.
+ Running,
+ /// Job has finished.
+ Finished(Reason),
+}
+
+impl std::fmt::Display for State {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ match self {
+ Self::Fresh => write!(f, "fresh"),
+ Self::Running => write!(f, "running"),
+ Self::Finished(Reason::Succeeded) => write!(f, "succeeded"),
+ Self::Finished(Reason::Failed) => write!(f, "failed"),
+ }
+ }
+}
+
+/// Why did build finish?
+#[derive(Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize)]
+pub enum Reason {
+ /// Build was successful.
+ Succeeded,
+ /// Build failed for some reason.
+ Failed,
+}
+
+/// Actions to update this COB.
+#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
+#[serde(tag = "type", rename_all = "camelCase")]
+pub enum Action {
+ /// Initialize the COB for a new job.
+ Trigger { commit: git::Oid },
+
+ /// Start a job.
+ Start {
+ run_id: String,
+ info_url: Option<String>,
+ },
+
+ /// Finish a job.
+ Finish { reason: Reason },
+}
+
+impl CobAction for Action {}
+
+/// Type of COB operation.
+pub type Op = cob::Op<Action>;
+
+/// The COB with actions applied.
+///
+/// A job is based on a specific commit. This is set when the COB is
+/// created and can't be changed.
+///
+/// A job has a specific [`State`].
+///
+/// A job may have a "run id", which is an arbitrary string. It might
+/// be the identifier for a CI run, set by an external CI system, for
+/// example. The id is informational and there no guarantees what it
+/// means, or that it's unique.
+///
+/// A job may also store a URL to more information. This might be a
+/// link to a run log in a CI system, for example.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct Job {
+ commit: git::Oid,
+ state: State,
+ run_id: Option<String>,
+ info_url: Option<String>,
+}
+
+impl Job {
+ /// Create a new `Job` in the `Fresh` state, using the provided `commit`.
+ fn new(commit: git::Oid) -> Self {
+ Self {
+ commit,
+ state: State::default(),
+ run_id: None,
+ info_url: None,
+ }
+ }
+
+ /// Get the commit that this `Job` was created with.
+ pub fn commit(&self) -> git::Oid {
+ self.commit
+ }
+
+ /// Get the run identifier, if any, that was associated with this `Job`.
+ pub fn run_id(&self) -> Option<&str> {
+ self.run_id.as_deref()
+ }
+
+ /// Get the info URL, if any, that was associated with this `Job`.
+ pub fn info_url(&self) -> Option<&str> {
+ self.info_url.as_deref()
+ }
+
+ /// Get the `State` of this `Job`.
+ pub fn state(&self) -> State {
+ self.state
+ }
+
+ /// Apply a single action to the job.
+ fn action(&mut self, action: Action) -> Result<(), Error> {
+ match action {
+ Action::Trigger { .. } => {
+ if self.state != State::Fresh {
+ return Err(Error::TriggerWhenNotFresh);
+ }
+ }
+
+ Action::Start { run_id, info_url } => {
+ if self.state != State::Fresh {
+ return Err(Error::StartWhenNotFresh);
+ }
+ self.state = State::Running;
+ self.run_id = Some(run_id);
+ self.info_url = info_url;
+ }
+
+ Action::Finish { reason } => {
+ if self.state != State::Running {
+ return Err(Error::FinishWhenNotRunning);
+ }
+ self.state = State::Finished(reason);
+ }
+ }
+ Ok(())
+ }
+}
+
+impl Cob for Job {
+ type Action = Action;
+ type Error = Error;
+
+ fn type_name() -> &'static TypeName {
+ &TYPENAME
+ }
+
+ fn from_root<R: ReadRepository>(op: Op, _repo: &R) -> Result<Self, Self::Error> {
+ let mut actions = op.actions.into_iter();
+ let Some(Action::Trigger { commit }) = actions.next() else {
+ return Err(Error::Init("the first action must be of type `trigger`"));
+ };
+ let mut job = Job::new(commit);
+
+ for action in actions {
+ job.action(action)?;
+ }
+ Ok(job)
+ }
+
+ fn op<'a, R: ReadRepository, I: IntoIterator<Item = &'a cob::Entry>>(
+ &mut self,
+ op: Op,
+ _concurrent: I,
+ _repo: &R,
+ ) -> Result<(), Error> {
+ // Some day this needs to check authorization. However, we
+ // don't yet know what the rules should be.
+ for action in op.actions {
+ self.action(action)?;
+ }
+ Ok(())
+ }
+}
+
+impl<R: ReadRepository> cob::Evaluate<R> for Job {
+ type Error = Error;
+
+ fn init(entry: &cob::Entry, repo: &R) -> Result<Self, Self::Error> {
+ let op = Op::try_from(entry)?;
+ let job = Job::from_root(op, repo)?;
+ Ok(job)
+ }
+
+ fn apply<'a, I>(
+ &mut self,
+ entry: &cob::Entry,
+ concurrent: I,
+ repo: &R,
+ ) -> Result<(), Self::Error>
+ where
+ I: Iterator<Item = (&'a Oid, &'a Entry<Oid, Oid, ExtendedSignature>)>,
+ {
+ let op = Op::try_from(entry)?;
+ self.op(op, concurrent.map(|(_, e)| e), repo)
+ }
+}
+
+impl<R: ReadRepository> Transaction<Job, R> {
+ /// Push an [`Action::Trigger`] which will create a new `Job` with the
+ /// provided `commit` in the [`State::Fresh`] state.
+ pub fn trigger(&mut self, commit: git::Oid) -> Result<(), store::Error> {
+ self.push(Action::Trigger { commit })
+ }
+
+ /// Push an [`Action::Start`] which will start the `Job` with the provided
+ /// metadata and move the `Job` into the [`State::Running`] state.
+ pub fn start(&mut self, run_id: String, info_url: Option<String>) -> Result<(), store::Error> {
+ self.push(Action::Start { run_id, info_url })
+ }
+
+ /// Push an [`Action::Finish`] which will finish the `Job` with the provided
+ /// reason, moving the `Job` into the [`State::Finished`] state.
+ pub fn finish(&mut self, reason: Reason) -> Result<(), store::Error> {
+ self.push(Action::Finish { reason })
+ }
+}
+
+pub struct JobMut<'a, 'g, R> {
+ id: ObjectId,
+ job: Job,
+ store: &'g mut JobStore<'a, R>,
+}
+
+impl<'a, 'g, R> From<JobMut<'a, 'g, R>> for (JobId, Job) {
+ fn from(value: JobMut<'a, 'g, R>) -> Self {
+ (value.id, value.job)
+ }
+}
+
+impl<'a, 'g, R> std::fmt::Debug for JobMut<'a, 'g, R> {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ f.debug_struct("JobMut")
+ .field("id", &self.id)
+ .field("job", &self.job)
+ .finish()
+ }
+}
+
+impl<'a, 'g, R> JobMut<'a, 'g, R>
+where
+ R: WriteRepository + cob::Store,
+{
+ /// Reload the COB from storage.
+ pub fn reload(&mut self) -> Result<(), store::Error> {
+ self.job = self
+ .store
+ .get(&self.id)?
+ .ok_or_else(|| store::Error::NotFound(TYPENAME.clone(), self.id))?;
+ Ok(())
+ }
+
+ pub fn id(&self) -> &ObjectId {
+ &self.id
+ }
+
+ /// Transition the `Job` into a running state, storing the provided
+ /// metadata.
+ pub fn start<G: Signer>(
+ &mut self,
+ run_id: String,
+ info_url: Option<String>,
+ signer: &G,
+ ) -> Result<EntryId, Error> {
+ self.transaction("Start", signer, |tx| {
+ tx.start(run_id, info_url)?;
+ Ok(())
+ })
+ }
+
+ /// Transition the `Job` into a finished state, with the provided `reason`.
+ pub fn finish<G: Signer>(&mut self, reason: Reason, signer: &G) -> Result<EntryId, Error> {
+ self.transaction("Finish", signer, |tx| tx.finish(reason))
+ }
+
+ pub fn transaction<G, F>(
+ &mut self,
+ message: &str,
+ signer: &G,
+ operations: F,
+ ) -> Result<EntryId, Error>
+ where
+ G: Signer,
+ F: FnOnce(&mut Transaction<Job, R>) -> Result<(), store::Error>,
+ {
+ let mut tx = Transaction::default();
+ operations(&mut tx)?;
+
+ let (job, id) = tx.commit(message, self.id, &mut self.store.raw, signer)?;
+ self.job = job;
+
+ Ok(id)
+ }
+}
+
+impl<'a, 'g, R> Deref for JobMut<'a, 'g, R> {
+ type Target = Job;
+
+ fn deref(&self) -> &Self::Target {
+ &self.job
+ }
+}
+
+pub struct JobStore<'a, R> {
+ raw: Store<'a, Job, R>,
+}
+
+impl<'a, R> Deref for JobStore<'a, R> {
+ type Target = Store<'a, Job, R>;
+
+ fn deref(&self) -> &Self::Target {
+ &self.raw
+ }
+}
+
+impl<'a, R> JobStore<'a, R>
+where
+ R: WriteRepository + ReadRepository + cob::Store,
+{
+ pub fn open(repository: &'a R) -> Result<Self, store::Error> {
+ let raw = store::Store::open(repository)?;
+ Ok(Self { raw })
+ }
+
+ /// Get the `Job`, if any, identified by `id`.
+ pub fn get(&self, id: &JobId) -> Result<Option<Job>, store::Error> {
+ self.raw.get(id)
+ }
+
+ /// Get the `Job`, identified by `id`, which can be mutated.
+ ///
+ /// # Errors
+ ///
+ /// This will fail if the `Job` could not be found.
+ pub fn get_mut<'g>(&'g mut self, id: &JobId) -> Result<JobMut<'a, 'g, R>, store::Error> {
+ let job = self
+ .raw
+ .get(id)?
+ .ok_or_else(|| store::Error::NotFound(TYPENAME.clone(), *id))?;
+ Ok(JobMut {
+ id: *id,
+ job,
+ store: self,
+ })
+ }
+
+ /// Create a fresh `Job` with the provided `commit_id`.
+ pub fn create<'g, G: Signer>(
+ &'g mut self,
+ commit_id: git::Oid,
+ signer: &G,
+ ) -> Result<JobMut<'a, 'g, R>, Error> {
+ let (id, job) = Transaction::initial("Create job", &mut self.raw, signer, |tx, _| {
+ tx.trigger(commit_id)?;
+ Ok(())
+ })?;
+
+ Ok(JobMut {
+ id,
+ job,
+ store: self,
+ })
+ }
+
+ /// Delete the `Job` identified by `id`.
+ pub fn remove<G: Signer>(&self, id: &JobId, signer: &G) -> Result<(), store::Error> {
+ self.raw.remove(id, signer)
+ }
+}
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 87dfce17-baf1-4470-bf80-66c94f961dd2 -v /opt/radcis/ci.rad.levitte.org/cci/state/87dfce17-baf1-4470-bf80-66c94f961dd2/s:/87dfce17-baf1-4470-bf80-66c94f961dd2/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/87dfce17-baf1-4470-bf80-66c94f961dd2/w:/87dfce17-baf1-4470-bf80-66c94f961dd2/w -w /87dfce17-baf1-4470-bf80-66c94f961dd2/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:bookworm bash /87dfce17-baf1-4470-bf80-66c94f961dd2/s/script.sh
+ cargo --version
info: syncing channel updates for '1.80-x86_64-unknown-linux-gnu'
info: latest update on 2024-08-08, rust version 1.80.1 (3f5fd8dd4 2024-08-06)
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.80.1 (376290515 2024-07-16)
+ rustc --version
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
+ cargo fmt --check
+ cargo clippy --all-targets --workspace -- --deny clippy::all
Updating crates.io index
Downloading crates ...
Downloaded git-ref-format v0.3.0
Downloaded amplify v4.6.0
Downloaded subtle v2.5.0
Downloaded iana-time-zone v0.1.60
Downloaded sqlite v0.32.0
Downloaded amplify_derive v4.0.0
Downloaded similar v2.5.0
Downloaded yansi v0.5.1
Downloaded thiserror-impl v1.0.59
Downloaded inout v0.1.3
Downloaded maybe-async v0.2.10
Downloaded unicode-ident v1.0.12
Downloaded p521 v0.13.3
Downloaded vcpkg v0.2.15
Downloaded hashbrown v0.14.3
Downloaded serde v1.0.198
Downloaded tree-sitter-bash v0.20.5
Downloaded itoa v1.0.11
Downloaded primeorder v0.13.6
Downloaded winnow v0.6.8
Downloaded crossbeam-utils v0.8.19
Downloaded libm v0.2.8
Downloaded tree-sitter-html v0.20.0
Downloaded gix-validate v0.8.5
Downloaded byteorder v1.5.0
Downloaded filetime v0.2.23
Downloaded cyphergraphy v0.3.0
Downloaded num-conv v0.1.0
Downloaded libz-sys v1.1.16
Downloaded utf8parse v0.2.1
Downloaded nonempty v0.5.0
Downloaded once_cell v1.19.0
Downloaded parking_lot v0.12.1
Downloaded tree-sitter-typescript v0.20.5
Downloaded sha3 v0.10.8
Downloaded num-iter v0.1.44
Downloaded rsa v0.9.6
Downloaded localtime v1.3.1
Downloaded qcheck v1.0.0
Downloaded linux-raw-sys v0.4.13
Downloaded miniz_oxide v0.7.2
Downloaded noise-framework v0.4.0
Downloaded powerfmt v0.2.0
Downloaded serde_derive v1.0.198
Downloaded num_threads v0.1.7
Downloaded parking_lot_core v0.9.9
Downloaded rfc6979 v0.4.0
Downloaded quote v1.0.36
Downloaded prodash v28.0.0
Downloaded keccak v0.1.5
Downloaded poly1305 v0.8.0
Downloaded regex-automata v0.4.6
Downloaded pem-rfc7468 v0.7.0
Downloaded pkcs1 v0.7.5
Downloaded tree-sitter-go v0.20.0
Downloaded newline-converter v0.3.0
Downloaded idna v0.5.0
Downloaded universal-hash v0.5.1
Downloaded regex-syntax v0.8.3
Downloaded tree-sitter-rust v0.20.4
Downloaded libc v0.2.155
Downloaded io-reactor v0.5.2
Downloaded num-traits v0.2.18
Downloaded regex v1.10.4
Downloaded num-integer v0.1.46
Downloaded salsa20 v0.10.2
Downloaded pretty_assertions v1.4.0
Downloaded ppv-lite86 v0.2.17
Downloaded multibase v0.9.1
Downloaded qcheck-macros v1.0.0
Downloaded version_check v0.9.4
Downloaded typenum v1.17.0
Downloaded sqlite3-src v0.5.1
Downloaded unicode-normalization v0.1.23
Downloaded pbkdf2 v0.12.2
Downloaded gix-traverse v0.39.2
Downloaded tree-sitter-json v0.20.2
Downloaded radicle-std-ext v0.1.0
Downloaded percent-encoding v2.3.1
Downloaded pkg-config v0.3.30
Downloaded tree-sitter-md v0.1.7
Downloaded group v0.13.0
Downloaded gix-sec v0.10.6
Downloaded rustix v0.38.34
Downloaded termion v3.0.0
Downloaded memmap2 v0.9.4
Downloaded radicle-git-ext v0.8.0
Downloaded sha2 v0.10.8
Downloaded serde_json v1.0.116
Downloaded radicle-surf v0.22.0
Downloaded sec1 v0.7.3
Downloaded numtoa v0.1.0
Downloaded nonempty v0.9.0
Downloaded scrypt v0.11.0
Downloaded same-file v1.0.6
Downloaded p256 v0.13.2
Downloaded polyval v0.6.2
Downloaded rand_chacha v0.3.1
Downloaded rand v0.8.5
Downloaded tree-sitter-ruby v0.20.1
Downloaded bloomy v1.2.0
Downloaded memchr v2.7.2
Downloaded sha1_smol v1.0.0
Downloaded scopeguard v1.2.0
Downloaded ryu v1.0.17
Downloaded opaque-debug v0.3.1
Downloaded rand_core v0.6.4
Downloaded popol v3.0.0
Downloaded p384 v0.13.0
Downloaded proc-macro2 v1.0.81
Downloaded proc-macro-error-attr v1.0.4
Downloaded proc-macro-error v1.0.4
Downloaded pkcs8 v0.10.2
Downloaded num-bigint-dig v0.8.4
Downloaded normalize-line-endings v0.3.0
Downloaded netservices v0.8.0
Downloaded lexopt v0.3.0
Downloaded indexmap v2.2.6
Downloaded gix-trace v0.1.9
Downloaded unicode-segmentation v1.11.0
Downloaded tree-sitter-toml v0.20.0
Downloaded tinyvec v1.6.0
Downloaded time-macros v0.2.18
Downloaded ssh-encoding v0.2.0
Downloaded spki v0.7.3
Downloaded smallvec v1.13.2
Downloaded gix-packetline v0.17.5
Downloaded gix-odb v0.61.1
Downloaded gix-object v0.42.3
Downloaded gix-hashtable v0.5.2
Downloaded gix-hash v0.14.2
Downloaded gix-features v0.38.2
Downloaded gix-date v0.8.7
Downloaded gix-credentials v0.24.2
Downloaded gix-actor v0.31.5
Downloaded git2 v0.19.0
Downloaded form_urlencoded v1.2.1
Downloaded flate2 v1.0.28
Downloaded ec25519 v0.1.0
Downloaded diff v0.1.13
Downloaded der v0.7.9
Downloaded data-encoding v2.5.0
Downloaded cypheraddr v0.4.0
Downloaded block-buffer v0.10.4
Downloaded bcrypt-pbkdf v0.10.0
Downloaded anyhow v1.0.82
Downloaded anstyle v1.0.6
Downloaded gix-prompt v0.8.4
Downloaded inquire v0.7.5
Downloaded gix-url v0.27.3
Downloaded gix-diff v0.44.1
Downloaded base64ct v1.6.0
Downloaded autocfg v1.2.0
Downloaded gix-fs v0.11.2
Downloaded git-ref-format-macro v0.3.0
Downloaded base64 v0.13.1
Downloaded ct-codecs v1.1.1
Downloaded chrono v0.4.38
Downloaded chacha20poly1305 v0.10.1
Downloaded chacha20 v0.9.1
Downloaded cc v1.0.95
Downloaded cbc v0.1.2
Downloaded bstr v1.9.1
Downloaded blowfish v0.9.1
Downloaded base64 v0.21.7
Downloaded base32 v0.4.0
Downloaded base-x v0.2.11
Downloaded arc-swap v1.7.1
Downloaded anstream v0.6.13
Downloaded tree-sitter-c v0.20.8
Downloaded equivalent v1.0.1
Downloaded anstyle-parse v0.2.3
Downloaded walkdir v2.5.0
Downloaded unicode-bidi v0.3.15
Downloaded gix-pack v0.51.1
Downloaded elliptic-curve v0.13.8
Downloaded data-encoding-macro v0.1.14
Downloaded ctr v0.9.2
Downloaded colorchoice v1.0.0
Downloaded base16ct v0.2.0
Downloaded crc32fast v1.4.0
Downloaded syn v1.0.109
Downloaded sqlite3-sys v0.15.2
Downloaded escargot v0.5.10
Downloaded log v0.4.21
Downloaded lock_api v0.4.11
Downloaded libgit2-sys v0.17.0+1.8.1
Downloaded lazy_static v1.4.0
Downloaded jobserver v0.1.31
Downloaded home v0.5.9
Downloaded gix-utils v0.1.12
Downloaded unicode-display-width v0.3.0
Downloaded tree-sitter-highlight v0.20.1
Downloaded tree-sitter v0.20.10
Downloaded tempfile v3.10.1
Downloaded git-ref-format-core v0.3.0
Downloaded ff v0.13.0
Downloaded fastrand v2.1.0
Downloaded faster-hex v0.9.0
Downloaded errno v0.3.8
Downloaded either v1.11.0
Downloaded dyn-clone v1.0.17
Downloaded digest v0.10.7
Downloaded deranged v0.3.11
Downloaded const-oid v0.9.6
Downloaded block-padding v0.3.3
Downloaded bitflags v2.5.0
Downloaded ascii v1.1.0
Downloaded gix-transport v0.42.0
Downloaded gix-quote v0.4.12
Downloaded zeroize v1.7.0
Downloaded signature v2.2.0
Downloaded gix-config-value v0.14.6
Downloaded gix-chunk v0.4.8
Downloaded ghash v0.5.1
Downloaded data-encoding-macro-internal v0.1.12
Downloaded timeago v0.4.2
Downloaded time v0.3.36
Downloaded syn v2.0.60
Downloaded siphasher v1.0.1
Downloaded siphasher v0.3.11
Downloaded shell-words v1.1.0
Downloaded gix-command v0.3.6
Downloaded getrandom v0.2.14
Downloaded generic-array v0.14.7
Downloaded fxhash v0.2.1
Downloaded ecdsa v0.16.9
Downloaded cyphernet v0.5.2
Downloaded crypto-common v0.1.6
Downloaded crypto-bigint v0.5.5
Downloaded cpufeatures v0.2.12
Downloaded colored v2.1.0
Downloaded cfg-if v1.0.0
Downloaded anstyle-query v1.0.2
Downloaded hmac v0.12.1
Downloaded gix-tempfile v14.0.1
Downloaded tree-sitter-python v0.20.4
Downloaded time-core v0.1.2
Downloaded thiserror v1.0.59
Downloaded snapbox-macros v0.3.8
Downloaded signature v1.6.4
Downloaded shlex v1.3.0
Downloaded gix-commitgraph v0.24.3
Downloaded crossbeam-channel v0.5.13
Downloaded cipher v0.4.4
Downloaded xattr v1.3.1
Downloaded tree-sitter-css v0.20.0
Downloaded termion v2.0.3
Downloaded spin v0.5.2
Downloaded socket2 v0.5.7
Downloaded aes-gcm v0.10.3
Downloaded unicode-width v0.1.11
Downloaded tinyvec_macros v0.1.1
Downloaded tar v0.4.40
Downloaded socks5-client v0.4.1
Downloaded ed25519 v1.5.3
Downloaded amplify_syn v2.0.1
Downloaded amplify_num v0.5.2
Downloaded ssh-key v0.6.6
Downloaded aead v0.5.2
Downloaded gix-revwalk v0.13.2
Downloaded gix-protocol v0.45.0
Downloaded snapbox v0.4.17
Downloaded url v2.5.0
Downloaded ssh-cipher v0.2.0
Downloaded gix-path v0.10.9
Downloaded aho-corasick v1.1.3
Downloaded aes v0.8.4
Downloaded adler v1.0.2
Compiling libc v0.2.155
Compiling proc-macro2 v1.0.81
Compiling unicode-ident v1.0.12
Checking cfg-if v1.0.0
Compiling once_cell v1.19.0
Compiling version_check v0.9.4
Checking memchr v2.7.2
Checking regex-syntax v0.8.3
Compiling quote v1.0.36
Compiling syn v2.0.60
Checking aho-corasick v1.1.3
Compiling jobserver v0.1.31
Compiling thiserror v1.0.59
Compiling cc v1.0.95
Checking regex-automata v0.4.6
Compiling typenum v1.17.0
Checking getrandom v0.2.14
Compiling generic-array v0.14.7
Checking rand_core v0.6.4
Checking tinyvec_macros v0.1.1
Checking tinyvec v1.6.0
Checking bstr v1.9.1
Checking crypto-common v0.1.6
Checking fastrand v2.1.0
Checking unicode-normalization v0.1.23
Checking subtle v2.5.0
Compiling syn v1.0.109
Checking zeroize v1.7.0
Checking cpufeatures v0.2.12
Checking bitflags v2.5.0
Checking block-padding v0.3.3
Checking inout v0.1.3
Checking block-buffer v0.10.4
Compiling pkg-config v0.3.30
Checking digest v0.10.7
Checking cipher v0.4.4
Compiling autocfg v1.2.0
Compiling thiserror-impl v1.0.59
Compiling crc32fast v1.4.0
Checking sha2 v0.10.8
Checking percent-encoding v2.3.1
Checking unicode-bidi v0.3.15
Checking form_urlencoded v1.2.1
Checking idna v0.5.0
Checking universal-hash v0.5.1
Compiling vcpkg v0.2.15
Checking opaque-debug v0.3.1
Compiling serde v1.0.198
Checking url v2.5.0
Compiling amplify_syn v2.0.1
Compiling serde_derive v1.0.198
Compiling libz-sys v1.1.16
Compiling data-encoding v2.5.0
Compiling rustix v0.38.34
Checking byteorder v1.5.0
Compiling amplify_derive v4.0.0
Checking itoa v1.0.11
Compiling data-encoding-macro-internal v0.1.12
Checking ascii v1.1.0
Checking signature v1.6.4
Checking log v0.4.21
Checking linux-raw-sys v0.4.13
Checking amplify_num v0.5.2
Checking data-encoding-macro v0.1.14
Checking ed25519 v1.5.3
Compiling libgit2-sys v0.17.0+1.8.1
Checking amplify v4.6.0
Checking aead v0.5.2
Compiling proc-macro-error-attr v1.0.4
Checking base-x v0.2.11
Checking ct-codecs v1.1.1
Checking ec25519 v0.1.0
Checking multibase v0.9.1
Checking poly1305 v0.8.0
Checking chacha20 v0.9.1
Compiling proc-macro-error v1.0.4
Checking cyphergraphy v0.3.0
Checking keccak v0.1.5
Checking sha3 v0.10.8
Compiling git-ref-format-core v0.3.0
Checking polyval v0.6.2
Compiling sqlite3-src v0.5.1
Checking hmac v0.12.1
Checking hashbrown v0.14.3
Checking ppv-lite86 v0.2.17
Checking base32 v0.4.0
Checking base64ct v1.6.0
Checking rand_chacha v0.3.1
Checking cypheraddr v0.4.0
Checking pem-rfc7468 v0.7.0
Checking pbkdf2 v0.12.2
Compiling git-ref-format-macro v0.3.0
Checking ghash v0.5.1
Checking chacha20poly1305 v0.10.1
Checking tempfile v3.10.1
Checking ctr v0.9.2
Checking aes v0.8.4
Compiling crossbeam-utils v0.8.19
Checking aes-gcm v0.10.3
Checking git-ref-format v0.3.0
Checking noise-framework v0.4.0
Checking ssh-encoding v0.2.0
Checking socks5-client v0.4.1
Checking rand v0.8.5
Checking blowfish v0.9.1
Checking cbc v0.1.2
Checking radicle-std-ext v0.1.0
Checking ssh-cipher v0.2.0
Checking bcrypt-pbkdf v0.10.0
Checking cyphernet v0.5.2
Checking signature v2.2.0
Checking ssh-key v0.6.6
Checking crossbeam-channel v0.5.13
Checking qcheck v1.0.0
Checking radicle-ssh v0.9.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-ssh)
Compiling num-traits v0.2.18
Compiling tree-sitter v0.20.10
Compiling serde_json v1.0.116
Checking equivalent v1.0.1
Checking indexmap v2.2.6
Checking regex v1.10.4
Checking ryu v1.0.17
Checking nonempty v0.9.0
Checking radicle-dag v0.9.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-dag)
Compiling anyhow v1.0.82
Checking iana-time-zone v0.1.60
Checking lazy_static v1.4.0
Checking anstyle-query v1.0.2
Checking colored v2.1.0
Checking chrono v0.4.38
Checking localtime v1.3.1
Checking base64 v0.21.7
Checking utf8parse v0.2.1
Checking siphasher v1.0.1
Checking anstyle-parse v0.2.3
Checking anstyle v1.0.6
Checking colorchoice v1.0.0
Checking similar v2.5.0
Checking anstream v0.6.13
Checking snapbox-macros v0.3.8
Checking normalize-line-endings v0.3.0
Checking snapbox v0.4.17
Checking radicle-signals v0.10.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-signals)
Checking numtoa v0.1.0
Checking diff v0.1.13
Checking gix-trace v0.1.9
Checking unicode-segmentation v1.11.0
Checking yansi v0.5.1
Compiling adler v1.0.2
Compiling miniz_oxide v0.7.2
Compiling xattr v1.3.1
Checking pretty_assertions v1.4.0
Compiling filetime v0.2.23
Checking lexopt v0.3.0
Compiling escargot v0.5.10
Checking shlex v1.3.0
Compiling tar v0.4.40
Compiling flate2 v1.0.28
Checking newline-converter v0.3.0
Checking termion v2.0.3
Checking fxhash v0.2.1
Checking dyn-clone v1.0.17
Checking faster-hex v0.9.0
Checking unicode-width v0.1.11
Checking inquire v0.7.5
Compiling radicle-surf v0.22.0
Checking unicode-display-width v0.3.0
Checking termion v3.0.0
Checking gix-utils v0.1.12
Compiling tree-sitter-json v0.20.2
Compiling tree-sitter-rust v0.20.4
Compiling tree-sitter-md v0.1.7
Compiling tree-sitter-typescript v0.20.5
Compiling tree-sitter-c v0.20.8
Compiling tree-sitter-go v0.20.0
Compiling tree-sitter-toml v0.20.0
Compiling tree-sitter-html v0.20.0
Compiling tree-sitter-python v0.20.4
Checking sqlite3-sys v0.15.2
Checking sqlite v0.32.0
Compiling tree-sitter-ruby v0.20.1
Compiling tree-sitter-css v0.20.0
Compiling tree-sitter-bash v0.20.5
Checking gix-hash v0.14.2
Checking base64 v0.13.1
Compiling radicle-cli v0.11.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-cli)
Checking nonempty v0.5.0
Checking same-file v1.0.6
Checking walkdir v2.5.0
Checking tree-sitter-highlight v0.20.1
Checking prodash v28.0.0
Checking sha1_smol v1.0.0
Checking timeago v0.4.2
Checking gix-features v0.38.2
Checking smallvec v1.13.2
Compiling lock_api v0.4.11
Compiling parking_lot_core v0.9.9
Checking powerfmt v0.2.0
Checking scopeguard v1.2.0
Compiling num-conv v0.1.0
Compiling time-core v0.1.2
Compiling time-macros v0.2.18
Checking deranged v0.3.11
Checking home v0.5.9
Checking num_threads v0.1.7
Checking gix-path v0.10.9
Checking parking_lot v0.12.1
Checking winnow v0.6.8
Checking gix-validate v0.8.5
Checking gix-chunk v0.4.8
Checking time v0.3.36
Checking memmap2 v0.9.4
Checking shell-words v1.1.0
Checking gix-command v0.3.6
Checking gix-commitgraph v0.24.3
Checking gix-hashtable v0.5.2
Checking gix-config-value v0.14.6
Checking gix-date v0.8.7
Checking gix-url v0.27.3
Checking gix-actor v0.31.5
Checking gix-fs v0.11.2
Checking gix-quote v0.4.12
Checking gix-object v0.42.3
Checking gix-sec v0.10.6
Checking gix-tempfile v14.0.1
Checking gix-prompt v0.8.4
Checking gix-packetline v0.17.5
Checking gix-credentials v0.24.2
Checking gix-transport v0.42.0
Checking gix-revwalk v0.13.2
Checking gix-diff v0.44.1
Compiling maybe-async v0.2.10
Checking arc-swap v1.7.1
Checking gix-traverse v0.39.2
Checking gix-pack v0.51.1
Checking popol v3.0.0
Checking either v1.11.0
Checking io-reactor v0.5.2
Checking gix-protocol v0.45.0
Checking salsa20 v0.10.2
Checking socket2 v0.5.7
Checking gix-odb v0.61.1
Compiling radicle-node v0.10.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-node)
Checking siphasher v0.3.11
Checking bloomy v1.2.0
Checking netservices v0.8.0
Checking scrypt v0.11.0
Checking radicle-systemd v0.9.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-systemd)
Compiling qcheck-macros v1.0.0
Compiling radicle-remote-helper v0.10.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-remote-helper)
Checking git2 v0.19.0
Checking radicle-git-ext v0.8.0
Checking radicle-term v0.11.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-term)
Checking radicle-crypto v0.11.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-crypto)
Checking radicle-cob v0.12.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-cob)
Checking radicle-crdt v0.1.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-crdt)
Checking radicle v0.13.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle)
Checking radicle-cli-test v0.10.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-cli-test)
Checking radicle-fetch v0.10.0 (/87dfce17-baf1-4470-bf80-66c94f961dd2/w/radicle-fetch)
error: all variants have the same prefix: `File`
--> radicle-cli/src/commands/patch/review/builder.rs:140:1
|
140 | / pub enum ReviewItem {
141 | | FileAdded {
142 | | path: PathBuf,
143 | | header: FileHeader,
... |
178 | | },
179 | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= note: `-D clippy::enum-variant-names` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::enum_variant_names)]`
error: very complex type used. Consider factoring parts into `type` definitions
--> radicle-cli/src/commands/patch/review/builder.rs:195:24
|
195 | fn paths(&self) -> (Option<(&Path, Oid)>, Option<(&Path, Oid)>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `-D clippy::type-complexity` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::type_complexity)]`
error: could not compile `radicle-cli` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Exit code: 101
{
"response": "finished",
"result": "failure"
}