Compare commits
1 Commits
707f9cefed
...
4988553d9a
Author | SHA1 | Date | |
---|---|---|---|
|
4988553d9a |
@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [0.2.0] - 2024-09-14
|
## [0.2.0] - 2024-09-14
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- add settings config
|
|
||||||
- add github fetch prs refactoring
|
- add github fetch prs refactoring
|
||||||
- gitea able to pull repositories
|
- gitea able to pull repositories
|
||||||
- add config
|
- add config
|
||||||
|
23
Cargo.lock
generated
23
Cargo.lock
generated
@ -260,12 +260,6 @@ dependencies = [
|
|||||||
"powerfmt",
|
"powerfmt",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "diff"
|
|
||||||
version = "0.1.13"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dotenv"
|
name = "dotenv"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
@ -470,7 +464,6 @@ dependencies = [
|
|||||||
"dotenv",
|
"dotenv",
|
||||||
"gitea-rs",
|
"gitea-rs",
|
||||||
"octocrab",
|
"octocrab",
|
||||||
"pretty_assertions",
|
|
||||||
"serde",
|
"serde",
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
"toml",
|
||||||
@ -1082,16 +1075,6 @@ version = "0.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pretty_assertions"
|
|
||||||
version = "1.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66"
|
|
||||||
dependencies = [
|
|
||||||
"diff",
|
|
||||||
"yansi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.86"
|
version = "1.0.86"
|
||||||
@ -2168,12 +2151,6 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "yansi"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zeroize"
|
name = "zeroize"
|
||||||
version = "1.8.1"
|
version = "1.8.1"
|
||||||
|
@ -20,6 +20,3 @@ toml = "0.8.19"
|
|||||||
gitea-rs = { git = "https://git.front.kjuulh.io/kjuulh/gitea-rs", version = "1.22.1" }
|
gitea-rs = { git = "https://git.front.kjuulh.io/kjuulh/gitea-rs", version = "1.22.1" }
|
||||||
url = "2.5.2"
|
url = "2.5.2"
|
||||||
octocrab = "0.39.0"
|
octocrab = "0.39.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
pretty_assertions = "1.4.0"
|
|
||||||
|
@ -1,28 +1,14 @@
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::Path;
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
#[serde(default)]
|
|
||||||
pub settings: Settings,
|
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub providers: Providers,
|
pub providers: Providers,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)]
|
|
||||||
pub struct Settings {
|
|
||||||
#[serde(default)]
|
|
||||||
cache: Cache,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)]
|
|
||||||
pub struct Cache {
|
|
||||||
location: Option<PathBuf>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)]
|
||||||
pub struct Providers {
|
pub struct Providers {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
@ -163,13 +149,10 @@ mod test {
|
|||||||
fn test_can_parse_config() -> anyhow::Result<()> {
|
fn test_can_parse_config() -> anyhow::Result<()> {
|
||||||
let content = r#"
|
let content = r#"
|
||||||
[[providers.github]]
|
[[providers.github]]
|
||||||
current_user = "kjuulh"
|
|
||||||
access_token = "some-token"
|
|
||||||
users = ["kjuulh"]
|
users = ["kjuulh"]
|
||||||
organisations = ["lunarway"]
|
organisations = ["lunarway"]
|
||||||
|
|
||||||
[[providers.github]]
|
[[providers.github]]
|
||||||
access_token = { env = "something" }
|
|
||||||
users = ["other"]
|
users = ["other"]
|
||||||
organisations = ["org"]
|
organisations = ["org"]
|
||||||
|
|
||||||
@ -190,7 +173,7 @@ mod test {
|
|||||||
|
|
||||||
let config = Config::from_string(content)?;
|
let config = Config::from_string(content)?;
|
||||||
|
|
||||||
pretty_assertions::assert_eq!(
|
assert_eq!(
|
||||||
Config {
|
Config {
|
||||||
providers: Providers {
|
providers: Providers {
|
||||||
github: vec![
|
github: vec![
|
||||||
@ -234,11 +217,6 @@ mod test {
|
|||||||
current_user: None
|
current_user: None
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
|
||||||
settings: Settings {
|
|
||||||
cache: Cache {
|
|
||||||
location: Some(PathBuf::from("$HOME/.cache/gitnow/"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config
|
config
|
||||||
@ -260,9 +238,6 @@ mod test {
|
|||||||
providers: Providers {
|
providers: Providers {
|
||||||
github: vec![],
|
github: vec![],
|
||||||
gitea: vec![]
|
gitea: vec![]
|
||||||
},
|
|
||||||
settings: Settings {
|
|
||||||
cache: Cache { location: None }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config
|
config
|
||||||
|
Loading…
Reference in New Issue
Block a user