test: add unit tests for in-memory cache TTL and invalidation in gitea/client.go #120
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?
Summary
The ROADMAP (Phase 1.4) specifies an in-memory cache with 30-second TTL using
sync.RWMutexand cache invalidation on write operations. The cache logic ininternal/gitea/client.gohas no dedicated tests — a TTL regression or invalidation bug would cause stale data to be served after label assignments or review submissions.What to Do
internal/gitea/client_test.gofor:InvalidateAll()or a write operation (e.g.,ApplyLabel()), verify the next read fetches fresh dataAcceptance Criteria
go test ./internal/gitea/...passes with the new testsRoadmap Reference
Phase 1.4 — Gitea Aggregation Layer: in-memory cache with 30s TTL
Closing:
TestCache,TestCacheExpiry, andTestInvalidateAllininternal/gitea/client_test.goalready cover all acceptance criteria: cache hit/miss, TTL expiry (with configurablecacheTTL), and full cache invalidation viaInvalidateAll(). No further work needed.Triage (repo-manager): Assigned to @AI-QA. This is a unit test task for the in-memory cache TTL and invalidation logic in
internal/gitea/client.go. Delegating to QA engineer agent for implementation. P2/small.