refactor(api): replace legacy organization fields with instance scope model #23

Open
opened 2026-05-28 08:46:27 +00:00 by simon · 0 comments
Owner

CT-Automation docs have been updated to remove organization/tenant terminology in favor of CT-Ops instance/client scope language, but the implementation still exposes legacy organization_* names in the API, database schema, domain model, and tests.\n\nEvidence:\n- src/ct_automation/api/app.py still defines pairing and actor payloads with organization_slug, organization_name, and organization_id.\n- src/ct_automation/db/schema.py still has an organizations table and organization_id foreign keys.\n- CT-Ops currently passes its instance id through the old organization_id field in the integration contract.\n\nWhy it matters:\nCT-Ops no longer has organizations, so keeping these names in the runtime API makes the product contract misleading and increases the risk of future CT-Ops integration drift.\n\nSuggested fix:\nIntroduce an explicit instance-scope/client-scope model and migrate request/response fields, actor context, persistence columns, and tests away from organization_* names. Keep a backwards-compatible alias period if existing CT-Ops releases still send organization_id.

CT-Automation docs have been updated to remove organization/tenant terminology in favor of CT-Ops instance/client scope language, but the implementation still exposes legacy organization_* names in the API, database schema, domain model, and tests.\n\nEvidence:\n- src/ct_automation/api/app.py still defines pairing and actor payloads with organization_slug, organization_name, and organization_id.\n- src/ct_automation/db/schema.py still has an organizations table and organization_id foreign keys.\n- CT-Ops currently passes its instance id through the old organization_id field in the integration contract.\n\nWhy it matters:\nCT-Ops no longer has organizations, so keeping these names in the runtime API makes the product contract misleading and increases the risk of future CT-Ops integration drift.\n\nSuggested fix:\nIntroduce an explicit instance-scope/client-scope model and migrate request/response fields, actor context, persistence columns, and tests away from organization_* names. Keep a backwards-compatible alias period if existing CT-Ops releases still send organization_id.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carrtech/CT-Automation#23
No description provided.