diff --git a/prds/6-e2e-test-forgejo-triggers.md b/prds/6-e2e-test-forgejo-triggers.md index 45e7186..66ceef4 100644 --- a/prds/6-e2e-test-forgejo-triggers.md +++ b/prds/6-e2e-test-forgejo-triggers.md @@ -91,13 +91,19 @@ Systematically exercise each untested scenario on the live Forgejo instance (git - **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)** +- [x] **M6: Test tag mode with code changes (branch creation)** - - Create an issue requesting a code change (e.g., "add a comment to file X") - - Trigger Claude via `@claude` mention - - Verify: Claude creates a branch, pushes commits, links the branch in tracking comment - - Verify the Forgejo-specific PR compare URL format is correct - - **Validation**: Claude successfully creates a branch with code changes on Forgejo + - Created test issue #21 requesting creation of `test/e2e-prd6-m6.txt` ✓ + - Triggered Claude via `@claude` mention in issue comment ✓ + - Verify: Claude creates a branch, pushes commits, links the branch in tracking comment ✓ + - Branch: `claude/issue-21-20260226-0917` + - Commit: `59f7e4e` by `claude ` (bot identity correct) + - File content verified via API: matches requested content + - Verify the Forgejo-specific PR compare URL format is correct ✓ (after fix, see below) + - **Validation**: Claude successfully creates a branch with code changes on Forgejo ✓ (run #198, 41s) + - **Bug found & fixed**: + 1. `f08b1b4`: Prompt template in `src/create-prompt/index.ts` (lines 604, 794) hardcoded `quick_pull=1` (GitHub-specific) in the "Create a PR" URL. On Forgejo, this param is ignored so the compare page doesn't auto-expand the PR creation form. Forgejo uses `expand=1`. Fix: made prompt template platform-aware via `detectPlatform()`. Note: `updateForgejoCommentBody()` extracts PR URLs from comment content (`prLinkFromContent`) with priority over the URL from `update-comment-link.ts`, so the prompt template is the correct fix location. + - **Key learning**: The PR compare URL appears in two places — the prompt template (used by Claude to write the URL into comment body) and `update-comment-link.ts` (post-execution update). Because `updateForgejoCommentBody()` prioritizes URLs found in existing content, both must use the correct platform-specific query parameter. Fix validated after merge to `main` (workflow runs from default branch for `issue_comment` events). - [ ] **M7: Update documentation with E2E results** - Update `docs/forgejo.md` E2E status table with results for all 5 scenarios @@ -126,6 +132,7 @@ Systematically exercise each untested scenario on the live Forgejo instance (git | 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 | +| Prompt template hardcodes quick_pull=1 in PR compare URL | RESOLVED: platform-aware expand=1 for Forgejo in prompt | ## Success Criteria