docs(prd-6): mark M4 complete — label trigger validated
3 bugs found and fixed: - Workflow if: expression parser rejects # comments - Forgejo doesn't populate github.event.action in if: context - Forgejo sends 'label_updated' instead of 'labeled' Key learning: normalize Forgejo event action names in context.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
f3c92a2821
commit
efddd08f5c
1 file changed
+15
-6
@@ -65,13 +65,19 @@ Systematically exercise each untested scenario on the live Forgejo instance (git
|
||||
- **Fix** (`e514bf5`→`b21dbd6`): Replaced blind Forgejo auto-trigger in `trigger.ts` with payload-aware `@claude` check that inspects `comment.body` and `review.body` with fallback. Attempted workflow `if:` gating but reverted — Forgejo's `pull_request_comment` payload does not populate `github.event.comment.body` or `github.event.review.body` (run 12084 was skipped).
|
||||
- **Key learning**: On Forgejo, the workflow `if:` condition cannot reliably gate on payload body fields for `pull_request_comment` events. The `@claude` check must happen in application code (`trigger.ts`), not in the workflow condition.
|
||||
|
||||
- [ ] **M4: Test label trigger**
|
||||
- [x] **M4: Test label trigger**
|
||||
|
||||
- Create a label (e.g., `claude`) that triggers the action when applied to an issue
|
||||
- Apply the label to a test issue
|
||||
- Verify: trigger detection, context fetching (issue body/title), Claude response
|
||||
- Document any issues and fix them
|
||||
- **Validation**: Claude responds when the configured label is applied to an issue
|
||||
- Created `claude` label (id: 125) on the repo ✓
|
||||
- Applied label to test issues (#17, #18, #19) ✓
|
||||
- Verify: trigger detection, context fetching (issue body/title), Claude response ✓
|
||||
- Document any issues and fix them ✓ (3 bugs found and fixed, see below)
|
||||
- **Validation**: Claude responds when the configured label is applied to an issue ✓ (run 52795, 20s, 2 turns, $0.12)
|
||||
- Also verified: creating issue with label in one go fires exactly 1 run (issue #19)
|
||||
- **Bugs found & fixed**:
|
||||
1. `a864b16`: Workflow `if:` expression parser rejects `#` comments — Forgejo runner's expression lexer treats `#` as invalid token. Moved all comments outside the `if:` block, switched from `|` to `>-` scalar.
|
||||
2. `414c705`→`a864b16`: Forgejo does not populate `github.event.action` in workflow `if:` context for `issues` events (run 12061 skipped despite action being `labeled`). Let all `issues` events through the gate; `trigger.ts` validates.
|
||||
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**
|
||||
|
||||
@@ -110,6 +116,9 @@ Systematically exercise each untested scenario on the live Forgejo instance (git
|
||||
| Bun mock.module breaks mock tracking on Linux | RESOLVED: use spyOn on module namespace, never mock.module |
|
||||
| MCP comment updates silently fail on Forgejo | RESOLVED: route to issue comment API when platform=forgejo |
|
||||
| Workflow if: cannot gate on payload body for Forgejo | RESOLVED: @claude check moved to trigger.ts application code |
|
||||
| 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 |
|
||||
|
||||
## Success Criteria
|
||||
|
||||
|
||||
Reference in new issue
Block a user