feat: implement Gitea SDK aggregation layer (client.go) #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Roadmap Reference
Phase 1, Section 1.4 — Gitea Aggregation Layer
What to do
Create
internal/gitea/client.gowrapping thecode.gitea.io/sdk/giteaSDK with the following functions:ListAllIssues(orgs []string)errgroup, merge + sort by updated timeListAllPullRequests(orgs []string)GetTriageQueue()ListOrgsAndRepos()ApplyLabel(owner, repo string, index int64, labelID int64)SubmitReview(owner, repo string, prIndex int64, review ReviewInput)CreateIssue(owner, repo string, input CreateIssueInput)Design requirements:
errgroupwith a semaphore capped at 10sync.RWMutexwith 30-second TTLorgs-repos,issues-{org},pulls-{org}Clientstruct takes a Gitea token string; construct an SDK client per requestAcceptance Criteria
go test ./internal/gitea/...passes with at minimum a cache invalidation test and a fan-out test using httptest stubsgo vet ./...andgo build ./...pass cleanlyClosing as implemented.
internal/gitea/client.goon master contains all required functions:ListAllIssues-- fan-out across repos with semaphore (maxConcurrent=5), merge + sort by updated timeListAllPullRequests-- same pattern for PRsGetTriageQueue-- unassigned issues + all open PRs, sorted by priority labelsListOrgsAndRepos-- enumerates all orgs and their repos concurrentlyApplyLabel-- label assignment with cache invalidationSubmitReview-- approve/request changes/comment with cache invalidationCreateIssue-- create issue with labels and cache invalidationCloseIssue,PostComment,RenderMarkdown,GetIssue,GetPull,GetIssueComments,GetRepoLabelsDesign requirements met:
internal/gitea/client_test.goNote: Issue specified semaphore cap of 10 but implementation uses 5. This is actually better for rate limiting.