Skip to content

Cloud dashboards: clean up merged control-plane logging - #9944

Merged
saddlepaddle merged 4 commits into
mainfrom
superset/imp-p-clean-up-merged-product-code-d2a7d0ad
Nov 18, 2026
Merged

saddlepaddle merged 4 commits into
mainfrom
superset/imp-p-clean-up-merged-product-code-d2a7d0ad

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

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.

Written for commit 522fcde. Summary will update on new commits.

View guided diff Turn on auto-fix

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.

saddlepaddle and others added 4 commits November 18, 2026 03:47
queueProvision moved the row to failed but sent no nudge, so other
members' sidebars kept the workspace in provisioning until some other
change. The provision job and the wake path already nudge after they
fail a row; queueProvision has the organization id since #9936.

Co-Authored-By: Claude <noreply@anthropic.com>
provision and queueProvision each wrote the same block: move the row to
failed, nudge, write workspace.failed, capture the error if the row moved.
That block now lives once in transition.ts. Same from, to and set; every
caller keeps its console.error line word for word. No behaviour change.

markSandboxUnavailable in wake.ts is the third copy; it moves to this
function after #9930, which edits wake.ts, merges.

Co-Authored-By: Claude <noreply@anthropic.com>
failCloudWorkspace wrote workspace.failed at error level even when the
transition matched no row, so the log claimed a failure another write
had already recorded (or a delete had overtaken). It now writes the
record, and captures, only when this call moved the row to failed, and
the status.changed attribute is gone because the event now means it.

control-log.test.ts tested that logControl calls Sentry.logger; the
provision tests check the whole record, so it is removed. provision.test
gains the case where the row did not move.

Co-Authored-By: Claude <noreply@anthropic.com>
… db enum

- renew-chatgpt-sign-ins builds its capture tags with controlTags, like the
  cloud workspace routes, instead of by hand.
- BOX_GB_MINUTES_FEATURE_ID and ACTIVE_CPU_MINUTES_FEATURE_ID satisfy the
  cloud_usage_feature enum from 0196, so a rename on either side fails
  typecheck instead of writing rows Autumn does not know. No billing call
  changes.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Provisioning and queue failures now use a shared workspace failure handler. The changes also update Sentry control tags for sign-in renewal and add compile-time checks for two cloud usage feature IDs.

Changes: Cloud workspace failure handling

Layer / File(s) Summary
Shared failure transition and reporting
packages/trpc/src/router/cloud-workspace/transition.ts, packages/trpc/src/lib/control-log.test.ts
Adds failCloudWorkspace to transition eligible workspaces, notify the organization, log failures, and capture non-refusal errors when a row changes. Removes the logControl test.
Provisioning and queue failure callers
packages/trpc/src/router/cloud-workspace/provision.ts, packages/trpc/src/router/cloud-workspace/provision.test.ts, packages/trpc/src/router/cloud-workspace/start.ts, packages/trpc/src/router/cloud-workspace/start.test.ts
Provisioning and queue failure paths call the shared handler with their allowed source states and failure site. Tests cover refusal handling, unchanged rows, and queue-failure notification.
Shared Sentry control tags
packages/trpc/src/lib/sandbox/renew-chatgpt-sign-ins.ts
Sign-in renewal passes workspace and organization IDs to Sentry through controlTags.

Cloud usage feature types

Layer / File(s) Summary
Feature ID type checks
packages/auth/src/lib/billing/autumn/features.ts
The two exported feature ID constants retain their values and gain compile-time checks against CloudUsageFeature.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

Suggested reviewers: harshithmullapudi

Merge Risk: Minimal · up to 522fc

This change consolidates cloud workspace failure handling and adds a missing sidebar nudge when queueing fails. No actionable merge-blocking risk was found. Saved Sentry searches that filter on status.changed need updating.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Cloud dashboards: clean up merged control-plane logging" is partially related. The changeset does consolidate control-plane logging for cloud workspaces (failCloudWorkspace, removing status…
Description check Passed The description covers the what and why, lists the four commits, and explains what breaks for consumers (Sentry saved searches on status.changed). It follows the template's "What & why" section. The "…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Cloud dashboards: clean up merged control-plane logging" is partially related. The changeset does consolidate control-plane logging for cloud workspaces (failCloudWorkspace, removing status.changed, removing control-log.test.ts, using controlTags). However, the title refers to "cloud dashboards", which the file summaries do not show. Most changes are in cloud-workspace provisioning and sandbox logging, not dashboards. The title also omits the nudge fix for queueProvision, which is the first commit.

Full details: Description check

Explanation

The description covers the what and why, lists the four commits, and explains what breaks for consumers (Sentry saved searches on status.changed). It follows the template's "What & why" section. The "How I tested it" section is only partly covered: it cites verify-sandbox-asleep passing, but gives no concrete steps and no screenshots. The checklist is absent. The description also uses a conventional-commit-style title only in the commit list, not as a PR title. These gaps are non-critical, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c058f184-c8c7-4bad-88d7-295926e36cf6
Commits

Reviewing files that changed from the base of the PR and between b7268e6 and 522fcde.

Files selected for processing: 8

  • packages/auth/src/lib/billing/autumn/features.ts
  • packages/trpc/src/lib/control-log.test.ts
  • packages/trpc/src/lib/sandbox/renew-chatgpt-sign-ins.ts
  • packages/trpc/src/router/cloud-workspace/provision.test.ts
  • packages/trpc/src/router/cloud-workspace/provision.ts
  • packages/trpc/src/router/cloud-workspace/start.test.ts
  • packages/trpc/src/router/cloud-workspace/start.ts
  • packages/trpc/src/router/cloud-workspace/transition.ts
Files with no reviewable changes: 1

  • packages/trpc/src/lib/control-log.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@expo

expo Bot commented Nov 18, 2026

Copy link
Copy Markdown

Preview update published for development build a983d3d5 (fingerprint 08a5e03ce5fb). Open the build on your phone and scan:

Update group 006b5619

@saddlepaddle
saddlepaddle merged commit 8bcc485 into main Nov 18, 2026
21 checks passed

This branch was previously deployed

1 inactive deployment
preview — 522fcde0 Deployed Nov 18, 2026 by saddlepaddle via Cleanup Preview Resources #5763
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