Add Deploy tab: cross-workspace Genie Space deployment with catalog remapping#78
Open
Add Deploy tab: cross-workspace Genie Space deployment with catalog remapping#78
Conversation
Frontend: - Add collapsible Deployment section to OptimizationConfig with target workspace URL, target space ID, and catalog mapping (source→target) - Extend GSOTriggerRequest with deploy_space_id and catalog_map fields Backend: - Extend TriggerRequest with deploy_space_id and catalog_map - Forward new params through trigger → job_launcher → job parameters GSO: - Add catalog_map widget to run_cross_env_deploy notebook - Remap table/metric_view identifiers before applying to target workspace (e.g. dev_catalog.schema.table → prod_catalog.schema.table) - Forward deploy_space_id and catalog_map through trigger and job_launcher Co-authored-by: Isaac
- RunDetailView: add deployment status banner showing target workspace, status (PENDING_APPROVAL/DEPLOYED/FAILED), and link to target workspace Color-coded: green=deployed, blue=pending, red=failed - Backend: expose deployTarget at top-level run response (was only in step detail before) - Types: add deployTarget to GSOPipelineRun interface Co-authored-by: Isaac
The PATCH API rejects user_api_scopes on workspaces without the token passthrough feature, causing ALL resources (including sql-warehouse and postgres) to not be attached. The error was hidden by 2>/dev/null. Fix: try PATCH with scopes first; if it fails, retry with resources only. This ensures the warehouse and Lakebase resources are always attached regardless of workspace feature flags. Co-authored-by: Isaac
Move deployment config from OptimizationConfig (auto-deploy during
pipeline) to RunDetailView (on-demand after optimization completes).
Frontend:
- Revert OptimizationConfig to original (no deployment section)
- Add "Deploy to Workspace" collapsible panel in RunDetailView for
completed runs (CONVERGED/STALLED/MAX_ITERATIONS/APPLIED)
- Pre-fill config from localStorage, save on successful deploy
- Show deployment status banner for runs that have been deployed
Backend:
- Add POST /api/auto-optimize/runs/{run_id}/deploy endpoint
- Validates run is terminal, has UC model, then triggers deployment job
- Uses existing ensure_deployment_job() from GSO job_launcher
API:
- Add deployOptimizationRun() in api.ts
Co-authored-by: Isaac
New DeployTab component: - Top-level tab in SpaceDetail alongside Score, Optimize, History - Deployment config: target workspace URL, space ID, catalog mappings - Config remembered via localStorage across sessions - Shows completed optimization runs as selectable cards - Deploy button triggers cross-env deployment job - Success/error feedback with link to target workspace RunDetailView cleaned up: - Removed deploy dialog (moved to DeployTab) - Kept deployment status banner for already-deployed runs Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Backend:
- Replace POST /runs/{run_id}/deploy with POST /spaces/{space_id}/deploy
- Fetches current space config via Genie API (get_serialized_space)
- Applies catalog remapping in-memory
- PATCHes directly to target workspace via patch_space_config
- No UC model, no optimization run, no deployment job required
Frontend:
- Simplify DeployTab: remove run selection (not needed)
- Just enter target config and click Deploy
- deploySpace() API replaces deployOptimizationRun()
Co-authored-by: Isaac
The app SP isn't registered in the target workspace. Use the user's OBO token instead — the user is authenticated in both workspaces. Co-authored-by: Isaac
Use the app's SP credentials (client_id + client_secret) to authenticate to the target workspace. The SP must be registered in the target workspace — this is a one-time admin setup. Co-authored-by: Isaac
When target space ID is not provided, create a new Genie Space in the target workspace using POST /api/2.0/genie/spaces with: - Title from the source space - First available SQL warehouse in target workspace - Parent path /Shared/ - Remapped serialized config When target space ID is provided, PATCH the existing space as before. Also return spaceUrl in the response so the frontend can link directly to the newly created Genie Space. Co-authored-by: Isaac
Document permission requirements: SP registration, Genie Space permissions, target catalog existence, and table access grants. Co-authored-by: Isaac
Catalogs are accessed via shared metastore or target metastore configuration, not 'exist in the target workspace'. List the specific UC grants needed (USE_CATALOG, USE_SCHEMA, SELECT). Co-authored-by: Isaac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev_bank.retail.*→prod_bank.retail.*)user_api_scopesnot supported on workspace (was silently dropping all resources including sql-warehouse and postgres)Architecture
The app's SP must be registered in the target workspace. No UC model or optimization run required — works with any Genie Space.
Test plan
This pull request was AI-assisted by Isaac.