Skip to content

feat: add update tenant endpoint with rate limiter cache invalidation#6

Merged
faranjit merged 2 commits intomainfrom
feature/update-tenant
Feb 8, 2026
Merged

feat: add update tenant endpoint with rate limiter cache invalidation#6
faranjit merged 2 commits intomainfrom
feature/update-tenant

Conversation

@faranjit
Copy link
Copy Markdown
Owner

@faranjit faranjit commented Feb 8, 2026

  • Add PATCH /tenants/{id} endpoint to update tenant settings
  • Refactor RateLimiter to struct with functional options pattern
  • Add callback mechanism for cross-component communication
  • Invalidate rate limiter cache immediately on tenant update
  • Add UpdateTenant to store interface and postgres implementation
  • Add comprehensive tests for update flow and callback verification

- Add PATCH /tenants/{id} endpoint to update tenant settings
- Refactor RateLimiter to struct with functional options pattern
- Add callback mechanism for cross-component communication
- Invalidate rate limiter cache immediately on tenant update
- Add UpdateTenant to store interface and postgres implementation
- Add comprehensive tests for update flow and callback verification
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.28%. Comparing base (1e83a2d) to head (6cefbd9).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/server.go 0.00% 6 Missing ⚠️
internal/controller/handlers/tenants.go 87.50% 2 Missing and 1 partial ⚠️
internal/store/postgres/tenants.go 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
+ Coverage   66.60%   67.28%   +0.68%     
==========================================
  Files          36       36              
  Lines        2045     2103      +58     
==========================================
+ Hits         1362     1415      +53     
- Misses        590      594       +4     
- Partials       93       94       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add tests for NewRateLimiter default TTL
- Add tests for WithTTL functional option
- Add tests for InvalidateTenant cache invalidation
- Add tests for UpdateTenant store method (success and error cases)
@faranjit faranjit merged commit d9958c9 into main Feb 8, 2026
6 checks passed
@faranjit faranjit deleted the feature/update-tenant branch February 8, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant