radicle: Keep pinned repos ordered in config
Do not return them in a random order in radicle-httpd, so that we can have them in a defined order in radicle-explorer.
This commit is contained in:
parent
1fa30e2e88
commit
7c4b71ab82
|
|
@ -1719,6 +1719,7 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -2479,6 +2480,7 @@ dependencies = [
|
||||||
"fast-glob",
|
"fast-glob",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"git2",
|
"git2",
|
||||||
|
"indexmap",
|
||||||
"jsonschema",
|
"jsonschema",
|
||||||
"libc",
|
"libc",
|
||||||
"localtime",
|
"localtime",
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ Values for changes are being validated.
|
||||||
|
|
||||||
``` (fail)
|
``` (fail)
|
||||||
$ rad config set web.pinned.repositories 5
|
$ rad config set web.pinned.repositories 5
|
||||||
✗ Error: writing configuration to "[..]/.radicle/config.json" failed: validation failure due to invalid type: integer `5`, expected a sequence
|
✗ Error: writing configuration to "[..]/.radicle/config.json" failed: validation failure due to invalid type: integer `5`, expected a set
|
||||||
```
|
```
|
||||||
|
|
||||||
The type of the operation is validated.
|
The type of the operation is validated.
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ cyphernet = { workspace = true, features = ["tor", "dns", "p2p-ed25519"] }
|
||||||
fast-glob = { version = "0.3.2" }
|
fast-glob = { version = "0.3.2" }
|
||||||
fastrand = { workspace = true }
|
fastrand = { workspace = true }
|
||||||
git2 = { workspace = true, features = ["vendored-libgit2"] }
|
git2 = { workspace = true, features = ["vendored-libgit2"] }
|
||||||
|
indexmap = { version = "2", features = ["serde"] }
|
||||||
libc = { workspace = true }
|
libc = { workspace = true }
|
||||||
localtime = { workspace = true, features = ["serde"] }
|
localtime = { workspace = true, features = ["serde"] }
|
||||||
log = { workspace = true, features = ["std"] }
|
log = { workspace = true, features = ["std"] }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::prelude::RepoId;
|
use indexmap::IndexSet;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashSet;
|
|
||||||
|
use crate::prelude::RepoId;
|
||||||
|
|
||||||
/// Web configuration.
|
/// Web configuration.
|
||||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
|
|
@ -34,5 +35,9 @@ pub struct Config {
|
||||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||||
pub struct Pinned {
|
pub struct Pinned {
|
||||||
/// Pinned repositories.
|
/// Pinned repositories.
|
||||||
pub repositories: HashSet<RepoId>,
|
#[cfg_attr(
|
||||||
|
feature = "schemars",
|
||||||
|
schemars(with = "std::collections::HashSet<RepoId>")
|
||||||
|
)]
|
||||||
|
pub repositories: IndexSet<RepoId>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue