Commit Graph

9 Commits

Author SHA1 Message Date
JimKarvo 718569eda7 fix: restore events.go whitespace to canonical form 2026-06-29 20:24:48 +00:00
JimKarvo 72b50b88f2 fix: restore processor.go to correct EventHandler architecture (was slack.Client corruption) 2026-06-29 20:24:40 +00:00
JimKarvo e7d6abb942 fix: rewrite processor.go with raw Go source (was base64-corrupted) 2026-06-29 20:16:20 +00:00
JimKarvo 357cecca84 fix: rewrite events.go with raw Go source (was base64-corrupted) 2026-06-29 20:14:47 +00:00
JimKarvo 895b82096c fix: also check singular RequestedReviewer field for review_requested events
Gitea sends `requested_reviewer` (singular) field for `review_requested`
webhook actions, not always the `requested_reviewers` (plural/array).
The processor only checked the array form, so `usersToNotify` was always
empty and no notification was sent.

Also add more INFO-level logging for debugging the review_requested path.

Fixes: manual mappings worked but were never reached because the
processor never added the reviewer to the notification list.
2026-06-29 19:42:19 +00:00
JimKarvo 673cefeb90 fix: add MANUAL_USER_MAPPINGS support for users with mismatched emails
JimKarvo's Gitea email (dimitris@jksoftware.gr) differs from Slack
email (jimkarvo@gmail.com), so the email-based Slack lookup fails.
Add MANUAL_USER_MAPPINGS env var (format: GiteaUsername:SlackID,...)
to bypass email lookup when a manual mapping exists.

Changes:
- cache.go: ParseManualMappings() parses env var format
- cache.go: CachedResolver checks manual mappings first (step 0)
- main.go: reads MANUAL_USER_MAPPINGS env var, passes to resolver
2026-06-29 22:34:22 +03:00
JimKarvo 9e26698068 fix: use event.Reviewers instead of e.RequestedReviewer for review_requested 2026-06-29 18:54:59 +00:00
JimKarvo 765fb04420 fix: use event.Reviewers instead of e.RequestedReviewer for review_requested
The review_requested case was reading e.RequestedReviewer (singular *GiteaUser),
but in some Gitea versions/webhook payloads this field is nil while the
reviewer data comes in requested_reviewers (plural array).
Now uses event.Reviewers from normalizePREvent, which handles both
PullRequest.RequestedReviewers and top-level requested_reviewers.
Keeps e.RequestedReviewer as a fallback for older Gitea versions.
2026-06-23 11:01:47 +00:00
JimKarvo 6bf27aa40e Initial import with modified Dockerfile for env-based config generation 2026-06-22 11:56:10 +03:00