From b2699a460102da62d8ea910b8c610b2d6778a495 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 30 May 2025 11:51:13 +0200 Subject: [PATCH 1/7] Disable excessive rebase for Renovate --- .renovaterc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.renovaterc b/.renovaterc index b36f3b4..9918a21 100644 --- a/.renovaterc +++ b/.renovaterc @@ -3,8 +3,7 @@ "extends": [ "config:recommended", ":combinePatchMinorReleases", - ":enableVulnerabilityAlerts", - ":rebaseStalePrs" + ":enableVulnerabilityAlerts" ], "prConcurrentLimit": 10, "branchPrefix": "renovate/" From f07d09572f2ec9794f39ccf8670830fa477edff7 Mon Sep 17 00:00:00 2001 From: Renovate Date: Fri, 30 May 2025 16:46:26 +0000 Subject: [PATCH 2/7] Update Rust crate color-eyre to v0.6.5 --- Cargo.lock | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1712a13..989668a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -170,27 +170,27 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "color-eyre" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e1761c0e16f8883bbbb8ce5990867f4f06bf11a0253da6495a04ce4b6ef0ec" +checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" dependencies = [ "backtrace", "color-spantrace", "eyre", "indenter", "once_cell", - "owo-colors 4.2.0", + "owo-colors", "tracing-error", ] [[package]] name = "color-spantrace" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" +checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" dependencies = [ "once_cell", - "owo-colors 3.5.0", + "owo-colors", "tracing-core", "tracing-error", ] @@ -689,12 +689,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - [[package]] name = "owo-colors" version = "4.2.0" From 183394831cf4c22f0c7df162da8510f6ead1cea7 Mon Sep 17 00:00:00 2001 From: Renovate Date: Mon, 2 Jun 2025 12:16:32 +0000 Subject: [PATCH 3/7] Update Rust crate reqwest to v0.12.19 --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1712a13..a7363b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -950,9 +950,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.12.18" +version = "0.12.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff6b0dbbe4d5a37318f433d4fc82babd21631f194d370409ceb2e40b2f0b5" +checksum = "a2f8e5513d63f2e5b386eb5106dc67eaf3f84e95258e210489136b8b92ad6119" dependencies = [ "base64", "bytes", @@ -1350,9 +1350,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdb0c213ca27a9f57ab69ddb290fd80d970922355b83ae380b395d3986b8a2e" +checksum = "5cc2d9e086a412a451384326f521c8123a99a466b329941a9403696bff9b0da2" dependencies = [ "bitflags", "bytes", From 09abc20574dae2a557f1704324c77e15afc66675 Mon Sep 17 00:00:00 2001 From: Renovate Date: Tue, 10 Jun 2025 19:01:42 +0000 Subject: [PATCH 4/7] Update Rust crate reqwest to v0.12.20 --- Cargo.lock | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20c40d2..5a4eaac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -944,9 +944,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.12.19" +version = "0.12.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f8e5513d63f2e5b386eb5106dc67eaf3f84e95258e210489136b8b92ad6119" +checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813" dependencies = [ "base64", "bytes", @@ -957,11 +957,8 @@ dependencies = [ "hyper", "hyper-rustls", "hyper-util", - "ipnet", "js-sys", "log", - "mime", - "once_cell", "percent-encoding", "pin-project-lite", "quinn", From c73f26bd67c72af9da402175ab0ad0885c85cdef Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 20 Jun 2025 20:34:26 +0200 Subject: [PATCH 5/7] Fix compiler issues Apparently some changes in mlua that weren't caught during the update. --- src/types.rs | 8 ++++---- src/worker/lua.rs | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/types.rs b/src/types.rs index 82002f0..2d52ab0 100644 --- a/src/types.rs +++ b/src/types.rs @@ -4,14 +4,14 @@ use mlua::IntoLua; use serde::{Deserialize, Serialize}; /// Converts a `serde_json::Value` to a `mlua::Value`. -fn json_to_lua(value: serde_json::Value, lua: &mlua::Lua) -> mlua::Result> { +fn json_to_lua(value: serde_json::Value, lua: &mlua::Lua) -> mlua::Result { match value { serde_json::Value::Null => Ok(mlua::Value::Nil), serde_json::Value::Bool(value) => Ok(mlua::Value::Boolean(value)), serde_json::Value::Number(value) => match value.as_f64() { Some(number) => Ok(mlua::Value::Number(number)), None => Err(mlua::Error::ToLuaConversionError { - from: "serde_json::Value::Number", + from: String::from("serde_json::Value::Number"), to: "Number", message: Some("Number cannot be represented by a floating-point type".into()), }), @@ -52,8 +52,8 @@ pub(crate) struct ApiEvent { pub status: u16, } -impl<'lua> IntoLua<'lua> for ApiEvent { - fn into_lua(self, lua: &'lua mlua::Lua) -> mlua::Result> { +impl IntoLua for ApiEvent { + fn into_lua(self, lua: &mlua::Lua) -> mlua::Result { let headers = lua.create_table_with_capacity(0, self.headers.len())?; for (k, v) in self.headers { let k = lua.create_string(k)?; diff --git a/src/worker/lua.rs b/src/worker/lua.rs index 6ef1ad7..669c4ee 100644 --- a/src/worker/lua.rs +++ b/src/worker/lua.rs @@ -1,6 +1,6 @@ use std::sync::mpsc::Receiver; -use color_eyre::Result; +use color_eyre::{eyre, Result}; use mlua::{Function, IntoLua as _, Lua, LuaSerdeExt}; use tokio::sync::mpsc::UnboundedSender; @@ -96,23 +96,23 @@ pub fn worker( Event::Webhook(data) => { tracing::trace!(id = data.topic, "Received webhook event"); let data = lua.to_value(&data)?; - event_fn.call::<_, ()>(("webhook", data))? + event_fn.call(("webhook", data))? } Event::Api(data) => { tracing::trace!(id = data.id, status = data.status, "Received api event"); let data = data.into_lua(&lua)?; - event_fn.call::<_, ()>(("api", data))? + event_fn.call(("api", data))? } Event::Error(data) => { tracing::trace!(id = data.id, message = data.message, "Received error event"); let data = lua.to_value(&data)?; - event_fn.call::<_, ()>(("error", data))? + event_fn.call(("error", data))? } } } Ok(()) - })?; + }).map_err(|e| eyre::eyre!("{:?}", e))?; Ok(()) } From 2f5754a9eb19a25aace89c27cc65873665fe27e8 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 20 Jun 2025 20:35:03 +0200 Subject: [PATCH 6/7] Add CI workflow --- .forgejo/workflows/check.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .forgejo/workflows/check.yaml diff --git a/.forgejo/workflows/check.yaml b/.forgejo/workflows/check.yaml new file mode 100644 index 0000000..94555bc --- /dev/null +++ b/.forgejo/workflows/check.yaml @@ -0,0 +1,27 @@ +name: check + +on: + push: + branches: [master] + pull_request_target: + +jobs: + build: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://github.com/actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 + - name: clippy + run: cargo build + + check: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://github.com/actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 + with: + components: clippy, rustfmt + - name: clippy + run: cargo clippy -- -D warnings + - name: rustfmt + run: cargo fmt --all -- --check From e58cb628c0c48382b424cb37e0a425fd731e7016 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 20 Jun 2025 20:38:23 +0200 Subject: [PATCH 7/7] Fix CI step names --- .forgejo/workflows/check.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/check.yaml b/.forgejo/workflows/check.yaml index 94555bc..5f2176a 100644 --- a/.forgejo/workflows/check.yaml +++ b/.forgejo/workflows/check.yaml @@ -11,7 +11,7 @@ jobs: steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://github.com/actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 - - name: clippy + - name: Build run: cargo build check: @@ -21,7 +21,7 @@ jobs: - uses: https://github.com/actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 with: components: clippy, rustfmt - - name: clippy + - name: Run clippy run: cargo clippy -- -D warnings - - name: rustfmt + - name: Run rustfmt run: cargo fmt --all -- --check