From 0ee50e85134c5a658fe500c59bc68bbc27503d34 Mon Sep 17 00:00:00 2001 From: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> Date: Sun, 11 Oct 2026 17:59:03 -0400 Subject: [PATCH 1/6] Remove unused parameter Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> --- workers/webhooks/src/queue/handlers/github.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/workers/webhooks/src/queue/handlers/github.ts b/workers/webhooks/src/queue/handlers/github.ts index e2bf13b..3ee7b46 100644 --- a/workers/webhooks/src/queue/handlers/github.ts +++ b/workers/webhooks/src/queue/handlers/github.ts @@ -13,7 +13,6 @@ import { type GithubWebhookEvent, GithubWebhookEventName } from "../../types/git const handleGithubWebhooks: MappedQueueMessageBatchHandler<"github-webhook-queue", QueueBodyMap, Env> = async ( messages, env, - _executionContext, ) => { const components: APIMessageTopLevelComponent[] = []; const promises = await Promise.allSettled( @@ -84,7 +83,7 @@ const handleGithubWebhooks: MappedQueueMessageBatchHandler<"github-webhook-queue return { body: { format: "webhook", - webhookId: "", + webhookId: env.GITHUB_WEBHOOK_ID, body, }, }; From 8ff1a48077c0a2561d251eab9ab46d1dfbb0aa47 Mon Sep 17 00:00:00 2001 From: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:00:05 -0400 Subject: [PATCH 2/6] Properly acknowledge discord queue messages Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> --- workers/discord/src/index.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/workers/discord/src/index.ts b/workers/discord/src/index.ts index 070a765..08f95fa 100644 --- a/workers/discord/src/index.ts +++ b/workers/discord/src/index.ts @@ -11,28 +11,29 @@ export default { const webhookTokenMap = new Map(); const drizzle = getDrizzle(env.DB); - for (const { body } of batch.messages) { - switch (body.format) { + for (const message of batch.messages) { + switch (message.body.format) { case "message": { - let rest = restMap.get(body.applicationId); + let rest = restMap.get(message.body.applicationId); if (typeof rest === "undefined") { // oxlint-disable-next-line no-await-in-loop -- Must be in order const app = await drizzle.query.apps.findFirst({ where: { id: { - eq: body.applicationId, + eq: message.body.applicationId, }, }, }); if (typeof app === "undefined") { - throw new TypeError(`Unexpected application ID ${body.applicationId}`); + throw new TypeError(`Unexpected application ID ${message.body.applicationId}`); } rest = new REST({ version: APIVersion }); rest.setToken(app.token); - restMap.set(body.applicationId, rest); + restMap.set(message.body.applicationId, rest); } // oxlint-disable-next-line no-await-in-loop -- Must be in order - await sendMessage(rest, body); + await sendMessage(rest, message.body); + message.ack(); break; } case "webhook": { @@ -41,24 +42,25 @@ export default { rest = new REST({ version: APIVersion }); restMap.set("webhook", rest); } - let webhookToken = webhookTokenMap.get(body.webhookId); + let webhookToken = webhookTokenMap.get(message.body.webhookId); if (typeof webhookToken === "undefined") { // oxlint-disable-next-line no-await-in-loop -- Must be in order const webhook = await drizzle.query.webhooks.findFirst({ where: { id: { - eq: body.webhookId, + eq: message.body.webhookId, }, }, }); if (typeof webhook === "undefined") { - throw new TypeError(`Unexpected Webhook ID ${body.webhookId}`); + throw new TypeError(`Unexpected Webhook ID ${message.body.webhookId}`); } webhookToken = webhook.token; - webhookTokenMap.set(body.webhookId, webhook.token); + webhookTokenMap.set(message.body.webhookId, webhook.token); } // oxlint-disable-next-line no-await-in-loop -- Must be in order - await executeWebhook(rest, body, webhookToken); + await executeWebhook(rest, message.body, webhookToken); + message.ack(); } } } From 9c7328a696d8973bddeb23f3d023a5dfe9828cf7 Mon Sep 17 00:00:00 2001 From: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:19:14 -0400 Subject: [PATCH 3/6] Add a previews block Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> --- workers/webhooks/wrangler.jsonc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/workers/webhooks/wrangler.jsonc b/workers/webhooks/wrangler.jsonc index efe7da6..17026f5 100644 --- a/workers/webhooks/wrangler.jsonc +++ b/workers/webhooks/wrangler.jsonc @@ -42,4 +42,36 @@ }, ], }, + "previews": { + "r2_buckets": [ + { + "binding": "GITHUB_BUCKET", + "bucket_name": "github-webhook-deliveries-preview", + }, + ], + "queues": { + "consumers": [ + { + "queue": "preview-github-webhook-queue", + "max_batch_size": 10, + "max_batch_timeout": 60, + "dead_letter_queue": "preview-dead-letters", + }, + ], + "producers": [ + { + "binding": "DISCORD_QUEUE", + "queue": "preview-discord-message-queue", + }, + { + "binding": "GITHUB_QUEUE", + "queue": "preview-github-webhook-queue", + }, + { + "binding": "DEAD_LETTER_QUEUE", + "queue": "preview-dead-letters", + }, + ], + }, + }, } From 753e6ac42a3b3d3f7ab5c3de3abf5b864e75266b Mon Sep 17 00:00:00 2001 From: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:22:02 -0400 Subject: [PATCH 4/6] Add previews for root worker Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> --- workers/workers-bachman-dev/wrangler.jsonc | 1 + 1 file changed, 1 insertion(+) diff --git a/workers/workers-bachman-dev/wrangler.jsonc b/workers/workers-bachman-dev/wrangler.jsonc index 79591e8..8f86321 100644 --- a/workers/workers-bachman-dev/wrangler.jsonc +++ b/workers/workers-bachman-dev/wrangler.jsonc @@ -11,4 +11,5 @@ "assets": { "directory": "./public", }, + "previews": {}, } From 97f682de99543831e5ac24696ed1c5d9e719947d Mon Sep 17 00:00:00 2001 From: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:25:28 -0400 Subject: [PATCH 5/6] Use devEngines Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> --- .nvmrc | 1 - mise.toml | 2 +- package.json | 13 ++++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) delete mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 7baf24b..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -24.21.0 \ No newline at end of file diff --git a/mise.toml b/mise.toml index 157c156..6a7e1ac 100644 --- a/mise.toml +++ b/mise.toml @@ -1,2 +1,2 @@ [settings] -idiomatic_version_file_enable_tools = ["node"] +idiomatic_version_file_enable_tools = ["node", "pnpm"] diff --git a/package.json b/package.json index 533eac9..0457f9b 100644 --- a/package.json +++ b/package.json @@ -22,5 +22,16 @@ "typescript": "7.0.2", "wrangler": "4.146.0" }, - "packageManager": "pnpm@12.8.2+sha512.a5941679663d952c5f0ecc38ba98af98b4dc01b95780354f6894f2f873973cef2f7e2989d7db3ee5393938ae21f62fe06bcdf685d475ddad829a62095d2b8b11" + "devEngines": { + "packageManager": { + "name": "pnpm", + "version": "12.8.2", + "onFail": "download" + }, + "runtime": { + "name": "node", + "version": "^24.21.0", + "onFail": "download" + } + } } From 2b4503a451f27e5c705b090f9d9ad3a053b3a871 Mon Sep 17 00:00:00 2001 From: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:26:31 -0400 Subject: [PATCH 6/6] lockfile Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com> --- pnpm-lock.yaml | 137 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e587de..7ef6792 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -169,6 +169,9 @@ importers: '@bachman-dev/oxc-config': specifier: 0.3.0 version: 0.3.0(oxfmt@0.71.0)(oxlint@1.86.0(oxlint-tsgolint@7.0.2003)) + node: + specifier: runtime:^24.21.0 + version: runtime:24.21.0 oxfmt: specifier: 0.71.0 version: 0.71.0 @@ -1770,6 +1773,138 @@ packages: resolution: {integrity: sha512-GaimS5mSIOMyvd16ga+e1/QkI8cmp3z35QPHFex0DktqNQf2RVZQwMPQXdyoUreUiFP/0Gpe2MoQInTyMAD5xA==} engines: {node: '>=22.0.0'} + node@runtime:24.21.0: + resolution: + type: variations + variants: + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-rseyRkr7mfB4wZywbSAdVDvTsxHLoHEoK84bF8l+WLs= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-aix-ppc64.tar.gz + targets: + - cpu: ppc64 + os: aix + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-vtfupTJeEQjzLOUijd1qXw8IpJnuQqp0Qq6lg3AvYFc= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-darwin-arm64.tar.gz + targets: + - cpu: arm64 + os: darwin + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-FGLLOzBGuBXPjqQ209pFDsGp8R2sflpGsK2lMF1+gJc= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-darwin-x64.tar.gz + targets: + - cpu: x64 + os: darwin + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-ckKCw7Q67JmKqVJzgEZbRdIp4CG1gDX19PYwleq/5dU= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-arm64.tar.gz + targets: + - cpu: arm64 + os: linux + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-UcXVMGbukpILYXg7A7Buy5nzZhFg97Fcp36EdBFaZ7w= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-ppc64le.tar.gz + targets: + - cpu: ppc64le + os: linux + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-Xy+jdCLgx13jXBaG/lHXgyTywqj+LMI5pB2cAAop2Tg= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-s390x.tar.gz + targets: + - cpu: s390x + os: linux + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-PWNAX8ZaDS0pdsHwvC/Se7C9ByEkaecFqsPwOuWrTJw= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-x64-musl.tar.gz + targets: + - cpu: x64 + os: linux + libc: musl + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-bh24fvWLiBnl1UAu/xU2SRsY7djre+5e94l4duiNxf8= + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-x64.tar.gz + targets: + - cpu: x64 + os: linux + - resolution: + archive: zip + bin: + node: node.exe + integrity: sha256-h3mxveHTn41CDjtXqmV7OYka9DTT3kSpGQRM7AZ4WSE= + prefix: node-v24.21.0-win-arm64 + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-win-arm64.zip + targets: + - cpu: arm64 + os: win32 + - resolution: + archive: zip + bin: + node: node.exe + integrity: sha256-FY92hbRN5R9sDfHRU1JsvNPhvHOajfxgdyHO913p5UE= + prefix: node-v24.21.0-win-x64 + type: binary + url: https://nodejs.org/download/release/v24.21.0/node-v24.21.0-win-x64.zip + targets: + - cpu: x64 + os: win32 + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-MEiwgR4VjKDYZytZyDmGF2PhREkpgNjSmzad/uRXR+Q= + type: binary + url: https://unofficial-builds.nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-arm64-musl.tar.gz + targets: + - cpu: arm64 + os: linux + libc: musl + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-AacT402pjntNKjGR7nyj+T3QOE0aLvI8N5shYe5uEzo= + type: binary + url: https://unofficial-builds.nodejs.org/download/release/v24.21.0/node-v24.21.0-linux-x64-musl.tar.gz + targets: + - cpu: x64 + os: linux + libc: musl + version: 24.21.0 + hasBin: true + obug@2.2.1: resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} engines: {node: '>=12.20.0'} @@ -2823,6 +2958,8 @@ snapshots: - bufferutil - utf-8-validate + node@runtime:24.21.0: {} + obug@2.2.1: {} obug@3.0.0: {}