feat(migrator): [5/7] Interactive migration wizard with step-by-step field operations and algorithm-aware validation#564
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b94e57ae6f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Adds an interactive CLI “migration wizard” for building SchemaPatch changes step-by-step (add/update/remove/rename fields, index name, prefix) and generating a MigrationPlan via the existing migration planner, plus extensive unit tests for vector algorithm/datatype/compression input handling.
Changes:
- Introduces
redisvl.migration.wizard.MigrationWizardto interactively stage schema changes and output a plan/patch/merged target schema. - Adds a large unit test suite validating wizard behavior for vector algorithm changes, datatype constraints, distance metrics, and adversarial inputs.
- Exports
MigrationWizardfromredisvl.migration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
redisvl/migration/wizard.py |
New interactive wizard for constructing schema patches and plans with vector-aware prompts. |
tests/unit/test_migration_wizard.py |
New unit tests covering interactive input flows, especially vector configuration edge cases. |
redisvl/migration/__init__.py |
Re-exports MigrationWizard from the migration package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b94e57ae6f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b94e57ae6f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Filter staged additions from update/rename candidate lists - Cancel staged-add on remove instead of appending to remove_fields - Add _filter_staged_adds helper method - Reflect update_fields in working schema (_apply_staged_changes) - Prevent no-op vector algorithm update when user enters current value
e052930 to
634cfa1
Compare
b94e57a to
541db34
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 541db34af2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ep field operations and algorithm-aware validation Interactive CLI wizard for building migration plans step by step. Supports adding, removing, renaming, and updating fields with algorithm-aware validation including SVS-VAMANA datatype enforcement, HNSW parameter tuning, and compression/LeanVec configuration. Includes wizard unit tests.
- Filter staged additions from update/rename candidate lists - Cancel staged-add on remove instead of appending to remove_fields - Add _filter_staged_adds helper method - Reflect update_fields in working schema (_apply_staged_changes) - Prevent no-op vector algorithm update when user enters current value
- Remove queued updates/renames when a field is deleted - Apply index-level changes (name, prefix) in staged preview schema - Merge duplicate updates for the same field instead of appending
634cfa1 to
cecfd9d
Compare
541db34 to
7eea293
Compare
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eea293e59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| changes.update_fields = [ | ||
| u for u in changes.update_fields if u.name != field_name | ||
| ] | ||
| changes.rename_fields = [ | ||
| r for r in changes.rename_fields if r.old_name != field_name |
There was a problem hiding this comment.
Drop stale rename/update when removing renamed field
When a user stages update old_name, then rename old_name -> new_name, and finally removes new_name, this block only clears entries where u.name/r.old_name equals the removed name. That leaves the original update and rename in the patch, so create_plan_from_patch can fail with Cannot update field ... because it does not exist after rename+remove are applied. This makes a valid interactive flow crash at planning time instead of producing a consistent patch.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| ) | ||
| field_rename = self._prompt_rename_field(rename_schema) | ||
| if field_rename: | ||
| changes.rename_fields.append(field_rename) |
There was a problem hiding this comment.
Rename allows collision with staged addition names
Medium Severity
When handling action "4" (rename), _filter_staged_adds removes staged additions from rename_schema before passing it to _prompt_rename_field. Inside that method, the duplicate-name check on existing_names only considers fields in the filtered schema. This means a user can rename an existing field to a name that's already staged for addition (e.g., add "B", then rename "A" → "B"), producing duplicate field names in the working schema and a potentially invalid patch.
Additional Locations (1)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eea293e59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| changes.update_fields = [ | ||
| u for u in changes.update_fields if u.name != field_name | ||
| ] | ||
| changes.rename_fields = [ | ||
| r for r in changes.rename_fields if r.old_name != field_name |
There was a problem hiding this comment.
Drop stale ops when removing a field after rename
When a user renames a field and then removes that renamed field, field_name is the new name, but this branch only deletes queued updates by exact u.name and renames by r.old_name. That leaves stale operations for the same logical field (e.g., title -> headline plus remove headline), which can either trigger unintended document rewrites on HASH indexes (rename still executes) or raise a planning error if an old-name update remains and merge_patch resolves it to a field already removed. The remove path should clear both old/new-name references for queued updates and renames.
Useful? React with 👍 / 👎.


Summary
Interactive CLI wizard for building migration plans step by step. Supports adding, removing, renaming, and updating fields with algorithm-aware validation including SVS-VAMANA datatype enforcement, HNSW parameter tuning, and compression/LeanVec configuration.
Files
redisvl/migration/wizard.pyStack
Note
Medium Risk
Adds a new interactive path to generate migration plans/patches (including index/key/field rename operations), which could lead to destructive or expensive migrations if the wizard logic or prompts are incorrect; mitigated by extensive unit test coverage.
Overview
Introduces an interactive
MigrationWizardfor step-by-step creation ofSchemaPatchchanges (add/update/remove/rename fields, rename index, and change key prefix) and writes out a migration plan plus optional patch/target-schema YAML outputs.The wizard stages and previews pending changes, supports loading an existing patch, and includes algorithm-aware prompting for vector field updates (e.g., HNSW vs SVS-VAMANA options, datatype constraints, compression/LeanVec settings). A large new unit test suite exercises interactive flows and edge cases for vector configuration and invalid inputs.
Exports
MigrationWizardfromredisvl.migration.__init__for public use.Written by Cursor Bugbot for commit 7eea293. This will update automatically on new commits. Configure here.