From 8754cc018154f95ba33065e1e827770b678df668 Mon Sep 17 00:00:00 2001 From: Vlad Mocanu Date: Thu, 26 Feb 2026 10:49:39 +0200 Subject: [PATCH] =?UTF-8?q?docs(prd-6):=20mark=20M5=20complete=20=E2=80=94?= =?UTF-8?q?=20assignee=20trigger=20validated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- prds/6-e2e-test-forgejo-triggers.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/prds/6-e2e-test-forgejo-triggers.md b/prds/6-e2e-test-forgejo-triggers.md index dc6dec0..45e7186 100644 --- a/prds/6-e2e-test-forgejo-triggers.md +++ b/prds/6-e2e-test-forgejo-triggers.md @@ -79,12 +79,17 @@ Systematically exercise each untested scenario on the live Forgejo instance (git 3. `baa007a`: Forgejo sends `label_updated` instead of `labeled` as `eventAction` for issue label events. Added `FORGEJO_EVENT_ACTION_MAP` in `context.ts` to normalize at parse time (same pattern as event name normalization). - **Key learning**: Forgejo's `issues` event action names differ from GitHub — `label_updated` not `labeled`. Normalize in `context.ts` at parse time so all downstream code works unchanged. Creating an issue with a label fires both `opened` and `label_updated` as separate events — do NOT check labels on `opened` to avoid duplicate runs. -- [ ] **M5: Test assignee trigger** +- [x] **M5: Test assignee trigger** - - Assign a user to an issue to trigger the action - - Verify: trigger detection, context fetching, Claude response - - Document any issues and fix them - - **Validation**: Claude responds when assigned to an issue + - Created test issue #20, assigned `claude` user via API ✓ + - Verify: trigger detection, context fetching, Claude response ✓ + - Document any issues and fix them ✓ (1 bug found and fixed, see below) + - **Validation**: Claude responds when assigned to an issue ✓ (run 52842, 2 turns, $0.09) + - **Bug found & fixed**: + 1. `99624ef`: Forgejo's `issues/assigned` webhook payload lacks the top-level `assignee` object — `payload.assignee` is `undefined`. The assignee is only available at `payload.issue.assignee`. Added fallback in `trigger.ts` to check `issue.assignee.login` when `payload.assignee.login` is missing. + - **Also discovered**: Forgejo sends `assigned` as the event action (matching GitHub) — no normalization needed, unlike M4's `label_updated`. + - **Also discovered**: Forgejo's API `PATCH /issues/{index}` with `{"assignees": ["user"]}` (plural array) returns 404. Must use deprecated singular `{"assignee": "user"}` field instead. + - **Key learning**: On Forgejo, the `issues/assigned` webhook payload structure differs from GitHub — the assigned user is nested under `issue.assignee`, not at the top-level `assignee` field. Same pattern as M2's missing top-level `comment` object. - [ ] **M6: Test tag mode with code changes (branch creation)** @@ -119,6 +124,8 @@ Systematically exercise each untested scenario on the live Forgejo instance (git | Workflow if: expression parser rejects # comments | RESOLVED: moved comments outside if: block, use >- scalar | | Forgejo event action names differ from GitHub | RESOLVED: FORGEJO_EVENT_ACTION_MAP normalizes at parse time | | Creating issue with label fires duplicate runs | RESOLVED: label check only on labeled event, not on opened | +| Forgejo assigned payload lacks top-level assignee | RESOLVED: fallback to issue.assignee.login in trigger.ts | +| Forgejo API assignees array field returns 404 | RESOLVED: use deprecated singular assignee field instead | ## Success Criteria