From 073a5fb574c4af2be290499a071bfa18761be5b3 Mon Sep 17 00:00:00 2001 From: Daniel Norman Date: Fri, 8 May 2026 16:22:35 +0200 Subject: [PATCH] Bump deps to radicle 0.24 / radicle-job 0.6 - bump radicle 0.22 -> 0.24, radicle-job 0.5.2 -> 0.6, and radicle-surf 0.27.0 -> 0.27.1 to match heartwood - raise radicle-tauri rust-version to 1.86 for radicle-job 0.6's MSRV - migrate to the 0.24 COB store API: signer moves onto the cache via WriteAs, so issues_mut/patches_mut take &signer and the per-call signer arg disappears from every issue/patch action method - pass ReadOnly to JobsStore::open for radicle-job 0.6's new Access type param - replace the removed Profile::socket() with home().socket_from_env() and the removed WriteRepository::set_head() with the set_canonical_symbolic_refs + set_default_branch_to_canonical_head pair used by rad::init - split the old ssh::agent::Error into AgentError + ConnectError so Agent::connect failures still bubble through ? - swap SignedRefsInfo::is_ok() (gone in 0.23) for an explicit matches!(_, Some(_)) on the new None/Some/NeedsMigration enum --- Cargo.lock | 188 +++++++++++------- crates/radicle-tauri/Cargo.toml | 6 +- .../radicle-tauri/src/commands/cob/issue.rs | 3 +- .../radicle-tauri/src/commands/cob/patch.rs | 7 +- crates/radicle-tauri/src/commands/repo.rs | 3 +- crates/radicle-tauri/src/commands/startup.rs | 2 +- crates/radicle-types/Cargo.toml | 8 +- crates/radicle-types/src/error.rs | 6 +- crates/radicle-types/src/traits/issue.rs | 26 +-- crates/radicle-types/src/traits/job.rs | 3 +- crates/radicle-types/src/traits/patch.rs | 56 ++---- crates/radicle-types/src/traits/repo.rs | 10 +- crates/radicle-types/src/traits/thread.rs | 10 +- crates/test-http-api/Cargo.toml | 4 +- 14 files changed, 172 insertions(+), 160 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c674e6662..5098b0f3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -383,12 +383,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base32" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" - [[package]] name = "base64" version = "0.21.7" @@ -1061,15 +1055,39 @@ dependencies = [ ] [[package]] -name = "cypheraddr" -version = "0.4.0" +name = "curve25519-dalek" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5c54d2ad4ab9941383519471b75d12abc1a7b4779265e233168f2703a730d9" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "cypheraddr" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4204e8808fcdd40bed39e49371f13f56d6984c32bc03dcb577d2a40b989b9d68" dependencies = [ "amplify", - "base32", "cyphergraphy", - "sha3", ] [[package]] @@ -1084,9 +1102,9 @@ dependencies = [ [[package]] name = "cyphernet" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac949369884a7a1d802cc669821269c707be8cec4d65043382e253733d2e62e1" +checksum = "2de2031ff4b9fc77e4dad022047341b55d285398164cc698e4082f4754b2e684" dependencies = [ "cypheraddr", "cyphergraphy", @@ -1453,7 +1471,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdfd533a2fc01178c738c99412ae1f7e1ad2cb37c2e14bfd87e9d4618171c825" dependencies = [ "ct-codecs", - "ed25519", + "ed25519 1.5.3", "getrandom 0.2.16", ] @@ -1480,6 +1498,27 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature 2.2.0", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519 2.2.3", + "sha2", + "subtle", +] + [[package]] name = "either" version = "1.15.0" @@ -1616,6 +1655,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "field-offset" version = "0.3.6" @@ -2711,15 +2756,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - [[package]] name = "keyboard-types" version = "0.7.0" @@ -3940,9 +3976,9 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" [[package]] name = "radicle" -version = "0.22.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31fcfcac7b87b1a3677dccae9979046b949fb529d3061214c55b82d643c3b39a" +checksum = "0c07a8a270e9b1b8064a33f0aa78b4fd39924ce4d31e0715659a923917e07b46" dependencies = [ "amplify", "base64 0.21.7", @@ -3956,17 +3992,15 @@ dependencies = [ "indexmap 2.9.0", "libc", "log", - "multibase", "nonempty 0.9.0", "qcheck", "radicle-cob", "radicle-core", "radicle-crypto", - "radicle-git-metadata 0.2.0", + "radicle-git-metadata", "radicle-git-ref-format", "radicle-localtime", "radicle-oid", - "radicle-ssh", "serde", "serde-untagged", "serde_json", @@ -3980,9 +4014,9 @@ dependencies = [ [[package]] name = "radicle-cob" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd49b584b0a61cba52cfd8ec873bb5f3cbc50763d020a4c333aeffa95a5c839e" +checksum = "59e5d3e54429dff785bee3f80b334d67b701f4bd66b7e825d1b4efa8435bba74" dependencies = [ "fastrand", "git-ref-format-core", @@ -3991,7 +4025,7 @@ dependencies = [ "nonempty 0.9.0", "radicle-crypto", "radicle-dag", - "radicle-git-metadata 0.1.0", + "radicle-git-metadata", "radicle-oid", "serde", "serde_json", @@ -4001,9 +4035,9 @@ dependencies = [ [[package]] name = "radicle-core" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617b55b262b946470a355052a6d72c7f8efc724b8d8068021234cda74df7dd30" +checksum = "656cf8f177c04702ac4b4702e622c75a370da0634f925c56c10cab5cadf7487f" dependencies = [ "git2", "multibase", @@ -4018,9 +4052,9 @@ dependencies = [ [[package]] name = "radicle-crypto" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77cf406d3e448de958e3a821bb09612bb2f97ac1dbb2ee314b59264cde8281d" +checksum = "514c5e0c63134b80da4cbcca9a22f7b5cdd741ec63c6acce16ad9389b0f0cd6e" dependencies = [ "amplify", "cyphernet", @@ -4029,12 +4063,13 @@ dependencies = [ "git-ref-format-core", "multibase", "qcheck", - "radicle-ssh", "serde", "signature 2.2.0", "sqlite", + "ssh-agent-lib", "ssh-key", "thiserror 2.0.12", + "winpipe", "zeroize", ] @@ -4061,15 +4096,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "radicle-git-metadata" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522d7fa07dfe61981b5d96e9aeb2b7fb2f4a8d5804638e928eaedb33e423eccb" -dependencies = [ - "thiserror 2.0.12", -] - [[package]] name = "radicle-git-metadata" version = "0.2.0" @@ -4090,13 +4116,14 @@ dependencies = [ [[package]] name = "radicle-job" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16629f31639215409091e4e1099af070db245e773c76680b234c275b329efe42" +checksum = "627fab204e988b8b2aed83cf46f35091e300f41380077b92a674c3927b6b8bb9" dependencies = [ "chrono", "clap", "indexmap 2.9.0", + "log", "nonempty 0.11.0", "once_cell", "qcheck", @@ -4119,25 +4146,15 @@ dependencies = [ [[package]] name = "radicle-oid" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95c486f589d4f5ef7bd8fce56419854d90cc63a8bbcebe021e0a4f4cca75ac9" +checksum = "e60c3fab5115369bee5b757dab3ba9b93825236d3edde230742becb36ba0930a" dependencies = [ "git2", + "qcheck", "serde", ] -[[package]] -name = "radicle-ssh" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216e9e1259d8c857cdb38b2f832fb117e8e26478f110b9a2690bca20b87ec9c5" -dependencies = [ - "thiserror 1.0.69", - "winpipe", - "zeroize", -] - [[package]] name = "radicle-std-ext" version = "0.2.0" @@ -4146,9 +4163,9 @@ checksum = "fb935931bdd2a2966f3b584f3031d9d54ec0713ddbc563a0193d54e62a88ec73" [[package]] name = "radicle-surf" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c6a29eac2e55a6d0632c8faeb3cbe91afb1e07be60d157a27fdadb8cc4c508" +checksum = "a2dfaa46d3e05ca10fc5841bb9cfac9fe6d3685cf2a02b16972f4cafbb888bd1" dependencies = [ "anyhow", "base64 0.21.7", @@ -4696,6 +4713,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + [[package]] name = "selectors" version = "0.24.0" @@ -4918,16 +4944,6 @@ dependencies = [ "digest", ] -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest", - "keccak", -] - [[package]] name = "shared_child" version = "1.0.2" @@ -5022,9 +5038,9 @@ dependencies = [ [[package]] name = "socks5-client" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc7dcf6fab1d65d82d633006a4cc658d76ce436e01cf1a7c71873c0eeba324c" +checksum = "a87421b87207f5d39606da1ac9edd9a5333f4809d26a1fa9bbac58ca42913535" dependencies = [ "amplify", "cypheraddr", @@ -5122,6 +5138,22 @@ dependencies = [ "sqlite3-src", ] +[[package]] +name = "ssh-agent-lib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0582e6e5724c4a5d038472976e8fad64d824b3de37210aa60c35883e3e766" +dependencies = [ + "byteorder", + "log", + "secrecy", + "signature 2.2.0", + "ssh-encoding", + "ssh-key", + "subtle", + "thiserror 2.0.12", +] + [[package]] name = "ssh-cipher" version = "0.2.0" @@ -5157,6 +5189,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b86f5297f0f04d08cabaa0f6bff7cb6aec4d9c3b49d87990d63da9d9156a8c3" dependencies = [ "bcrypt-pbkdf", + "ed25519-dalek", + "num-bigint-dig", "p256", "p384", "p521", @@ -5511,9 +5545,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" dependencies = [ "filetime", "libc", diff --git a/crates/radicle-tauri/Cargo.toml b/crates/radicle-tauri/Cargo.toml index 635e3c9c3..68879b105 100644 --- a/crates/radicle-tauri/Cargo.toml +++ b/crates/radicle-tauri/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" authors = ["Rudolfs Osins ", "Sebastian Martinez "] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.77" +rust-version = "1.86" publish = false [lib] @@ -21,9 +21,9 @@ either = { version = "1.15" } git2 = { version = "0.20.4", default-features = false, features = ["vendored-libgit2"] } infer = { version = "0.19.0" } log = { version = "0.4.22" } -radicle = { version = "0.22" } +radicle = { version = "0.24" } radicle-types = { version = "0.1.0", path = "../radicle-types" } -radicle-surf = { version = "0.27.0", features = ["serde"] } +radicle-surf = { version = "0.27.1", features = ["serde"] } serde = { version = "1.0.0", features = ["derive"] } serde_json = { version = "1.0.0" } tauri = { version = "2.10.3", features = ["isolation"] } diff --git a/crates/radicle-tauri/src/commands/cob/issue.rs b/crates/radicle-tauri/src/commands/cob/issue.rs index 3830a895e..77402a443 100644 --- a/crates/radicle-tauri/src/commands/cob/issue.rs +++ b/crates/radicle-tauri/src/commands/cob/issue.rs @@ -77,7 +77,8 @@ pub async fn rebuild_issue_cache( on_event: tauri::ipc::Channel, ) -> Result<(), Error> { let repo = ctx.profile.storage.repository(rid)?; - let mut issues = ctx.profile.issues_mut(&repo)?; + let signer = ctx.profile.signer()?; + let mut issues = ctx.profile.issues_mut(&repo, &signer)?; on_event.send(types::cobs::CacheEvent::Started { rid })?; issues.write_all(|result, progress| { match result { diff --git a/crates/radicle-tauri/src/commands/cob/patch.rs b/crates/radicle-tauri/src/commands/cob/patch.rs index 673aed730..8c99b1101 100644 --- a/crates/radicle-tauri/src/commands/cob/patch.rs +++ b/crates/radicle-tauri/src/commands/cob/patch.rs @@ -128,7 +128,7 @@ pub fn create_patch_review( ) -> Result { let repo = ctx.profile.storage.repository(args.rid)?; let signer = ctx.profile.signer()?; - let mut patches = ctx.profile.patches_mut(&repo)?; + let mut patches = ctx.profile.patches_mut(&repo, &signer)?; let patch_id = match patches.find_by_revision(&args.revision)? { Some(found) => found.id, None => return Err(cob::patch::Error::RevisionNotFound(args.revision).into()), @@ -139,7 +139,6 @@ pub fn create_patch_review( args.verdict.map(Into::into), args.summary, args.labels, - &signer, )?; for comment in args.comments { @@ -149,7 +148,6 @@ pub fn create_patch_review( comment.location.map(Into::into), None, vec![], - &signer, )?; } @@ -172,7 +170,8 @@ pub async fn rebuild_patch_cache( on_event: tauri::ipc::Channel, ) -> Result<(), Error> { let repo = ctx.profile.storage.repository(rid)?; - let mut patches = ctx.profile.patches_mut(&repo)?; + let signer = ctx.profile.signer()?; + let mut patches = ctx.profile.patches_mut(&repo, &signer)?; on_event.send(types::cobs::CacheEvent::Started { rid })?; patches.write_all(|result, progress| { match result { diff --git a/crates/radicle-tauri/src/commands/repo.rs b/crates/radicle-tauri/src/commands/repo.rs index b607517bb..d794a8500 100644 --- a/crates/radicle-tauri/src/commands/repo.rs +++ b/crates/radicle-tauri/src/commands/repo.rs @@ -189,7 +189,8 @@ pub(crate) async fn create_repo( .backend .reference(ns_head.as_str(), base, false, "Created namespace ref")?; - project.set_head()?; + project.set_canonical_symbolic_refs("set-canonical from create_repo")?; + project.set_default_branch_to_canonical_head()?; project.sign_refs(&signer)?; Ok(()) diff --git a/crates/radicle-tauri/src/commands/startup.rs b/crates/radicle-tauri/src/commands/startup.rs index 136b1dace..0dcc6b56a 100644 --- a/crates/radicle-tauri/src/commands/startup.rs +++ b/crates/radicle-tauri/src/commands/startup.rs @@ -85,7 +85,7 @@ pub(crate) fn startup(app: AppHandle) -> Result { let node_handle = app.app_handle().clone(); - let node = Node::new(profile.socket()); + let node = Node::new(profile.home().socket_from_env()); app.manage(inbox_service); app.manage(patch_service); diff --git a/crates/radicle-types/Cargo.toml b/crates/radicle-types/Cargo.toml index 644b53b12..f897f9eda 100644 --- a/crates/radicle-types/Cargo.toml +++ b/crates/radicle-types/Cargo.toml @@ -14,10 +14,10 @@ git2 = { version = "0.20.4", default-features = false, features = ["vendored-lib log = { version = "0.4.22" } infer = { version = "0.19.0" } mime-infer = { version = "3.0.0" } -radicle = { version = "0.22" } -radicle-job = { version = "0.5.2" } +radicle = { version = "0.24" } +radicle-job = { version = "0.6" } radicle-localtime = { version = "0.1.0", features = ["serde"] } -radicle-surf = { version = "0.27.0", features = ["serde"] } +radicle-surf = { version = "0.27.1", features = ["serde"] } serde = { version = "1.0.0", features = ["derive"] } serde_json = { version = "1.0.0" } sqlite = { version = "0.37.0", features = ["bundled"] } @@ -53,4 +53,4 @@ ts-rs = { version = "12.0.1", features = [ url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -radicle = { version = "0.22", features = ["test"] } +radicle = { version = "0.24", features = ["test"] } diff --git a/crates/radicle-types/src/error.rs b/crates/radicle-types/src/error.rs index 377862b0d..cd4b0a251 100644 --- a/crates/radicle-types/src/error.rs +++ b/crates/radicle-types/src/error.rs @@ -102,7 +102,11 @@ pub enum Error { /// SSH Agent error. #[error(transparent)] - Agent(#[from] radicle::crypto::ssh::agent::Error), + Agent(#[from] radicle::crypto::ssh::agent::AgentError), + + /// SSH Agent connection error. + #[error(transparent)] + AgentConnect(#[from] radicle::crypto::ssh::agent::ConnectError), /// Node database error. #[error(transparent)] diff --git a/crates/radicle-types/src/traits/issue.rs b/crates/radicle-types/src/traits/issue.rs index 81ea8f68f..6d1ea0fcc 100644 --- a/crates/radicle-types/src/traits/issue.rs +++ b/crates/radicle-types/src/traits/issue.rs @@ -102,11 +102,11 @@ pub trait IssuesMut: Profile { opts: cobs::CobOptions, ) -> Result { let profile = self.profile(); - let mut node = Node::new(profile.socket()); + let mut node = Node::new(profile.home().socket_from_env()); let repo = profile.storage.repository(rid)?; let signer = profile.signer()?; let aliases = profile.aliases(); - let mut issues = profile.issues_mut(&repo)?; + let mut issues = profile.issues_mut(&repo, &signer)?; let title = Title::try_from(new.title)?; let issue = issues.create( title, @@ -114,7 +114,6 @@ pub trait IssuesMut: Profile { &new.labels, &new.assignees, new.embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; if opts.announce() { @@ -134,35 +133,32 @@ pub trait IssuesMut: Profile { opts: cobs::CobOptions, ) -> Result { let profile = self.profile(); - let mut node = Node::new(profile.socket()); + let mut node = Node::new(profile.home().socket_from_env()); let repo = profile.storage.repository(rid)?; let signer = profile.signer()?; let aliases = profile.aliases(); - let mut issues = profile.issues_mut(&repo)?; + let mut issues = profile.issues_mut(&repo, &signer)?; let mut issue = issues.get_mut(&cob_id.into())?; match action { cobs::issue::Action::Lifecycle { state } => { - issue.lifecycle(state.into(), &signer)?; + issue.lifecycle(state.into())?; } cobs::issue::Action::Assign { assignees } => { - issue.assign( - assignees.iter().map(|a| *a.did()).collect::>(), - &signer, - )?; + issue.assign(assignees.iter().map(|a| *a.did()).collect::>())?; } cobs::issue::Action::Label { labels } => { - issue.label(labels, &signer)?; + issue.label(labels)?; } cobs::issue::Action::CommentReact { id, reaction, active, } => { - issue.react(id, reaction, active, &signer)?; + issue.react(id, reaction, active)?; } cobs::issue::Action::CommentRedact { id } => { - issue.redact_comment(id, &signer)?; + issue.redact_comment(id)?; } cobs::issue::Action::Comment { body, @@ -173,7 +169,6 @@ pub trait IssuesMut: Profile { body, reply_to.unwrap_or(cob_id), embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } cobs::issue::Action::CommentEdit { id, body, embeds } => { @@ -181,11 +176,10 @@ pub trait IssuesMut: Profile { id, body, embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } cobs::issue::Action::Edit { title } => { - issue.edit(Title::try_from(title)?, &signer)?; + issue.edit(Title::try_from(title)?)?; } } diff --git a/crates/radicle-types/src/traits/job.rs b/crates/radicle-types/src/traits/job.rs index f054da28c..16a2c62d1 100644 --- a/crates/radicle-types/src/traits/job.rs +++ b/crates/radicle-types/src/traits/job.rs @@ -1,3 +1,4 @@ +use radicle::cob::store::access::ReadOnly; use radicle::storage::ReadStorage; use radicle::{git, identity}; use radicle_job::{Job, JobId, Jobs as JobsStore}; @@ -12,7 +13,7 @@ pub trait Jobs: Profile { let repo = profile.storage.repository(rid)?; let aliases = &profile.aliases(); - let jobs = JobsStore::open(&repo).unwrap(); + let jobs = JobsStore::open(&repo, ReadOnly).unwrap(); let found_jobs: Result, _> = jobs.find_by_commit(sha)?.collect(); Ok(found_jobs? diff --git a/crates/radicle-types/src/traits/patch.rs b/crates/radicle-types/src/traits/patch.rs index ce3cf2014..aa29286c7 100644 --- a/crates/radicle-types/src/traits/patch.rs +++ b/crates/radicle-types/src/traits/patch.rs @@ -1,7 +1,6 @@ use std::collections::BTreeSet; use radicle::cob::Title; -use radicle::node::device::BoxedSigner; use radicle::node::Handle; use radicle::patch::cache::Patches as _; use radicle::storage::ReadStorage; @@ -100,11 +99,11 @@ pub trait PatchesMut: Profile { opts: cobs::CobOptions, ) -> Result { let profile = self.profile(); - let mut node = Node::new(profile.socket()); + let mut node = Node::new(profile.home().socket_from_env()); let repo = profile.storage.repository(rid)?; let signer = profile.signer()?; let aliases = profile.aliases(); - let mut patches = profile.patches_mut(&repo)?; + let mut patches = profile.patches_mut(&repo, &signer)?; let mut patch = patches.get_mut(&cob_id.into())?; match action { @@ -117,14 +116,13 @@ pub trait PatchesMut: Profile { revision, description, embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } models::patch::Action::RevisionCommentRedact { revision, comment } => { - patch.comment_redact(revision, comment, &signer)?; + patch.comment_redact(revision, comment)?; } models::patch::Action::ReviewCommentRedact { review, comment } => { - patch.redact_review_comment(review, comment, &signer)?; + patch.redact_review_comment(review, comment)?; } models::patch::Action::ReviewCommentReact { review, @@ -132,16 +130,16 @@ pub trait PatchesMut: Profile { reaction, active, } => { - patch.react_review_comment(review, comment, reaction, active, &signer)?; + patch.react_review_comment(review, comment, reaction, active)?; } models::patch::Action::ReviewCommentResolve { review, comment } => { - patch.resolve_review_comment(review, comment, &signer)?; + patch.resolve_review_comment(review, comment)?; } models::patch::Action::ReviewCommentUnresolve { review, comment } => { - patch.unresolve_review_comment(review, comment, &signer)?; + patch.unresolve_review_comment(review, comment)?; } models::patch::Action::Edit { title, target } => { - patch.edit::(Title::try_from(title)?, target, &signer)?; + patch.edit(Title::try_from(title)?, target)?; } models::patch::Action::ReviewEdit { review, @@ -160,7 +158,6 @@ pub trait PatchesMut: Profile { .into_iter() .map(Into::into) .collect::>(), - &signer, )?; } models::patch::Action::ReviewReact { @@ -168,7 +165,7 @@ pub trait PatchesMut: Profile { reaction, active, } => { - patch.review_react(review, reaction, active, &signer)?; + patch.review_react(review, reaction, active)?; } models::patch::Action::Review { revision, @@ -176,16 +173,10 @@ pub trait PatchesMut: Profile { verdict, labels, } => { - patch.review( - revision, - verdict.map(|v| v.into()), - summary, - labels, - &signer, - )?; + patch.review(revision, verdict.map(|v| v.into()), summary, labels)?; } models::patch::Action::ReviewRedact { review } => { - patch.redact_review(review, &signer)?; + patch.redact_review(review)?; } models::patch::Action::ReviewComment { review, @@ -200,7 +191,6 @@ pub trait PatchesMut: Profile { location.map(|l| l.into()), reply_to, embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } models::patch::Action::ReviewCommentEdit { @@ -214,20 +204,16 @@ pub trait PatchesMut: Profile { comment, body, embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } models::patch::Action::Lifecycle { state } => { - patch.lifecycle(state, &signer)?; + patch.lifecycle(state)?; } models::patch::Action::Assign { assignees } => { - patch.assign( - assignees.iter().map(|a| *a.did()).collect::>(), - &signer, - )?; + patch.assign(assignees.iter().map(|a| *a.did()).collect::>())?; } models::patch::Action::Label { labels } => { - patch.label(labels, &signer)?; + patch.label(labels)?; } models::patch::Action::RevisionReact { revision, @@ -235,13 +221,7 @@ pub trait PatchesMut: Profile { location, active, } => { - patch.react( - revision, - reaction, - location.map(|l| l.into()), - active, - &signer, - )?; + patch.react(revision, reaction, location.map(|l| l.into()), active)?; } models::patch::Action::RevisionComment { revision, @@ -256,7 +236,6 @@ pub trait PatchesMut: Profile { reply_to, location.map(|l| l.into()), embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } models::patch::Action::RevisionCommentEdit { @@ -270,7 +249,6 @@ pub trait PatchesMut: Profile { comment, body, embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; } models::patch::Action::RevisionCommentReact { @@ -279,10 +257,10 @@ pub trait PatchesMut: Profile { reaction, active, } => { - patch.comment_react(revision, comment, reaction, active, &signer)?; + patch.comment_react(revision, comment, reaction, active)?; } models::patch::Action::RevisionRedact { revision } => { - patch.redact(revision, &signer)?; + patch.redact(revision)?; } models::patch::Action::Merge { .. } => { unimplemented!("We don't support merging of patches through the desktop") diff --git a/crates/radicle-types/src/traits/repo.rs b/crates/radicle-types/src/traits/repo.rs index 0494c2ff4..cbc4c7035 100644 --- a/crates/radicle-types/src/traits/repo.rs +++ b/crates/radicle-types/src/traits/repo.rs @@ -41,7 +41,9 @@ pub trait Repo: Profile { let mut entries = Vec::new(); for RepositoryInfo { rid, doc, refs, .. } in repos { - if refs.is_ok() && show == Show::Contributor { + if matches!(refs, radicle::storage::SignedRefsInfo::Some(_)) + && show == Show::Contributor + { continue; } @@ -124,7 +126,7 @@ pub trait Repo: Profile { delegate += 1; } - if refs.is_ok() { + if matches!(refs, radicle::storage::SignedRefsInfo::Some(_)) { contributor += 1; } } @@ -472,7 +474,7 @@ pub trait Repo: Profile { fn unseed(&self, rid: identity::RepoId) -> Result<(), Error> { let profile = self.profile(); - let mut node = radicle::Node::new(profile.socket()); + let mut node = radicle::Node::new(profile.home().socket_from_env()); profile.unseed(rid, &mut node)?; @@ -481,7 +483,7 @@ pub trait Repo: Profile { fn seed(&self, rid: identity::RepoId) -> Result<(), Error> { let profile = self.profile(); - let mut node = radicle::Node::new(profile.socket()); + let mut node = radicle::Node::new(profile.home().socket_from_env()); profile.seed(rid, node::policy::Scope::All, &mut node)?; diff --git a/crates/radicle-types/src/traits/thread.rs b/crates/radicle-types/src/traits/thread.rs index 35493ee6e..c3d731191 100644 --- a/crates/radicle-types/src/traits/thread.rs +++ b/crates/radicle-types/src/traits/thread.rs @@ -99,10 +99,10 @@ pub trait Thread: Profile { ) -> Result, Error> { let profile = self.profile(); let aliases = &profile.aliases(); - let mut node = Node::new(profile.socket()); + let mut node = Node::new(profile.home().socket_from_env()); let signer = profile.signer()?; let repo = profile.storage.repository(rid)?; - let mut issues = profile.issues_mut(&repo)?; + let mut issues = profile.issues_mut(&repo, &signer)?; let mut issue = issues.get_mut(&new.id.into())?; let id = new.reply_to.unwrap_or_else(|| { let (root_id, _) = issue.root(); @@ -113,7 +113,6 @@ pub trait Thread: Profile { n.body, id, n.embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; if opts.announce() { @@ -144,10 +143,10 @@ pub trait Thread: Profile { ) -> Result, Error> { let profile = self.profile(); let aliases = &profile.aliases(); - let mut node = Node::new(profile.socket()); + let mut node = Node::new(profile.home().socket_from_env()); let signer = profile.signer()?; let repo = profile.storage.repository(rid)?; - let mut patches = profile.patches_mut(&repo)?; + let mut patches = profile.patches_mut(&repo, &signer)?; let mut patch = patches.get_mut(&new.id.into())?; let n = new.clone(); let oid = patch.comment( @@ -156,7 +155,6 @@ pub trait Thread: Profile { n.reply_to, n.location.map(|l| l.into()), n.embeds.into_iter().map(Into::into).collect::>(), - &signer, )?; if opts.announce() { diff --git a/crates/test-http-api/Cargo.toml b/crates/test-http-api/Cargo.toml index 2fb367626..6d8974488 100644 --- a/crates/test-http-api/Cargo.toml +++ b/crates/test-http-api/Cargo.toml @@ -13,8 +13,8 @@ anyhow = { version = "1.0.90" } axum = { version = "0.8.1", default-features = false, features = ["json", "query", "tokio", "http1"] } hyper = { version = "1.6", default-features = false } lexopt = { version = "0.3.0" } -radicle = { version = "0.22" } -radicle-surf = { version = "0.27.0", default-features = false, features = ["serde"] } +radicle = { version = "0.24" } +radicle-surf = { version = "0.27.1", default-features = false, features = ["serde"] } radicle-types = { path = "../radicle-types" } serde = { version = "1.0.0", features = ["derive"] } serde_json = { version = "1.0.0", features = ["preserve_order"] }