Repository navigation
feat: separate connection log methods from app names - #30466
Conversation
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
7b61be1 to
b586449
Compare
b586449 to
5a3450d
Compare
5a3450d to
aabf3b0
Compare
nickvigilante
left a comment
There was a problem hiding this comment.
Docs overall LGTM. My robot found some things worth flagging, but you can take them or leave them.
code-asher
left a comment
There was a problem hiding this comment.
Tested it out and it looks good! Mostly just wondering if we need the family filter and thinking we can make app repeatable.
| -- nothing. Other methods store a destination in app_name_or_port. | ||
| AND CASE | ||
| WHEN @app_names :: text[] IS NOT NULL THEN | ||
| connection_method IN ('ssh', 'reconnecting_pty') AND app_name_or_port = ANY(@app_names :: text[]) |
There was a problem hiding this comment.
Any harm in letting it match anything, even if not ssh or reconnecting_pty? Could be nice to also get web apps and be able to search ports.
Although app:8080 would be kinda weird, so maybe we would only want to allow workspace apps and eventually add a separate port filter.
There was a problem hiding this comment.
I went back and forth on this one. I'd like app: to keep matching what the response shows in app_name, and for workspace apps the slug lives in web_info.slug_or_port, so mixing them felt confusing. I think separate workspace_app: and port: filters would be cleaner, so I'd rather do those in a follow-up. wdyt?
There was a problem hiding this comment.
Yeah we can address this later! Maybe we run it by the dev or design channel to see if folks have opinions.
The ssh/webinfo split we introduce at the API feels kinda odd to me, I wish we simply returned the whole row as it came from the DB. But, most users probably never even see that anyway since they would have to interact with the API.
There was a problem hiding this comment.
Yep agreed, it's an (API) design question and needs product/dev input!
ae47b7f to
036757d
Compare
- Remove the family filter and its presets, and make app repeatable. - Drop a legacy type filter when a method is picked, and warn when the filter contains type. - Describe app names as self-reported rather than client identities. - List every method in convertConnectionLog and panic on unknown ones. - Compare whole rows in the agentapi connection log test. - Add a type filter migration table to the docs.
036757d to
c33fc14
Compare
Summary
Connection logs now record how a connection was made (
connection_method) separately from which app made it (app_name), as specified in the Completing Scalable IDE Session Tracking RFC. Storage, the HTTP API, search filters, and the UI move to the new fields. Legacy agent reports and the deprecatedtypefield keep working.What changes
API:
GET /api/v2/connectionlogconnection_method(new):ssh,reconnecting_pty,workspace_app,port_forwarding, ortunnel.app_name,app_display_name(new, optional): the self-reported name of the connecting app, such ascursor. Workspace app slugs and ports stay inweb_info.slug_or_port.type(deprecated): now a plain string, so new methods pass through. The Go SDK'sConnectionLog.Typebecomes astring.{"type": "vscode", "connection_method": "ssh", "app_name": "cursor", "app_display_name": "Cursor"}Search filters
method:sshapp:cursorapp:vscode app:cursortype:vscodemethod:andapp:intersect, like the existing owner filters.type:can't be combined withmethod:orapp:. List and count always agree.UI
type:from old links.type:.method:sshinstead oftype:ssh, so it also includes SSH sessions from VS Code and JetBrains apps.SDK
codersdk.ConnectionLogMethodis generated from the database enum bytypegen dbenumsinstead of being maintained by hand.Docs
method:andapp:, and include a table for replacing eachtype:value.Upgrade impact
Migration 617 rewrites
connection_logsunder anACCESS EXCLUSIVElock.vscodeandjetbrainsrows becomesshrows with appvscodeorjetbrains. Other rows keep their method and have no app.ssh.Single runs on indexed PostgreSQL 13 with 2 CPUs and 6 GB, excluding lock waits. Not a deployment guarantee.
Design decisions
type:? It has shipped since v2.25.0, the old Type menu wrote it into page URLs, and the old "Active SSH connections" preset usedtype:ssh. Removing it would break saved links and scripts.typeresponse field andexcluded_app_names. Both follow one rule (db2sdk.ConnectionLogType), so there is no separate invariant to maintain.excluded_app_names? Onlytype:sshneeds it. It means SSH outside the VS Code and JetBrains families, including connections with no reported app.type:combine with the new filters? Old clients only sendtype:, and mixing a legacy alias with its replacements has no useful meaning.family:filter? It could never be complete, because new forks can show up before they're in the registry, and several family values would match nothing. A repeatableapp:covers the same need.app:matches what the response returns inapp_name. Other methods store a destination slug or port in the same column, which belongs in separateworkspace_app:andport:filters (follow-up).Stack
Land #30466 → #30467. #30467 adds explicit agent reporting on top of this PR. The insights stack (#30497 → #29796 → #29906) is independent. Replaces #29674.
Review guide and line breakdown
Counts are relative to
main. Generated API reference counts as generated; stories and fixtures count as tests.typegen dbenumscodersdk/dbenums_gen.goOut of scope: explicit agent wire fields (#30467),
workspace_app:andport:filters, JetBrains per-product propagation, and a raw port-forward producer.Generated with Coder Agents on behalf of @EhabY.