fix: cloud sidebar PR links open the PR pane; pass creator id to start hook

Merged
SA
2mo ago
+50-10

Summary

Two small fixes for cloud workspaces.

Cloud sidebar PR links open the workspace's PR pane

Clicking the PR icon on a cloud sidebar row, or the PR in the row's hover card, used to go to /pull-requests/:number. Both now navigate to the workspace and open its pull-request pane, the same as local sidebar rows and the v2 workspaces list. This uses the existing usePullRequestPaneIntent store through a new useOpenCloudWorkspacePullRequest hook. A URL that is not a GitHub PR link opens externally.

Cloud workspaces come up signed in again

setup.cloud.sh runs db:seed-cloud-auth-token to sign the desktop dev app in as the workspace creator, but the seed always skipped with "no workspace creator". The creator id is in /etc/superset/sandbox.conf, but it was dropped twice on the way to the start hook:

  1. superset-boot starts host-service with env -i and an allowlist that did not include SUPERSET_SANDBOX_CREATOR_USER_ID or SUPERSET_SANDBOX_ORGANIZATION_ID.
  2. buildStartHookEnv strips every SUPERSET_* key that is not on the terminal keep list, and added back only the workspace id.

Both now pass the org id and the creator id (when set). seed-cloud-mobile-token had the same problem and gets the same fix. Boxes pick this up after the Sandbox workflow's production-release runs.

Validation

  • bun test for buildStartHookEnv: 4 pass, including new cases for keeping the ids and leaving out a missing creator.
  • bash -n superset-boot is clean.
  • Desktop bun run typecheck and biome are clean.
  • Not verified end to end: I did not click through the sidebar in a running app, and I did not boot a sandbox with the new bundle.

Summary by cubic

Fixes two cloud workspace issues: sidebar PR links now open the workspace's PR pane, and cloud workspaces come up signed in again.

Bug Fixes

  • Cloud sidebar PR links and hover-card PRs now navigate to the workspace with its pull-request pane open, instead of going to /pull-requests; non-PR URLs still open externally.
  • superset-boot's env allowlist and buildStartHookEnv now pass SUPERSET_SANDBOX_ORGANIZATION_ID and SUPERSET_SANDBOX_CREATOR_USER_ID to the start hook, so the seed-cloud-auth-token and seed-cloud-mobile-token seeds stop skipping and sign the desktop dev app in as the workspace creator.
  • Boxes pick up the sandbox fix after the Sandbox workflow's production-release runs.

Summary by CodeRabbit

  • New Features
    • Opening a pull-request link from a cloud workspace now takes you to that workspace with its pull-request pane selected.
    • Links that aren’t recognized as pull requests continue to open externally.
  • Bug Fixes
    • Sandbox startup now preserves available workspace, organization, and creator identity details in its environment.