Upgrade dependencies and base images (#617)

Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
Sergio Castaño Arteaga 2025-05-12 08:10:27 +02:00 committed by GitHub
parent 3915b82736
commit 9183e10d6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 159 additions and 374 deletions

View File

@ -15,7 +15,7 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.85.0
toolchain: 1.86.0
components: clippy, rustfmt
- name: Run clippy
run: cargo clippy --all-targets --all-features -- --deny warnings
@ -30,6 +30,6 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.85.0
toolchain: 1.86.0
- name: Run backend tests
run: cargo test

438
Cargo.lock generated
View File

@ -92,9 +92,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.97"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
[[package]]
name = "arc-swap"
@ -110,46 +110,24 @@ checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
[[package]]
name = "askama"
version = "0.3.5"
source = "git+https://github.com/askama-rs/askama?rev=70531eb#70531eb827fe940435d1d7b75684e889a9637031"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
dependencies = [
"askama_derive 0.3.5",
"askama_derive",
"itoa",
"percent-encoding",
"serde",
"serde_json",
]
[[package]]
name = "askama"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28"
dependencies = [
"askama_derive 0.12.5",
"askama_escape",
"humansize",
"num-traits",
"percent-encoding",
]
[[package]]
name = "askama_axum"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41603f7cdbf5ac4af60760f17253eb6adf6ec5b6f14a7ed830cf687d375f163"
dependencies = [
"askama 0.12.1",
"axum-core 0.4.5",
"http 1.3.1",
]
[[package]]
name = "askama_derive"
version = "0.3.5"
source = "git+https://github.com/askama-rs/askama?rev=70531eb#70531eb827fe940435d1d7b75684e889a9637031"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
dependencies = [
"askama_parser 0.3.5",
"askama_parser",
"basic-toml",
"memchr",
"proc-macro2",
@ -160,41 +138,11 @@ dependencies = [
"syn 2.0.89",
]
[[package]]
name = "askama_derive"
version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83"
dependencies = [
"askama_parser 0.2.1",
"basic-toml",
"mime",
"mime_guess",
"proc-macro2",
"quote",
"serde",
"syn 2.0.89",
]
[[package]]
name = "askama_escape"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341"
[[package]]
name = "askama_parser"
version = "0.2.1"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0"
dependencies = [
"nom",
]
[[package]]
name = "askama_parser"
version = "0.3.5"
source = "git+https://github.com/askama-rs/askama?rev=70531eb#70531eb827fe940435d1d7b75684e889a9637031"
checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
dependencies = [
"memchr",
"serde",
@ -242,11 +190,11 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "axum"
version = "0.8.1"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8"
checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5"
dependencies = [
"axum-core 0.5.0",
"axum-core",
"axum-macros",
"bytes",
"form_urlencoded",
@ -269,7 +217,7 @@ dependencies = [
"serde_urlencoded",
"sync_wrapper 1.0.1",
"tokio",
"tower 0.5.2",
"tower",
"tower-layer",
"tower-service",
"tracing",
@ -277,32 +225,12 @@ dependencies = [
[[package]]
name = "axum-core"
version = "0.4.5"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 1.3.1",
"http-body 1.0.1",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper 1.0.1",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-core"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733"
checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6"
dependencies = [
"bytes",
"futures-util",
"futures-core",
"http 1.3.1",
"http-body 1.0.1",
"http-body-util",
@ -437,16 +365,18 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"serde",
"wasm-bindgen",
"windows-targets 0.52.6",
]
[[package]]
name = "clap"
version = "4.5.32"
version = "4.5.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
dependencies = [
"clap_builder",
"clap_derive",
@ -454,9 +384,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.32"
version = "4.5.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
dependencies = [
"anstream",
"anstyle",
@ -608,9 +538,9 @@ dependencies = [
[[package]]
name = "deranged"
version = "0.3.11"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
dependencies = [
"powerfmt",
"serde",
@ -627,12 +557,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "doc-comment"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "downcast"
version = "0.11.0"
@ -894,8 +818,7 @@ name = "gitvote"
version = "1.4.0"
dependencies = [
"anyhow",
"askama 0.3.5",
"askama_axum",
"askama",
"async-channel",
"async-trait",
"axum",
@ -906,20 +829,19 @@ dependencies = [
"graphql_client",
"hex",
"hmac",
"http 0.2.12",
"http 1.3.1",
"http-body 1.0.1",
"humantime",
"humantime-serde",
"hyper 1.6.0",
"ignore",
"jsonwebtoken",
"lazy_static",
"mockall",
"octocrab",
"openssl",
"postgres-openssl",
"regex",
"reqwest 0.12.14",
"reqwest 0.12.15",
"serde",
"serde_json",
"serde_yaml",
@ -929,8 +851,8 @@ dependencies = [
"tokio",
"tokio-postgres",
"tokio-util",
"tower 0.5.2",
"tower-http 0.6.2",
"tower",
"tower-http",
"tracing",
"tracing-subscriber",
"uuid",
@ -1052,6 +974,12 @@ version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
[[package]]
name = "heck"
version = "0.4.1"
@ -1141,12 +1069,6 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "http-range-header"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f"
[[package]]
name = "httparse"
version = "1.10.1"
@ -1159,15 +1081,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "humansize"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
dependencies = [
"libm",
]
[[package]]
name = "humantime"
version = "2.2.0"
@ -1229,22 +1142,6 @@ dependencies = [
"want",
]
[[package]]
name = "hyper-rustls"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [
"futures-util",
"http 0.2.12",
"hyper 0.14.28",
"log",
"rustls 0.21.12",
"rustls-native-certs",
"tokio",
"tokio-rustls 0.24.1",
]
[[package]]
name = "hyper-rustls"
version = "0.27.2"
@ -1255,23 +1152,26 @@ dependencies = [
"http 1.3.1",
"hyper 1.6.0",
"hyper-util",
"rustls 0.23.10",
"log",
"rustls",
"rustls-native-certs",
"rustls-pki-types",
"tokio",
"tokio-rustls 0.26.0",
"tokio-rustls",
"tower-service",
]
[[package]]
name = "hyper-timeout"
version = "0.4.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
dependencies = [
"hyper 0.14.28",
"hyper 1.6.0",
"hyper-util",
"pin-project-lite",
"tokio",
"tokio-io-timeout",
"tower-service",
]
[[package]]
@ -1378,7 +1278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
dependencies = [
"equivalent",
"hashbrown",
"hashbrown 0.14.5",
]
[[package]]
@ -1452,12 +1352,6 @@ version = "0.2.171"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
[[package]]
name = "libm"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]]
name = "linux-raw-sys"
version = "0.4.13"
@ -1517,22 +1411,6 @@ version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "mime_guess"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef"
dependencies = [
"mime",
"unicase",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.7.2"
@ -1598,16 +1476,6 @@ dependencies = [
"tempfile",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
@ -1673,24 +1541,26 @@ dependencies = [
[[package]]
name = "octocrab"
version = "0.33.3"
version = "0.44.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "054a8bf47dfa8f89bb0dcf17e485e9f49f2586c05bf0aa67b8ec5a9e7bc8dfd5"
checksum = "86996964f8b721067b6ed238aa0ccee56ecad6ee5e714468aa567992d05d2b91"
dependencies = [
"arc-swap",
"async-trait",
"base64 0.21.7",
"base64 0.22.1",
"bytes",
"cfg-if",
"chrono",
"either",
"futures",
"futures-util",
"http 0.2.12",
"http-body 0.4.6",
"hyper 0.14.28",
"hyper-rustls 0.24.2",
"http 1.3.1",
"http-body 1.0.1",
"http-body-util",
"hyper 1.6.0",
"hyper-rustls",
"hyper-timeout",
"hyper-util",
"jsonwebtoken",
"once_cell",
"percent-encoding",
@ -1702,10 +1572,11 @@ dependencies = [
"serde_urlencoded",
"snafu",
"tokio",
"tower 0.4.13",
"tower-http 0.4.4",
"tower",
"tower-http",
"tracing",
"url",
"web-time",
]
[[package]]
@ -1716,9 +1587,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "openssl"
version = "0.10.71"
version = "0.10.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd"
checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da"
dependencies = [
"bitflags 2.5.0",
"cfg-if",
@ -1757,9 +1628,9 @@ dependencies = [
[[package]]
name = "openssl-sys"
version = "0.9.106"
version = "0.9.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847"
dependencies = [
"cc",
"libc",
@ -2146,9 +2017,9 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.12.14"
version = "0.12.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254"
checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb"
dependencies = [
"base64 0.22.1",
"bytes",
@ -2160,7 +2031,7 @@ dependencies = [
"http-body 1.0.1",
"http-body-util",
"hyper 1.6.0",
"hyper-rustls 0.27.2",
"hyper-rustls",
"hyper-tls 0.6.0",
"hyper-util",
"ipnet",
@ -2179,7 +2050,7 @@ dependencies = [
"system-configuration 0.6.1",
"tokio",
"tokio-native-tls",
"tower 0.5.2",
"tower",
"tower-service",
"url",
"wasm-bindgen",
@ -2228,39 +2099,30 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "rustls"
version = "0.21.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e"
dependencies = [
"log",
"ring",
"rustls-webpki 0.101.7",
"sct",
]
[[package]]
name = "rustls"
version = "0.23.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402"
dependencies = [
"log",
"once_cell",
"ring",
"rustls-pki-types",
"rustls-webpki 0.102.4",
"rustls-webpki",
"subtle",
"zeroize",
]
[[package]]
name = "rustls-native-certs"
version = "0.6.3"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5"
dependencies = [
"openssl-probe",
"rustls-pemfile 1.0.4",
"rustls-pemfile 2.1.2",
"rustls-pki-types",
"schannel",
"security-framework",
]
@ -2290,16 +2152,6 @@ version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d"
[[package]]
name = "rustls-webpki"
version = "0.101.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
dependencies = [
"ring",
"untrusted",
]
[[package]]
name = "rustls-webpki"
version = "0.102.4"
@ -2347,21 +2199,11 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "sct"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
dependencies = [
"ring",
"untrusted",
]
[[package]]
name = "secrecy"
version = "0.8.0"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e"
checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a"
dependencies = [
"zeroize",
]
@ -2458,9 +2300,9 @@ dependencies = [
[[package]]
name = "sha2"
version = "0.10.8"
version = "0.10.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
dependencies = [
"cfg-if",
"cpufeatures",
@ -2520,25 +2362,23 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "snafu"
version = "0.7.5"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6"
checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019"
dependencies = [
"backtrace",
"doc-comment",
"snafu-derive",
]
[[package]]
name = "snafu-derive"
version = "0.7.5"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf"
checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917"
dependencies = [
"heck 0.4.1",
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.89",
]
[[package]]
@ -2729,9 +2569,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.39"
version = "0.3.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
dependencies = [
"deranged",
"itoa",
@ -2744,15 +2584,15 @@ dependencies = [
[[package]]
name = "time-core"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
[[package]]
name = "time-macros"
version = "0.2.20"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c"
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
dependencies = [
"num-conv",
"time-core",
@ -2775,9 +2615,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.44.1"
version = "1.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165"
dependencies = [
"backtrace",
"bytes",
@ -2790,16 +2630,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "tokio-io-timeout"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf"
dependencies = [
"pin-project-lite",
"tokio",
]
[[package]]
name = "tokio-macros"
version = "2.5.0"
@ -2859,59 +2689,32 @@ dependencies = [
"whoami",
]
[[package]]
name = "tokio-rustls"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
"rustls 0.21.12",
"tokio",
]
[[package]]
name = "tokio-rustls"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
dependencies = [
"rustls 0.23.10",
"rustls",
"rustls-pki-types",
"tokio",
]
[[package]]
name = "tokio-util"
version = "0.7.14"
version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034"
checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df"
dependencies = [
"bytes",
"futures-core",
"futures-sink",
"futures-util",
"hashbrown",
"hashbrown 0.15.3",
"pin-project-lite",
"tokio",
]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"pin-project",
"pin-project-lite",
"tokio",
"tokio-util",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower"
version = "0.5.2"
@ -2923,6 +2726,7 @@ dependencies = [
"pin-project-lite",
"sync_wrapper 1.0.1",
"tokio",
"tokio-util",
"tower-layer",
"tower-service",
"tracing",
@ -2930,36 +2734,18 @@ dependencies = [
[[package]]
name = "tower-http"
version = "0.4.4"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140"
checksum = "a1cfca9ae570b2a6efc764a88e914c29b3dfaa1fafe5f495812ae97ec9bc4d53"
dependencies = [
"bitflags 2.5.0",
"bytes",
"futures-core",
"futures-util",
"http 0.2.12",
"http-body 0.4.6",
"http-range-header",
"iri-string",
"pin-project-lite",
"tower 0.4.13",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower-http"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697"
dependencies = [
"bitflags 2.5.0",
"bytes",
"http 1.3.1",
"http-body 1.0.1",
"iri-string",
"pin-project-lite",
"tower",
"tower-layer",
"tower-service",
"tracing",
@ -3073,15 +2859,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "unicase"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
dependencies = [
"version_check",
]
[[package]]
name = "unicode-bidi"
version = "0.3.15"
@ -3296,6 +3073,17 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "web-time"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
dependencies = [
"js-sys",
"serde",
"wasm-bindgen",
]
[[package]]
name = "whoami"
version = "1.5.1"

View File

@ -4,40 +4,38 @@ description = "GitVote server"
version = "1.4.0"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.85"
rust-version = "1.86"
[dependencies]
anyhow = "1.0.97"
askama = { git = "https://github.com/askama-rs/askama", rev = "70531eb", features = ["serde_json"] }
askama_axum = "0.4.0"
anyhow = "1.0.98"
askama = { version = "0.14.0", features = ["serde_json"] }
async-channel = "2.3.1"
async-trait = "0.1.88"
axum = { version = "0.8.1", features = ["macros"] }
clap = { version = "4.5.32", features = ["derive"] }
axum = { version = "0.8.4", features = ["macros"] }
clap = { version = "4.5.37", features = ["derive"] }
deadpool-postgres = { version = "0.14.1", features = ["serde"] }
figment = { version = "0.10.19", features = ["yaml", "env"] }
futures = "0.3.31"
graphql_client = { version = "0.14.0", features = ["reqwest"] }
hex = "0.4.3"
hmac = "0.12.1"
http = "0.2.12"
http = "1.3.1"
humantime = "2.2.0"
humantime-serde = "1.1.1"
ignore = "0.4.23"
jsonwebtoken = "9.3.1"
lazy_static = "1.5.0"
octocrab = "=0.33.3"
openssl = { version = "0.10.71", features = ["vendored"] }
octocrab = "0.44.1"
openssl = { version = "0.10.72", features = ["vendored"] }
postgres-openssl = "0.5.1"
regex = "1.11.1"
reqwest = "0.12.14"
reqwest = "0.12.15"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
serde_yaml = "0.9.34"
sha2 = "0.10.8"
sha2 = "0.10.9"
thiserror = "2.0.12"
time = { version = "0.3.39", features = ["serde"] }
tokio = { version = "1.44.1", features = [
time = { version = "0.3.41", features = ["serde"] }
tokio = { version = "1.45.0", features = [
"macros",
"rt-multi-thread",
"signal",
@ -48,9 +46,9 @@ tokio-postgres = { version = "0.7.13", features = [
"with-serde_json-1",
"with-time-0_3",
] }
tokio-util = { version = "0.7.14", features = ["rt"] }
tokio-util = { version = "0.7.15", features = ["rt"] }
tower = { version = "0.5.2", features = ["util"] }
tower-http = { version = "0.6.2", features = ["trace"] }
tower-http = { version = "0.6.3", features = ["trace"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "json"] }
uuid = { version = "1.16.0", features = ["serde", "v4"] }

View File

@ -1,5 +1,5 @@
# Build tern
FROM golang:1.24.1-alpine3.21 AS tern
FROM golang:1.24.3-alpine3.21 AS tern
RUN apk --no-cache add git
RUN go install github.com/jackc/tern@latest

View File

@ -2,9 +2,9 @@
//! GitHub events.
use anyhow::Result;
use lazy_static::lazy_static;
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::sync::LazyLock;
use tracing::error;
use crate::{
@ -19,11 +19,10 @@ const CMD_CREATE_VOTE: &str = "vote";
const CMD_CANCEL_VOTE: &str = "cancel-vote";
const CMD_CHECK_VOTE: &str = "check-vote";
lazy_static! {
/// Regex used to detect commands in issues/prs comments.
static ref CMD: Regex = Regex::new(r"(?m)^/(vote|cancel-vote|check-vote)-?([a-zA-Z0-9]*)\s*$")
.expect("invalid CMD regexp");
}
/// Regex used to detect commands in issues/prs comments.
static CMD: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"(?m)^/(vote|cancel-vote|check-vote)-?([a-zA-Z0-9]*)\s*$").expect("invalid CMD regexp")
});
/// Represents a command to be executed, usually created from a GitHub event.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]

View File

@ -191,7 +191,7 @@ impl GH for GHApi {
issue_number: i64,
labels: &[&str],
) -> Result<()> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let labels = labels.iter().map(ToString::to_string).collect::<Vec<String>>();
client.issues(owner, repo).add_labels(issue_number as u64, &labels).await?;
Ok(())
@ -206,7 +206,7 @@ impl GH for GHApi {
issue_number: i64,
check_details: &CheckDetails,
) -> Result<()> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let pr = client.pulls(owner, repo).get(issue_number as u64).await?;
let url = format!("{GITHUB_API_URL}/repos/{owner}/{repo}/check-runs");
let mut body = json!({
@ -220,7 +220,7 @@ impl GH for GHApi {
});
if let Some(conclusion) = &check_details.conclusion {
body["conclusion"] = json!(conclusion);
};
}
let _: Value = client.post(url, Some(&body)).await?;
Ok(())
}
@ -235,7 +235,7 @@ impl GH for GHApi {
title: &str,
body: &str,
) -> Result<()> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
// Fetch some repository details needed to create a discussion
let response: graphql_client::Response<announcement_repo_query::ResponseData> = client
@ -326,7 +326,7 @@ impl GH for GHApi {
/// [GH::get_collaborators]
async fn get_collaborators(&self, inst_id: u64, owner: &str, repo: &str) -> Result<Vec<UserName>> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let url = format!("{GITHUB_API_URL}/repos/{owner}/{repo}/collaborators");
let first_page: Page<User> = client.get(url, None::<&()>).await?;
let collaborators = client.all_pages(first_page).await?.into_iter().map(|u| u.login).collect();
@ -341,7 +341,7 @@ impl GH for GHApi {
repo: &str,
comment_id: i64,
) -> Result<Vec<Reaction>> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let url = format!("{GITHUB_API_URL}/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",);
let first_page: Page<Reaction> = client.get(url, None::<&()>).await?;
let reactions = client.all_pages(first_page).await?;
@ -350,20 +350,19 @@ impl GH for GHApi {
/// [GH::get_config_file]
async fn get_config_file(&self, inst_id: u64, owner: &str, repo: &str) -> Option<String> {
let client = self.app_client.installation(InstallationId(inst_id));
let Ok(client) = self.app_client.installation(InstallationId(inst_id)) else {
return None;
};
// Try to get the config file from the repository. Otherwise try
// getting the organization wide config file in the .github repo.
let mut content: Option<String> = None;
for repo in &[repo, ORG_CONFIG_REPO] {
match client.repos(owner, *repo).get_content().path(CONFIG_FILE).send().await {
Ok(resp) => {
if resp.items.len() == 1 {
content = resp.items[0].decoded_content();
break;
}
if let Ok(resp) = client.repos(owner, *repo).get_content().path(CONFIG_FILE).send().await {
if resp.items.len() == 1 {
content = resp.items[0].decoded_content();
break;
}
Err(_) => continue,
}
}
@ -372,7 +371,7 @@ impl GH for GHApi {
/// [GH::get_pr_files]
async fn get_pr_files(&self, inst_id: u64, owner: &str, repo: &str, pr_number: i64) -> Result<Vec<File>> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let url = format!("{GITHUB_API_URL}/repos/{owner}/{repo}/pulls/{pr_number}/files");
let first_page: Page<File> = client.get(url, None::<&()>).await?;
let files: Vec<File> = client.all_pages(first_page).await?;
@ -387,7 +386,7 @@ impl GH for GHApi {
team: &str,
exclude_maintainers: bool,
) -> Result<Vec<UserName>> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let url = format!("{GITHUB_API_URL}/orgs/{org}/teams/{team}/members");
let first_page: Page<User> = client
.get(
@ -404,7 +403,7 @@ impl GH for GHApi {
/// [GH::is_check_required]
async fn is_check_required(&self, inst_id: u64, owner: &str, repo: &str, branch: &str) -> Result<bool> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let url = format!("{GITHUB_API_URL}/repos/{owner}/{repo}/branches/{branch}");
let branch: Branch = client.get(url, None::<&()>).await?;
let is_check_required = if let Some(required_checks) =
@ -426,7 +425,7 @@ impl GH for GHApi {
issue_number: i64,
body: &str,
) -> Result<i64> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let comment = client.issues(owner, repo).create_comment(issue_number as u64, body).await?;
Ok(comment.id.0 as i64)
}
@ -440,14 +439,14 @@ impl GH for GHApi {
issue_number: i64,
label: &str,
) -> Result<()> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
client.issues(owner, repo).remove_label(issue_number as u64, label).await?;
Ok(())
}
/// [GH::user_is_collaborator]
async fn user_is_collaborator(&self, inst_id: u64, owner: &str, repo: &str, user: &str) -> Result<bool> {
let client = self.app_client.installation(InstallationId(inst_id));
let client = self.app_client.installation(InstallationId(inst_id))?;
let url = format!("{GITHUB_API_URL}/repos/{owner}/{repo}/collaborators/{user}",);
let resp = client._get(url).await?;
if resp.status() == StatusCode::NO_CONTENT {

View File

@ -97,7 +97,7 @@ async fn event(
.is_err()
{
return Err((StatusCode::BAD_REQUEST, "no valid signature found".to_string()));
};
}
// Parse event
let event = match Event::try_from((headers.get(GITHUB_EVENT_HEADER), &body[..])) {
@ -127,7 +127,7 @@ async fn event(
})?;
}
}
};
}
Ok("no command detected")
}
@ -196,7 +196,7 @@ async fn set_check_status(db: DynDB, gh: DynGH, event: &PullRequestEvent) -> Res
gh.create_check_run(inst_id, owner, repo, pr, &check_details).await?;
}
PullRequestEventAction::Other => {}
};
}
Ok(())
}

View File

@ -55,7 +55,7 @@ async fn main() -> Result<()> {
match cfg.log.format {
LogFormat::Json => ts.json().init(),
LogFormat::Pretty => ts.init(),
};
}
// Setup database
let mut builder = SslConnector::builder(SslMethod::tls())?;

View File

@ -216,6 +216,7 @@ mod filters {
#[allow(clippy::trivially_copy_pass_by_ref, clippy::unnecessary_wraps)]
pub(crate) fn non_binding(
votes: &HashMap<UserName, UserVote>,
_: &dyn askama::Values,
max: &i64,
) -> askama::Result<Vec<(UserName, UserVote)>> {
let mut non_binding_votes: Vec<(UserName, UserVote)> =