Skip to Content
Internal docs are powered by Nextra Docs Theme.
SystemsPlatformAPI2Rails to API2 migrationPackagesBeam Rails-client retirement

Beam Rails-client retirement

ENG-2971  removes the local Rails OpenAPI client and Rails runtime URL from rulebase-beam-web. Beam uses API2 for session bootstrap and hosted login, current-organization reads, conversation lookup/detail, Jira request types and Jira draft writes. The Cloudflare build no longer receives VITE_API_BASE_URL; the old script that copied Beam into Rails’ public directory is deleted.

Compatibility paths

Beam’s Zendesk host supplies only a ticket id. POST /conversations/import resolves the authenticated API2 organization to its Rails-owned tenant id, refuses an id already present anywhere in that tenant, and checks only active Zendesk customer-interaction sources. The first provider match is imported with the shared native Zendesk upsert, its conversation thread is ensured, and the existing provider-sync queue receives beam-zendesk-import-<source id>-<ticket id> as the retry identity. A provider 404 advances to the next source. Source lookup failures retain Rails suggestion search semantics and are logged; failures after a ticket match propagate rather than trying a second source after a partial write.

Conversation reads continue through the existing membership-scoped API2 list and detail routes. A tenant-wide existing-id check deliberately returns only a conflict, never the hidden conversation id; Beam refetches its scoped list after that race.

API2 continues to render historical Rails Jira drafts beside native drafts. On edit, POST /jira_issue_drafts/:id/migrate tenant-checks the Rails draft, maps its request type and fields to the active API2 Jira metadata, and creates a deterministic UUID from the API2 organization and legacy numeric draft id. A retry updates the same pending API2 draft. If submission already succeeded, the same route returns that submitted draft and Beam treats it as success rather than submitting twice. After the native pending draft is durable, API2 marks the legacy row canceled so it no longer appears as duplicate pending work.

The Jira Service Management create-request endpoint has no documented idempotency key. The pre-existing Rails and API2 submission implementations therefore retain an ambiguous remote-create window if Jira accepts a request but the response is lost before the local issue record is durable. This package does not widen that window, but operators must check Jira before retrying an ambiguous submission; crash-safe reconciliation is tracked separately.

Verification and rollout

Before merge, run the focused Beam-import and Jira-migration tests, API2 typecheck, Beam lint, and the production Beam build with its required public environment values. Confirm the Beam source census has zero Rails-client imports, zero Rails base URLs and no generated Rails client scripts.

After the normal release deploys API2 in both regions and Cloudflare publishes Beam, smoke a real sidebar login, existing ticket load, missing-ticket import, new Jira ticket, and one legacy pending Jira draft. Observe API2 errors and the provider-sync/Jira queues through 24 hours. No database migration, feature flag, provider endpoint change or manual production mutation is part of this package.

Rollback restores the previous Beam bundle first and waits for it to serve traffic before API2 rolls back. API2-created conversations and Jira drafts are compatible durable records and must not be deleted. A migrated Rails draft remains canceled; its corresponding native draft is the recovery record.

Last updated on