Skip to content

feat(coderd): include shared workspaces in workspace updates#25403

Open
aslilac wants to merge 1 commit into
mainfrom
lilac/shared-workspaces-updates
Open

feat(coderd): include shared workspaces in workspace updates#25403
aslilac wants to merge 1 commit into
mainfrom
lilac/shared-workspaces-updates

Conversation

@aslilac
Copy link
Copy Markdown
Member

@aslilac aslilac commented May 15, 2026

Widen the workspace-updates stream so it covers workspaces shared with the user via user_acl / group_acl, not only ones they own. Unblocks shared-workspaces support in Coder Desktop with no proto changes.

  • GetWorkspacesAndAgentsByOwnerID drops the hard owner_id filter; the existing @authorize_filter (ActionRead on rbac.ResourceWorkspace) already covers owned + ACL-shared workspaces.
  • sub now also subscribes to wspubsub.AllWorkspaceEventChannel so build events on shared workspaces wake up its diff/requery flow.
  • Tests cover the SQL path (sharedUser sees the one shared workspace, owner still sees all, unrelated user still sees none) and the pubsub path (build update on the all-channel produces the expected delta).
Notes for reviewers
  • ownerID is removed end-to-end from GetWorkspacesAndAgentsByOwnerID / GetAuthorizedWorkspacesAndAgentsByOwnerID. The name is kept to avoid further churn; a rename can land separately.
  • The all-channel currently carries WorkspaceBuildUpdate payloads (not WorkspaceEvent), so the new subscription uses HandleWorkspaceBuildUpdate and just triggers a re-query. Agent-only events for shared workspaces will not wake the subscriber, but produceUpdate will still pick up any state diff on the next build or owner-side event.
  • No proto, audit table, or CLI changes.

Generated with Coder Agents on behalf of @aslilac.

Widen the WorkspaceUpdate stream so it covers workspaces shared with the
user via user_acl / group_acl, not just workspaces they own. This
unblocks shared-workspace support in Coder Desktop without any proto
changes.

- Drop the hard owner_id filter from GetWorkspacesAndAgentsByOwnerID;
  the existing @authorize_filter (ActionRead on rbac.ResourceWorkspace)
  already covers both owned and ACL-shared workspaces.
- Also subscribe to wspubsub.AllWorkspaceEventChannel so build events
  on shared workspaces wake up the subscriber's diff/requery flow.

Generated with Coder Agents on behalf of @aslilac.
@aslilac aslilac changed the title feat(coderd/workspaceupdates): include shared workspaces feat(coderd): include shared workspaces in workspace-updates stream May 15, 2026
@aslilac aslilac changed the title feat(coderd): include shared workspaces in workspace-updates stream feat(coderd): include shared workspaces in workspace updates May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant