Radish alpha
r
rad:z2UcCU1LgMshWvXj6hXSDDrwB8q8M
Radicle Job Collaborative Object
Radicle
Git
chore: radicle 0.15
Fintan Halpenny committed 11 months ago
commit 256242f1ff8d8cb3a07435bea806b7d5f7f82d08
parent 7cd8b06
3 files changed +36 -28
modified Cargo.lock
@@ -1118,8 +1118,9 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"

[[package]]
name = "radicle"
-
version = "0.14.0"
-
source = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?rev=refs%2Fheads%2Fmaster#5a0a334dddeee5eed68ad8fed3b59213505675b7"
+
version = "0.15.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "0fbbbde9fb67cc5264a38ba0f106b55892a1aeb8c8ca9023ec36a6b7e0442700"
dependencies = [
 "amplify",
 "base64",
@@ -1150,8 +1151,9 @@ dependencies = [

[[package]]
name = "radicle-cob"
-
version = "0.13.0"
-
source = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?rev=refs%2Fheads%2Fmaster#5a0a334dddeee5eed68ad8fed3b59213505675b7"
+
version = "0.14.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "6e9c90efa7a3febd01d33ed2e72cb12296c971ce03efa243d11c01520fcc1be8"
dependencies = [
 "fastrand",
 "git2",
@@ -1163,13 +1165,15 @@ dependencies = [
 "radicle-git-ext",
 "serde",
 "serde_json",
+
 "signature 2.2.0",
 "thiserror 1.0.69",
]

[[package]]
name = "radicle-crypto"
-
version = "0.11.0"
-
source = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?rev=refs%2Fheads%2Fmaster#5a0a334dddeee5eed68ad8fed3b59213505675b7"
+
version = "0.12.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d16d9e1403a6c3073dce14f3ed893f430bb67d7af6a07cc7fe4b81907025ba22"
dependencies = [
 "amplify",
 "cyphernet",
@@ -1180,6 +1184,7 @@ dependencies = [
 "radicle-git-ext",
 "radicle-ssh",
 "serde",
+
 "signature 2.2.0",
 "sqlite",
 "ssh-key",
 "thiserror 1.0.69",
@@ -1189,7 +1194,8 @@ dependencies = [
[[package]]
name = "radicle-dag"
version = "0.10.0"
-
source = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?rev=refs%2Fheads%2Fmaster#5a0a334dddeee5eed68ad8fed3b59213505675b7"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "cb41c7e10ada3a4df960190a96bfb4af56d33ada890f917acc8e3b122b614875"
dependencies = [
 "fastrand",
]
@@ -1226,7 +1232,8 @@ dependencies = [
[[package]]
name = "radicle-ssh"
version = "0.9.0"
-
source = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?rev=refs%2Fheads%2Fmaster#5a0a334dddeee5eed68ad8fed3b59213505675b7"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "fbee758010fb64482be4b18591fbeb3cbc15b16450d143edf4edb5484c7366c6"
dependencies = [
 "byteorder",
 "log",
modified Cargo.toml
@@ -14,17 +14,12 @@ indexmap = { version = "2.7.1", features = ["serde"] }
nonempty = "0.11.0"
once_cell = "1.20.3"
qcheck = "1.0.0"
+
radicle = { version = "0.15" }
serde = { version = "1.0", features = ["derive"] }
thiserror = "2.0.11"
url = { version = "2.5.4", features = ["serde"] }
uuid = { version = "1.13.1", features = ["serde", "v4"] }

-
# TODO: we depend on a commit that improves the `Transaction::initial` method
-
[dependencies.radicle]
-
git = "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"
-
rev = "refs/heads/master"
-

[dev-dependencies.radicle]
-
git = "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"
-
rev = "refs/heads/master"
+
version = "0.15"
features = ["test"]
modified src/lib.rs
@@ -47,7 +47,9 @@ use indexmap::IndexMap;
use once_cell::sync::Lazy;
use radicle::cob::store::Cob;
use radicle::cob::{self, store, EntryId, Evaluate, ObjectId, Op, TypeName};
-
use radicle::crypto::Signer;
+
use radicle::crypto;
+
use radicle::crypto::signature::Signer;
+
use radicle::node::device::Device;
use radicle::node::NodeId;
use radicle::prelude::ReadRepository;
use radicle::storage::{RepositoryError, SignRepository, WriteRepository};
@@ -498,7 +500,7 @@ impl<'a, R> Deref for Jobs<'a, R> {

impl<'a, R> Jobs<'a, R>
where
-
    R: ReadRepository + cob::Store,
+
    R: ReadRepository + cob::Store<Namespace = NodeId>,
{
    /// Open a jobs store.
    pub fn open(repository: &'a R) -> Result<Self, RepositoryError> {
@@ -521,7 +523,7 @@ where

impl<'a, R> Jobs<'a, R>
where
-
    R: ReadRepository + SignRepository + cob::Store,
+
    R: ReadRepository + SignRepository + cob::Store<Namespace = NodeId>,
{
    /// Get a [`JobMut`].
    pub fn get_mut<'g, C>(&'g mut self, id: &ObjectId) -> Result<JobMut<'a, 'g, R>, store::Error> {
@@ -540,10 +542,10 @@ where
    pub fn create<'g, G>(
        &'g mut self,
        oid: Oid,
-
        signer: &G,
+
        signer: &Device<G>,
    ) -> Result<JobMut<'a, 'g, R>, store::Error>
    where
-
        G: Signer,
+
        G: Signer<crypto::Signature>,
    {
        let (id, job) = store::Transaction::initial::<_, _, Transaction<R>>(
            "Request job",
@@ -580,7 +582,7 @@ impl<R> Deref for JobMut<'_, '_, R> {

impl<'a, 'g, R> JobMut<'a, 'g, R>
where
-
    R: WriteRepository + cob::Store,
+
    R: WriteRepository + cob::Store<Namespace = NodeId>,
{
    pub fn new(id: ObjectId, job: Job, store: &'g mut Jobs<'a, R>) -> Self {
        Self { id, job, store }
@@ -602,9 +604,14 @@ where

    /// Start a new [`Run`] for the node, where the run is identified by the
    /// given [`Uuid`].
-
    pub fn run<G>(&mut self, uuid: Uuid, log: Url, signer: &G) -> Result<EntryId, store::Error>
+
    pub fn run<G>(
+
        &mut self,
+
        uuid: Uuid,
+
        log: Url,
+
        signer: &Device<G>,
+
    ) -> Result<EntryId, store::Error>
    where
-
        G: Signer,
+
        G: Signer<crypto::Signature>,
    {
        self.transaction("Run node job", signer, |tx| tx.run(uuid, log))
    }
@@ -615,10 +622,10 @@ where
        &mut self,
        uuid: Uuid,
        reason: Reason,
-
        signer: &G,
+
        signer: &Device<G>,
    ) -> Result<EntryId, store::Error>
    where
-
        G: Signer,
+
        G: Signer<crypto::Signature>,
    {
        self.transaction("Finished node job", signer, |tx| tx.finish(uuid, reason))
    }
@@ -626,11 +633,11 @@ where
    pub fn transaction<G, F>(
        &mut self,
        message: &str,
-
        signer: &G,
+
        signer: &Device<G>,
        operations: F,
    ) -> Result<EntryId, store::Error>
    where
-
        G: Signer,
+
        G: Signer<crypto::Signature>,
        F: FnOnce(&mut Transaction<R>) -> Result<(), store::Error>,
    {
        let mut tx = Transaction::default();
@@ -712,7 +719,6 @@ where
#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod test {
-
    use radicle::crypto::Signer;
    use radicle::git::{raw::Repository, Oid};
    use radicle::test;
    use url::Url;