Cloud dashboards: clean up merged control-plane logging
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:
- fix(cloud): nudge clients when a provision cannot be queued.
queueProvisionmoved the row tofailedbut sent no nudge, so other members' sidebars kept the workspace inprovisioning. Includes a regression test (start.test.ts). - refactor:
failCloudWorkspacenext totransitionCloudWorkspace(no behaviour change). One function replaces the "mark failed → nudge → workspace.failed → capture if moved" block inprovision.tsandstart.ts. Same from/to/set, and everyconsole.errorline stays word for word. - refactor:
workspace.failedonly when the row moved. Before, it was written at error level even when the transition matched no row. Thestatus.changedattribute is removed, and so islib/control-log.test.ts, which tested the logger and not behaviour. - refactor: one way to tag captures, and feature ids tied to the db enum.
renew-chatgpt-sign-insusescontrolTags, and the Autumn feature idssatisfies 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
- Evidence: https://app.superset.sh/page/imp-p-clean-up-of-merged-product-code-4kersh
- Design: https://app.superset.sh/page/admin-cloud-workspace-cost-and-health-design-8z3d4d
🤖 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.
queueProvisionnow nudges the organization's clients after marking the row failed, so other members' sidebars no longer keep the workspace inprovisioning; covered by a new regression test instart.test.ts.- Extracts
failCloudWorkspaceintotransition.tsto replace the repeated mark-failed → nudge → log → capture block inprovision.tsandstart.ts. workspace.failedis now written only when this call actually moved the row; thestatus.changedattribute is dropped, andcontrol-log.test.tsis removed since the provision tests now check the whole record.renew-chatgpt-sign-insbuilds its capture tags withcontrolTags, and the Autumn feature ids are typed against thecloud_usage_featureenum.
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.