feat(i18n-gateway): dial TranslationTerm.GetTranslations; remove terms API - #253
Conversation
…s API
- Switch translations fan-out to {app}.TranslationTerm/GetTranslations and whitelist internal dial.
- Remove /web/i18n/terms, the old Terminology Editor, and terms_api while keeping PO SearchTerms export.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe gateway now serves translations through ChangesTranslation gateway migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant WebClient
participant serveTranslations
participant fetchAppTranslations
participant TranslationTerm
WebClient->>serveTranslations: request /web/i18n/translations
serveTranslations->>fetchAppTranslations: fetch translations
fetchAppTranslations->>TranslationTerm: call GetTranslations
TranslationTerm-->>fetchAppTranslations: return translations
fetchAppTranslations-->>serveTranslations: return translation data
serveTranslations-->>WebClient: send HTTP response
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/i18n/gateway/term_search.go`:
- Around line 26-27: Update the PermissionDenied response in writeTermsRPCError
to remove the terminology-editor-specific wording and use an
operation-appropriate generic permission error message, including for PO export
failures.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 42db1212-09f3-4f70-83f0-33796f99d6ef
📒 Files selected for processing (20)
internal/i18n/gateway/auth_forward.gointernal/i18n/gateway/client.gointernal/i18n/gateway/gateway.gointernal/i18n/gateway/gateway_terms_test.gointernal/i18n/gateway/po_export_test.gointernal/i18n/gateway/rpc_client_test.gointernal/i18n/gateway/term_search.gointernal/i18n/gateway/terms.gointernal/i18n/gateway/terms_client.gointernal/i18n/gateway/terms_client_test.gointernal/i18n/gateway/translations.gointernal/server/middleware/auth/grpcauth/interceptor.gointernal/server/middleware/auth/grpcauth/interceptor_test.gomodules/base/web/menu/menus.tsmodules/base/web/route/routes.tsmodules/web/web/pages/TerminologyEditor.vuemodules/web/web/stores/i18nStore/component_hint.test.tsmodules/web/web/stores/i18nStore/index.tsmodules/web/web/stores/i18nStore/terms_api.test.tsmodules/web/web/stores/i18nStore/terms_api.ts
💤 Files with no reviewable changes (8)
- modules/web/web/pages/TerminologyEditor.vue
- modules/web/web/stores/i18nStore/terms_api.ts
- internal/i18n/gateway/terms_client.go
- internal/i18n/gateway/terms.go
- modules/web/web/stores/i18nStore/index.ts
- modules/base/web/route/routes.ts
- modules/base/web/menu/menus.ts
- modules/web/web/stores/i18nStore/terms_api.test.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- PermissionDenied now returns a generic permission denied message after the terms Editor was removed. Co-authored-by: Cursor <cursoragent@cursor.com>
- Re-extract base.pot and sync zh_CN.po so pot-dirty CI status is clean. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add a bufconn server that returns Unavailable so fetchAppTranslations hits the Invoke error branch. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a8e8604. Configure here.
User description
Summary
GET /web/i18n/translationsfan-out to dial{app}.TranslationTerm/GetTranslations(internal auth whitelist added; HTTP JSON contract unchanged)./web/i18n/terms, the old Terminology Editor page/route/menu, andterms_api; keepGET /web/i18n/poon Go I18nSearchTermsuntil P4/P5.componentHintFromScopetests; assert terms routes return 404.Test plan
go test ./internal/i18n/gateway/... ./internal/server/middleware/auth/grpcauth/..../choysum test unit web --feand./choysum test unit base --feGET|PATCH /web/i18n/terms→ 404 and/base/terminologyis unreachableGET /web/i18n/postill exports for an authenticated terminology editorMade with Cursor
PR Type
Enhancement, Tests
Description
Go Core: Dial
TranslationTerm/GetTranslationsand remove/web/i18n/termsTS Modules: Delete Terminology Editor UI, route, and API
Licensing: Include SPDX headers for new source files
Tests: Add Go interceptor tests and TS unit tests
File Walkthrough
1 files
Update comment for PO export authentication behavior9 files
Dial TranslationTerm.GetTranslations instead of legacy I18nRemove terms route registration from Gateway muxAdd shared SearchTerms RPC and error response helpersRemove terms HTTP handler and patch logicRemove invokeAppUpdateTerm gRPC client helperWhitelist TranslationTerm.GetTranslations in gRPC auth interceptorDelete Terminology Editor Vue page componentRemove terms_api exports from i18nStoreDelete terms_api fetch and patch utilities6 files
Assert removed terms routes return HTTP 404Add TranslationTerm bufconn dialer and clean up terms testsClean up term update RPC client unit testsAdd test coverage for TranslationTerm interceptor bypassAdd componentHintFromScope Vitest unit testDelete terms_api unit test file1 files
Format field formatting in PO export test1 files
Remove update handler function field2 files
Remove Terminology Editor menu entry from base moduleRemove Terminology Editor route from base moduleSummary by CodeRabbit