Commit Graph

56 Commits

Author SHA1 Message Date
a71bf2d492 Make webhook tests independent with isolated PRs and retry on merge timing issues
Some checks failed
CI / test (pull_request) Has been cancelled
Each test now creates its own PR and cleans up after itself. Tests no longer depend on shared state or ordering, making them resilient to failures.

Added retry logic to mergePR for Gitea's 404/405 responses while computing mergeability. Used crypto.randomUUID() for unique branch names instead of Date.now() to eliminate collision risk.
2026-03-09 15:56:09 -07:00
238df92888 Untangle Spike architecture with bridge pattern
Split the monolithic gitea/helpers.ts (which had Discord imports and created circular dependencies) into three focused libs:

1. **gitea/** — Pure API client: fetchPR, fetchReviewComments, convertUsername, threadName. No side effects or external deps.

2. **discord/** — Discord client setup: bot login, event listeners, slash commands. Now isolated from Gitea internals.

3. **bridge/** — New integration layer: webhook handler, DB mappings (Gitea PR ↔ Discord thread), Discord helpers, and createPRComment.

Dependencies now flow one direction: bridge → gitea and bridge → discord. No circular imports.

Added:
- Barrel exports (index.ts) for each lib with public API
- README.md for each lib documenting the barrel exports
- Comprehensive spike README.md with setup guide and architecture explanation
- Integration tests for webhooks (callback-based, no race conditions)
- Unit tests for pure API functions
- CLAUDE.md with links to each lib's README

This architecture makes it possible for AI to understand a lib by reading just its README, keeping context focused and small.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-09 15:23:11 -07:00
e46fb0dd7a Discord has a max message length of 2000, keep the PR title below that!
Some checks failed
CI / test (pull_request) Has been cancelled
2025-12-03 10:51:54 -08:00
9e7eb70b4f better
Some checks failed
CI / test (pull_request) Has been cancelled
2025-11-13 14:53:34 -08:00
f156e91bcd this is good enough
Some checks are pending
CI / test (push) Waiting to run
2025-11-13 10:59:49 -08:00
e2feb9cc1a great 2025-11-12 17:13:25 -08:00
34de1f8e40 Much better 2025-11-12 16:38:33 -08:00
fd939af0b7 This is much better
Some checks are pending
CI / test (push) Waiting to run
2025-11-12 11:49:10 -08:00
1bd8ecba7a Update webhook-handler.ts
Some checks are pending
CI / test (push) Waiting to run
2025-11-12 10:03:43 -08:00
726961ca99 let me cook
Some checks are pending
CI / test (push) Waiting to run
2025-11-12 09:55:23 -08:00
c85c61ed95 Update defunkt's name
Some checks failed
CI / test (push) Has been cancelled
2025-11-07 15:43:03 -08:00
f404f7c99b add logs 2025-11-07 15:07:24 -08:00
bff5aa05f5 spike, you are alive
Some checks failed
CI / test (push) Waiting to run
CI / test (pull_request) Has been cancelled
2025-11-07 14:58:20 -08:00
59d51c4be4 cool dude 2025-11-07 14:40:11 -08:00
a41e086d76 yes
Some checks failed
CI / test (pull_request) Has been cancelled
2025-11-07 10:31:37 -08:00
883c69d517 get that subdomain
Some checks are pending
CI / test (push) Waiting to run
2025-11-07 09:52:53 -08:00
bdf6a288b1 try it out!
Some checks are pending
CI / test (push) Waiting to run
2025-11-07 09:39:57 -08:00
3742a016aa Added cron 2025-07-25 14:15:23 -07:00
99645e3993 Add basic ci 2025-07-22 16:24:17 -07:00
c89a1849a7 Improve log fetching and Discord command handling 2025-07-22 12:10:19 -07:00
8fa8f3a2d3 wip 2025-07-22 11:09:26 -07:00
e68bf409f3 wip 2025-07-22 10:35:26 -07:00
97a4c750ad overlay! 2025-07-21 12:03:31 -07:00
258dd43e35 Update events.ts 2025-07-16 10:59:00 -07:00
17b7ab3a9d Update threadKeepAlive.ts 2025-07-16 10:54:25 -07:00
ffd7ad1fa0 Update ai.ts 2025-07-15 16:44:45 -07:00
5134446bf0 Update ai.ts 2025-07-15 16:27:18 -07:00
76a4900863 Give links 2025-07-15 14:59:51 -07:00
80afaef542 tell me about the threads! 2025-07-15 14:54:07 -07:00
c0eb5b6bca Update package.json 2025-07-15 14:17:32 -07:00
a495a5c50c revive threads 2025-07-15 14:14:07 -07:00
6dbbd74c01 wip 2025-07-14 14:47:30 -07:00
d4c725465a I went a little crazy 2025-07-11 13:05:50 -07:00
24c5ac6dc5 wip 2025-06-26 14:03:06 -07:00
429ee209f3 Update ai.ts 2025-06-26 12:20:28 -07:00
07953880af Better personality 2025-06-26 12:08:34 -07:00
21f336f78e Spike gets a facelift. 2025-06-26 11:50:03 -07:00
44eca2fc6c Better 2025-06-25 15:27:14 -07:00
0c8c5c7387 Move KV to separate files! 2025-06-23 15:17:39 -07:00
6750dc45f9 We can now mark good and bad responses from spike! 2025-06-23 14:51:31 -07:00
c2fbeef6e5 Update index.ts 2025-06-19 17:07:27 -07:00
38975981aa Handle emoji better 2025-06-19 17:06:37 -07:00
2292b3fa62 Update index.ts 2025-06-19 17:02:49 -07:00
14f7f008f3 make crashlog! 2025-06-19 16:59:08 -07:00
c155afa797 this should fail on spike 2025-06-19 16:47:54 -07:00
880779e659 Better one-shot for should respond 2025-06-18 09:59:38 -07:00
9976bde4de spike is better 2025-06-18 09:34:37 -07:00
d21db3f186 Update package.json 2025-06-18 09:20:45 -07:00
007357445b new spike 2025-06-18 09:13:27 -07:00
Chris Wanstrath
b403c6d1d4 @the-rabbit-hole => @workshop 2025-06-16 22:16:00 -07:00