You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: centralize migration error handling with gRPC readiness middleware
Replaces scattered IsMissingTableError checks (15 files, 157 lines) with a single
gRPC readiness middleware that blocks ALL requests until the datastore is migrated.
Key improvements:
- Single point of control vs copy-pasted checks everywhere
- Impossible to miss code paths - all gRPC requests gated automatically
- Clear error message: "Please run 'spicedb datastore migrate'"
- Cached checks (500ms) with singleflight to prevent thundering herd
- Health probes bypass the gate for Kubernetes compatibility
Net: -81 lines, better coverage, consistent UX.
features.Watch.Reason="Database schema has not been initialized. Please run \"spicedb datastore migrate\": "+err.Error()
597
-
} else {
598
-
features.Watch.Reason="Range feeds must be enabled in CockroachDB and the user must have permission to create them in order to enable the Watch API: "+err.Error()
599
-
}
595
+
features.Watch.Reason="Range feeds must be enabled in CockroachDB and the user must have permission to create them in order to enable the Watch API: "+err.Error()
0 commit comments