Skip to content

Bootstrap self-managed workspace listings#17

Merged
rowantrollope merged 1 commit intocodex/fix-config-state-and-checkpointsfrom
codex/fix-startup-catalog-bootstrap
May 6, 2026
Merged

Bootstrap self-managed workspace listings#17
rowantrollope merged 1 commit intocodex/fix-config-state-and-checkpointsfrom
codex/fix-startup-catalog-bootstrap

Conversation

@abrookins
Copy link
Copy Markdown
Contributor

Stacked on #12.

Problem

In self-managed mode, the control plane could start against a Redis instance that already contained real workspaces, but /v1/workspaces still came back empty until someone manually created a database record with POST /v1/databases.

That made existing workspace data look missing on first boot even though the Redis state was already there. It also made workspace-first routes look less reliable than they actually were.

Why this change

The startup path was only loading catalog database profiles. If the catalog was empty, the manager refreshed nothing, so catalog-backed workspace listing had no database to fan out through.

The fix needs to restore first-run visibility without changing the separate blank-store flow. If Redis is actually empty, startup should still stay empty and let ListDatabases, Quickstart, or an explicit database create drive bootstrap.

What changed

  • OpenDatabaseManager now performs a startup-only bootstrap pass before the initial catalog refresh.
  • That startup bootstrap only materializes a database profile when the configured Redis already contains workspaces.
  • When live workspaces already carry a database identity, the bootstrap path adopts that identity instead of inventing a parallel Local Development record.
  • Request-time bootstrap behavior remains in place for the existing ListDatabases and Quickstart flows.
  • Regression coverage now covers both halves of the contract:
    • empty self-managed stores stay unregistered on startup
    • preexisting local workspaces are visible without a manual POST /v1/databases
  • The single-database HTTP fixture now uses the same default local workspace metadata shape as the real product.

Testing

  • go test ./internal/controlplane
  • go test ./cmd/afs -run 'TestCmdImportSelfHostedForceReplacePreservesVersioningHistory|TestCloudModeUsesHTTPControlPlaneBackend|TestOpenAFSControlPlaneSelfHostedSingleDatabaseStillWorksWithoutConfiguredDatabase|TestPrepareSyncBootstrapSelfHostedIgnoresStaleConfiguredDatabaseForWorkspaceFirstRoutes|TestDatabaseListAndUseSelfHosted|TestRunSetupWizardSelfHostedPicksExistingWorkspace|TestRunSetupWizardSelfHostedSupportsLiveMountMode'
  • make test

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 6, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@rowantrollope rowantrollope merged commit 0a86a6a into codex/fix-config-state-and-checkpoints May 6, 2026
1 check passed
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.

2 participants