Skip to content

feat(migrator): [5/7] Interactive migration wizard with step-by-step field operations and algorithm-aware validation#564

Open
nkanu17 wants to merge 5 commits intofeat/migrate-batchfrom
feat/migrate-wizard
Open

feat(migrator): [5/7] Interactive migration wizard with step-by-step field operations and algorithm-aware validation#564
nkanu17 wants to merge 5 commits intofeat/migrate-batchfrom
feat/migrate-wizard

Conversation

@nkanu17
Copy link
Copy Markdown
Collaborator

@nkanu17 nkanu17 commented Apr 1, 2026

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.py
  • Wizard unit tests

Stack

  1. [1/7] Migration foundation > feat(migrator): [1/7] Migration foundation with models, schema-aware planner, validation, and shared utilities #560
  2. [2/7] Sync executor with reliability and quantization > feat(migrator): [2/7] Sync executor with reliability checkpointing, crash-safe resume, and quantization support #561
  3. [3/7] Async migration > feat(migrator): [3/7] Async migration with non-blocking planner, executor, validator, and readiness utilities #562
  4. [4/7] Batch migration > feat(migrator): [4/7] Batch migration with multi-index glob selection, ordered execution, and state tracking #563
  5. [5/7] Interactive wizard (this PR)
  6. [6/7] CLI and documentation
  7. [7/7] Benchmarks

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 MigrationWizard for step-by-step creation of SchemaPatch changes (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 MigrationWizard from redisvl.migration.__init__ for public use.

Written by Cursor Bugbot for commit 7eea293. This will update automatically on new commits. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci bot commented Apr 1, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@nkanu17
Copy link
Copy Markdown
Collaborator Author

nkanu17 commented Apr 1, 2026

@codex review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.MigrationWizard to 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 MigrationWizard from redisvl.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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nkanu17
Copy link
Copy Markdown
Collaborator Author

nkanu17 commented Apr 1, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

nkanu17 added a commit that referenced this pull request Apr 2, 2026
- 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
@nkanu17 nkanu17 force-pushed the feat/migrate-batch branch from e052930 to 634cfa1 Compare April 2, 2026 00:30
@nkanu17 nkanu17 force-pushed the feat/migrate-wizard branch from b94e57a to 541db34 Compare April 2, 2026 00:30
@nkanu17
Copy link
Copy Markdown
Collaborator Author

nkanu17 commented Apr 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

nkanu17 added 5 commits April 1, 2026 23:57
…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
@nkanu17 nkanu17 force-pushed the feat/migrate-batch branch from 634cfa1 to cecfd9d Compare April 2, 2026 03:58
@nkanu17 nkanu17 force-pushed the feat/migrate-wizard branch from 541db34 to 7eea293 Compare April 2, 2026 03:58
@nkanu17
Copy link
Copy Markdown
Collaborator Author

nkanu17 commented Apr 2, 2026

@codex review

1 similar comment
@nkanu17
Copy link
Copy Markdown
Collaborator Author

nkanu17 commented Apr 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +249 to +253
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +249 to +253
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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