diff --git a/packages/spike/README.md b/packages/spike/README.md index 31d392e..a9707a0 100644 --- a/packages/spike/README.md +++ b/packages/spike/README.md @@ -10,7 +10,15 @@ Discord-Gitea bridge bot. When someone opens a PR or leaves a comment on [git.no 4. `bun run subdomain:dev` to start the server. 5. Visit `localhost:3000/discord/auth` to authorize the bot to your Discord server. 6. Use [Tailscale Funnel](https://tailscale.com/kb/1223/funnel) or ngrok to expose your local server to the internet. -7. Add a Gitea webhook at `https://git.nose.space//settings/hooks` pointing to `https:///gitea/webhook`. +7. Add a Gitea webhook (see below). + +### Gitea webhook + +Spike needs a webhook so Gitea sends PR and comment events to it. You have two options: + +**System webhook (covers all repos)** — Requires Gitea admin access. Go to **Site Administration > System Webhooks > Add Webhook > Gitea**. Set the target URL to `https://spike.theworkshop.cc/gitea/webhook`. Under "Trigger On", select **Custom Events** and enable Pull Request, Issue Comment, and Pull Request Comment. This fires for every repo on the instance. + +**Org/repo webhook (covers one org or repo)** — Go to the org or repo settings, then **Webhooks > Add Webhook > Gitea**. Same target URL and event configuration as above. Only fires for that org or repo. ### Environment variables diff --git a/packages/spike/src/server/logs.tsx b/packages/spike/src/server/logs.tsx index 0a2975f..1b9cbb6 100644 --- a/packages/spike/src/server/logs.tsx +++ b/packages/spike/src/server/logs.tsx @@ -47,20 +47,23 @@ function EventRow({ event }: { event: StoredLogEvent }) { } function Sidebar({ files, selectedFile }: { files: string[]; selectedFile?: string }) { - // Group files by sha + // Group files by sha, sorted by most recent file in each group const grouped: Record = {} for (const file of files) { const sha = file.split("_")[0] || "unknown" const list = grouped[sha] || (grouped[sha] = []) list.push(file) } + const sortedGroups = Object.entries(grouped).sort(([, a], [, b]) => { + return b[0]!.localeCompare(a[0]!) + }) return (