Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: Keep pinned repos ordered in config
✗ CI failure Tobias Hunger committed 10 months ago
commit fb3fc5eb9679c3471aaf0a4b79618cf145141f59
parent 78ba263d0a946c4b90235d562b56ceb7badfc965
1 failed 1 pending (2 total) View logs
4 files changed +12 -4
modified Cargo.lock
@@ -1615,6 +1615,7 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
dependencies = [
 "equivalent",
 "hashbrown",
+
 "serde",
]

[[package]]
@@ -2355,6 +2356,7 @@ dependencies = [
 "emojis",
 "fastrand",
 "git2",
+
 "indexmap",
 "jsonschema",
 "libc",
 "localtime",
modified crates/radicle-cli/examples/rad-config.md
@@ -136,7 +136,7 @@ Values for changes are being validated.

``` (fail)
$ rad config set web.pinned.repositories 5
-
✗ Error: configuration JSON error: invalid type: integer `5`, expected a sequence
+
✗ Error: configuration JSON error: invalid type: integer `5`, expected a set
```

The type of the operation is validated.
modified crates/radicle/Cargo.toml
@@ -24,6 +24,7 @@ crossbeam-channel = { workspace = true }
cyphernet = { workspace = true, features = ["tor", "dns", "p2p-ed25519"] }
fastrand = { workspace = true }
git2 = { workspace = true, features = ["vendored-libgit2"] }
+
indexmap = { version = "2", features = ["serde"] }
libc = { workspace = true }
localtime = { workspace = true, features = ["serde"] }
log = { workspace = true, features = ["std"] }
modified crates/radicle/src/web.rs
@@ -1,6 +1,7 @@
-
use crate::prelude::RepoId;
+
use indexmap::IndexSet;
use serde::{Deserialize, Serialize};
-
use std::collections::HashSet;
+

+
use crate::prelude::RepoId;

/// Web configuration.
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
@@ -34,5 +35,9 @@ pub struct Config {
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct Pinned {
    /// Pinned repositories.
-
    pub repositories: HashSet<RepoId>,
+
    #[cfg_attr(
+
        feature = "schemars",
+
        schemars(with = "std::collections::HashSet<RepoId>")
+
    )]
+
    pub repositories: IndexSet<RepoId>,
}