Draft: fix(cassandra): restore ESS legacy auth compatibility - #475
Draft: fix(cassandra): restore ESS legacy auth compatibility#475sbaum1994 wants to merge 1 commit into
Conversation
Keep the legacy ssa_authorizations column and seeds in the ESS Cassandra schema while supported ESS images still select it. Also restore the NVCT ESS authorization seed and add a forward migration for clusters that consumed the OAuth-only schema. Signed-off-by: Stephanie Baum <sbaum@nvidia.com>
📝 WalkthroughWalkthroughThe Cassandra migrations restore the legacy ChangesLegacy SSA authorization compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@migrations/cassandra/keyspaces/ess_api/05_add_nvct_authorizations.up.sql`:
- Around line 8-10: Make 05_add_nvct_authorizations.up.sql safe for OAuth-only
schemas by ensuring ssa_authorizations exists before the UPDATE that adds NVCT
authorizations, or defer that SSA update until
09_restore_legacy_ssa_authorizations.up.sql restores the column. Preserve both
authorization-map seeding paths and verify the migration ordering for OAuth-only
upgrades.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d50c321f-36ad-4640-9823-7bf81eec9111
📒 Files selected for processing (4)
migrations/cassandra/keyspaces/ess_api/03_init_tables.up.sqlmigrations/cassandra/keyspaces/ess_api/04_init_ncp_namespace.up.sqlmigrations/cassandra/keyspaces/ess_api/05_add_nvct_authorizations.up.sqlmigrations/cassandra/keyspaces/ess_api/09_restore_legacy_ssa_authorizations.up.sql
| UPDATE ess_api.namespaces | ||
| SET | ||
| ssa_authorizations = ssa_authorizations + { |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Restore the column before this migration references it.
05_add_nvct_authorizations.up.sql runs before 09_restore_legacy_ssa_authorizations.up.sql. On clusters created with the OAuth-only schema, ssa_authorizations is absent at line 10, so this migration fails before migration 09 can add the column or seed either authorization map. Make this migration self-contained, or move the SSA update behind the schema-restoration step, and test the OAuth-only upgrade path.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@migrations/cassandra/keyspaces/ess_api/05_add_nvct_authorizations.up.sql`
around lines 8 - 10, Make 05_add_nvct_authorizations.up.sql safe for OAuth-only
schemas by ensuring ssa_authorizations exists before the UPDATE that adds NVCT
authorizations, or defer that SSA update until
09_restore_legacy_ssa_authorizations.up.sql restores the column. Preserve both
authorization-map seeding paths and verify the migration ordering for OAuth-only
upgrades.
|
Closing in favor of established a v0.6.1 release branch #489 |
TL;DR
Restore legacy ESS Cassandra authorization compatibility for self-managed installs while the service migration from
ssa_authorizationstooauth_authorizationsis still in progress.Additional Details
Supported ESS images still select
ess_api.namespaces.ssa_authorizations. Fresh installs with the OAuth-only schema fail because that legacy column is absent.This change keeps the forward OAuth migration path intact while restoring compatibility:
ssa_authorizationsback to the fresh ESS namespace schemanvcf-apiSSA authorization seednvct-apiESS authorization seedssa_authorizationsif a cluster already consumed an OAuth-only migration setThe legacy column should be removed only after all supported ESS versions stop selecting it.
For the Reviewer
Please focus on
migrations/cassandra/keyspaces/ess_api.The compatibility migration is intentionally additive. It does not remove or rewrite
oauth_authorizations.For QA
Ran:
QA needed: yes. Validate a fresh self-managed install with the next 0.6.1 RC and confirm account bootstrap no longer fails on
ssa_authorizations.Issues
Closes #474
Checklist
Summary by CodeRabbit