Skip to content

Migrate connection_logs.type from ENUM to TEXT #27412

Description

@EhabY

Phase 3 of the Scalable Approach for Adding New IDE Session Types RFC. The connection_type Postgres ENUM in connection_logs has the same fixed-set problem as the old session count columns: until it is gone, new IDE types are permanently recorded as vscode in the durable connection log.

Scope (RFC: "Migration plan (ENUM to TEXT)"):

  • Migration: add type_text TEXT, backfill type::text, swap columns, drop the connection_type enum; remove the two ::connection_type casts in connectionlogs.sql. connection_logs is durable and can be large on busy deployments, so measure the backfill on a realistic dataset before deciding whether it needs batching
  • Proto: add string type_str to Connection alongside the enum; new agents populate type_str with the normalized session type, the server prefers it and falls back to converting the enum (same pattern as Stats.session_counts in Normalize workspace agent session counts into a child table #27410)
  • ReportConnection passes the normalized string through instead of classifying; db2sdk conversion becomes a passthrough
  • Connection log UI filter groups by family via coderd/idemetadata; update connection-logs.md
  • ~24 files, mostly mechanical (generated models, converters, enterprise connection log, SDK, frontend types)

Target: same release as #27410 (independent PRs). The client-side version gate (coder/vscode-coder#1044) points at the release containing this migration, so per-IDE names only start flowing once both the ephemeral and durable pipelines accept them; the gate is the safety net if this slips a release.

Done when

Depends on #27410.


🤖 Created by Coder Agents on behalf of @EhabY.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions