Cloud dashboards: clean up merged control-plane logging

Merged
SA
20h ago
+143-108

What and why

A review of the control-plane logging (#9927, #9936) and schema 0196 (#9933) that are already on main. There are four commits:

  1. fix(cloud): nudge clients when a provision cannot be queued. queueProvision moved the row to failed but sent no nudge, so other members' sidebars kept the workspace in provisioning. Includes a regression test (start.test.ts).
  2. refactor: failCloudWorkspace next to transitionCloudWorkspace (no behaviour change). One function replaces the "mark failed → nudge → workspace.failed → capture if moved" block in provision.ts and start.ts. Same from/to/set, and every console.error line stays word for word.
  3. refactor: workspace.failed only when the row moved. Before, it was written at error level even when the transition matched no row. The status.changed attribute is removed, and so is lib/control-log.test.ts, which tested the logger and not behaviour.
  4. refactor: one way to tag captures, and feature ids tied to the db enum. renew-chatgpt-sign-ins uses controlTags, and the Autumn feature ids satisfies CloudUsageFeature.

The PR does not change meter.ts, wake.ts or lib/sandbox/vercel.ts, because #9930 edits them. Findings for those files are on the evidence page. No billing call changes, and no status write changes: the one write that moves keeps the same from/to/set. verify-sandbox-asleep passes, with the expected state count.

Size: 8 files. Code is +66/−46 and tests +77/−62. The helper saves lines only when wake.ts's markSandboxUnavailable uses it too, after #9930.

What breaks and for whom

No client API change. In Sentry Logs, workspace.failed records from the provision and queue sites no longer carry status.changed, and they are no longer written when the row did not move. A saved search that filters on status.changed:true must drop that filter. Details are on the evidence page.

Links

🤖 Generated with Claude Code


Summary by cubic

Cleans up the control-plane logging merged from #9927, #9936, and #9933, and fixes a missing nudge when a provision cannot be queued.

  • queueProvision now nudges the organization's clients after marking the row failed, so other members' sidebars no longer keep the workspace in provisioning; covered by a new regression test in start.test.ts.
  • Extracts failCloudWorkspace into transition.ts to replace the repeated mark-failed → nudge → log → capture block in provision.ts and start.ts.
  • workspace.failed is now written only when this call actually moved the row; the status.changed attribute is dropped, and control-log.test.ts is removed since the provision tests now check the whole record.
  • renew-chatgpt-sign-ins builds its capture tags with controlTags, and the Autumn feature ids are typed against the cloud_usage_feature enum.

Impact
No client API change. workspace.failed records from the provision and queue sites no longer carry status.changed and are not written when the row did not move; saved searches filtering on status.changed:true must drop that filter. No billing call changes and no status-write changes.

Summary by CodeRabbit

  • Bug Fixes
    • Cloud workspace provisioning failures now refresh the workspace list when the workspace state changes, helping its displayed status stay current.
    • Failures that do not change the workspace state no longer trigger failure reporting.