Switch Forgejo MR creation from CLI to REST API #24

Merged
david merged 3 commits from issue-21/forgejo-rest-mr into main 2026-07-27 02:30:54 +00:00
Owner

Summary

Switches Forgejo MR/PR creation from the fj CLI to deterministic REST API calls, following the existing issue-fetching pattern.

Changes

  • Added shared MrClient interface + MrClientError status classifier.
  • Added ForgejoMrClient using POST /api/v1/repos/{owner}/{repo}/pulls.
  • Updated runMrStage to use deterministic git operations + ForgejoMrClient for Forgejo-origin repos.
  • Removed fj CLI guidance from Forgejo prompts; added mrPlatformVocabulary helper.
  • Dropped fj preflight requirement for Forgejo.
  • Updated docs (AGENTS.md, DESIGN.md, README.md, multi-provider docs).
  • Fixed pre-existing duplicate-import lint errors.

Testing

  • All tests pass (599 tests, 76 files)
  • npm run lint clean
  • npm run build clean
  • Manual verification via unit tests for success, 401, 403, 404, 429, 500, and malformed responses

Checklist

  • Self-reviewed the diff
  • Code follows project conventions
  • Descriptive naming (no single-character variables)
  • Documentation updated

Closes #21

## Summary Switches Forgejo MR/PR creation from the `fj` CLI to deterministic REST API calls, following the existing issue-fetching pattern. ## Changes - Added shared `MrClient` interface + `MrClientError` status classifier. - Added `ForgejoMrClient` using `POST /api/v1/repos/{owner}/{repo}/pulls`. - Updated `runMrStage` to use deterministic git operations + `ForgejoMrClient` for Forgejo-origin repos. - Removed `fj` CLI guidance from Forgejo prompts; added `mrPlatformVocabulary` helper. - Dropped `fj` preflight requirement for Forgejo. - Updated docs (AGENTS.md, DESIGN.md, README.md, multi-provider docs). - Fixed pre-existing duplicate-import lint errors. ## Testing - [x] All tests pass (599 tests, 76 files) - [x] `npm run lint` clean - [x] `npm run build` clean - [x] Manual verification via unit tests for success, 401, 403, 404, 429, 500, and malformed responses ## Checklist - [x] Self-reviewed the diff - [x] Code follows project conventions - [x] Descriptive naming (no single-character variables) - [x] Documentation updated Closes #21
- Add shared MrClient interface + MrClientError status classifier
- Add ForgejoMrClient with POST /api/v1/repos/{owner}/{repo}/pulls
- Update runMrStage to use deterministic git + ForgejoMrClient for forgejo
- Remove fj CLI guidance from Forgejo prompts; add mrPlatformVocabulary helper
- Drop fj preflight requirement for Forgejo
- Update runPipeline to pass config/origin to MR stage
- Fix pre-existing duplicate-import lint errors
- Update AGENTS.md, DESIGN.md, README.md, and multi-provider docs

Closes #21
david force-pushed issue-21/forgejo-rest-mr from c55b105848 to c111902260 2026-07-25 23:23:57 +00:00 Compare
- Forgejo MR path: stage with 'git add -- . :(exclude).pi-loop' so run
  artifacts never leak into the committed/pushed branch (review High).
- Skip the discarded LLM session on the deterministic Forgejo path; the
  agent output was never parsed (review Medium).
- Extract shared classifyHttpStatus into src/shared/http and consume it
  from MrClientError and IssueSourceError to remove duplicate policy
  (review Medium).
- Narrow mrToolGuidance param to 'gitlab' | 'github' so passing 'forgejo'
  is a compile error instead of a runtime throw (review Minor).
- Document Forgejo WIP-prefix vs draft:true draft-marker strategy in the
  client and design doc (review Suggestion).
- Delete docs/ (design + implementation-plan markdown).
- Delete root planning files (findings.md, progress.md, task_plan.md).
- Drop the now-dangling docs/design-rest-mr-creation.md reference in
  ForgejoMrClient; the draft-marker rationale is kept inline.
david merged commit 7babf99ac5 into main 2026-07-27 02:30:54 +00:00
david deleted branch issue-21/forgejo-rest-mr 2026-07-27 02:30:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-loop!24
No description provided.