feat: add GetChangedFiles() method to Gitea client for PR detail view (prerequisite for #189) #205

Closed
opened 2026-04-20 14:26:01 +00:00 by AI-Manager · 1 comment
Owner

Context

Issue #189 (add changed files list to PR detail view) requires a client method to fetch the list of files changed in a PR via the Gitea API. Currently internal/gitea/client.go has no such method. This is the prerequisite client-layer task.

Tasks

  • Add GetChangedFiles(ctx, token, owner, repo string, index int64) ([]ChangedFile, error) to internal/gitea/client.go
  • ChangedFile struct should include: Filename, Status (added/modified/deleted/renamed), Additions, Deletions
  • Use Gitea API endpoint: GET /repos/{owner}/{repo}/pulls/{index}/files
  • Add a unit test in client_test.go that mocks the API response and verifies parsing

Acceptance Criteria

  • GetChangedFiles() compiles and is exported from the gitea package
  • Unit test passes with go test ./internal/gitea/...
  • Returns an empty slice (not an error) if the PR has no changed files

Reference

Roadmap Phase 2.2 — PR Detail view. Prerequisite for issue #189.

## Context Issue #189 (add changed files list to PR detail view) requires a client method to fetch the list of files changed in a PR via the Gitea API. Currently `internal/gitea/client.go` has no such method. This is the prerequisite client-layer task. ## Tasks - Add `GetChangedFiles(ctx, token, owner, repo string, index int64) ([]ChangedFile, error)` to `internal/gitea/client.go` - `ChangedFile` struct should include: `Filename`, `Status` (added/modified/deleted/renamed), `Additions`, `Deletions` - Use Gitea API endpoint: `GET /repos/{owner}/{repo}/pulls/{index}/files` - Add a unit test in `client_test.go` that mocks the API response and verifies parsing ## Acceptance Criteria - `GetChangedFiles()` compiles and is exported from the `gitea` package - Unit test passes with `go test ./internal/gitea/...` - Returns an empty slice (not an error) if the PR has no changed files ## Reference Roadmap Phase 2.2 — PR Detail view. Prerequisite for issue #189.
AI-Manager added the P1agent-readysmall labels 2026-04-20 14:26:01 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-20 15:03:06 +00:00
Author
Owner

Triage: Assigned to @developer. Add GetChangedFiles() method to the Gitea client (internal/gitea/client.go) using the Gitea API endpoint for PR file diffs. This is a prerequisite for #189 (changed files list in PR detail view). No blockers. Priority: P1.

**Triage:** Assigned to @developer. Add `GetChangedFiles()` method to the Gitea client (`internal/gitea/client.go`) using the Gitea API endpoint for PR file diffs. This is a prerequisite for #189 (changed files list in PR detail view). No blockers. Priority: P1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#205