Skip to Content
Internal docs are powered by Nextra Docs Theme.
SystemsPlatformAPI2Rails to API2 migrationPackagesKnowledge Library document reads

Knowledge Library document reads

ENG-3003  moves the Rulebase UI’s Knowledge Library document list and detail reads from Rails to API2. Query keys, pagination, cache behavior and the existing Rails-shaped UI resource types stay stable while API2 reads the Rails-owned tables directly.

Ownership boundary

API2 owns GET /knowledge-library/documents and GET /knowledge-library/documents/{documentId} for the Rulebase UI. The list matches Rails’ non-null content/title and kept-record scope, newest-first pagination, recursive descendant folder selection, document kind, source type, Zendesk locale/brand filters, and pg_search-compatible title/article matching. The detail response includes the full content and filter-aware previous/next document IDs.

Rails remains the owner of document create, update, discard, sync, imports, source/folder mutations, and Active Storage image handling. Rolling back the UI bundle restores the prior Rails reads; there is no dual-read runtime flag.

The package removes two Rails-client importers. The Rulebase UI census changes from 291 to 289 source/test files and from 281 to 279 runtime files. Beam stays at zero.

Verification

Before merge, run the focused API2 database route and UI request-shape tests, API2 typecheck, Rulebase UI typecheck and Rulebase UI lint. Confirm the list does not return content, tenant isolation holds, hidden/discarded rows do not appear, every filter matches Rails, and detail navigation respects the active filter.

Deploy API2 before the Rulebase UI. After both regional releases are healthy, confirm Sentry dashboard 5423172 is receiving first_party_client:rulebase-ui, then observe the Rails KnowledgeBaseDocumentsController#index and #show transactions through a complete production window. Any remaining first-party request blocks retirement credit and should be traced to its deployed client/version.

Last updated on