feat: implement Gitea aggregation layer with concurrent fetching #11

Merged
AI-Manager merged 1 commits from feature/gitea-aggregation into master 2026-03-26 05:04:47 +00:00
Owner

Summary

  • Add Gitea API client with concurrent fan-out fetching across repos/orgs
  • Implement ListAllIssues, ListAllPullRequests, GetTriageQueue aggregation functions
  • Add in-memory cache with 30s TTL and cache invalidation on writes
  • Include write operations: CreateIssue, ApplyLabel, SubmitReview
  • Unit tests with httptest mock server

Depends on: PR #10 (config + auth)

Closes #3

Files Changed

File Purpose
internal/gitea/client.go Full aggregation client
internal/gitea/client_test.go Unit tests

Test plan

  • Run go test ./internal/gitea/... to verify tests pass
  • Verify concurrent fetching with multiple orgs
  • Verify cache hit/miss behavior
  • Verify priority sorting in triage queue

Generated with Claude Code

## Summary - Add Gitea API client with concurrent fan-out fetching across repos/orgs - Implement ListAllIssues, ListAllPullRequests, GetTriageQueue aggregation functions - Add in-memory cache with 30s TTL and cache invalidation on writes - Include write operations: CreateIssue, ApplyLabel, SubmitReview - Unit tests with httptest mock server **Depends on:** PR #10 (config + auth) Closes #3 ## Files Changed | File | Purpose | |------|--------| | `internal/gitea/client.go` | Full aggregation client | | `internal/gitea/client_test.go` | Unit tests | ## Test plan - [ ] Run `go test ./internal/gitea/...` to verify tests pass - [ ] Verify concurrent fetching with multiple orgs - [ ] Verify cache hit/miss behavior - [ ] Verify priority sorting in triage queue Generated with Claude Code
AI-Manager changed target branch from feature/config-auth to master 2026-03-26 05:04:39 +00:00
AI-Manager added 1 commit 2026-03-26 05:04:39 +00:00
Add core aggregation layer wrapping the Gitea API for fan-out
concurrent fetching across repos and organizations with caching.

- internal/gitea/client.go: Gitea API client with aggregation
  - ListOrgs/ListOrgRepos/ListOrgsAndRepos for org enumeration
  - ListAllIssues: concurrent fetch across repos via goroutines with semaphore (5)
  - ListAllPullRequests: same pattern for PRs
  - GetTriageQueue: unassigned issues + open PRs, sorted by priority
  - CreateIssue, ApplyLabel, SubmitReview: write operations with cache invalidation
  - In-memory cache with 30s TTL using sync.RWMutex
- internal/gitea/client_test.go: unit tests for caching, priority scoring,
  API calls with httptest server, and triage queue sorting

Closes leeworks-agents/gitea-mobile#3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit f464e11b00 into master 2026-03-26 05:04:47 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#11