-
Notifications
You must be signed in to change notification settings - Fork 25
fix enums_are_equivalent when order doesn't match #3142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix enums_are_equivalent when order doesn't match #3142
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughSingle-file modification to the ClickHouse diff strategy module: enum equivalence checking is now order-insensitive, using name-based lookups and cross-mapping logic between string/int enum variants, supported by comprehensive test coverage for various ordering and mapping scenarios. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (4)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
/review |
Code Review Agent Run #8217efActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Changelist by BitoThis pull request implements the following key changes.
|
Interaction Diagram by BitosequenceDiagram
participant CLI as CLI Routine
participant DiffCalc as compute_table_columns_diff<br/>🔄 Updated | ●●○ Medium
participant ColEq as columns_are_equivalent
participant ColTypeEq as column_types_are_equivalent
participant EnumEq as enums_are_equivalent<br/>🔄 Updated | ●●● High
participant DB as Database Schema
participant Result as Schema Diff Result
Note over EnumEq: Order-insensitive enum matching<br/>by name, not index
CLI->>DiffCalc: Start table schema comparison
DiffCalc->>DiffCalc: Iterate through columns
DiffCalc->>ColEq: Check if column equivalent
ColEq->>ColTypeEq: Compare column data types
alt [Column has Enum type]
ColTypeEq->>EnumEq: Compare enum members
EnumEq->>EnumEq: Find by name, not index
EnumEq-->>ColTypeEq: Enums equivalent (order-insensitive)
else [Column has other type]
ColTypeEq-->>ColEq: Types equivalent
end
ColEq-->>DiffCalc: Column unchanged or changed
DiffCalc-->>Result: Return column changes
Result-->>CLI: Schema diff result
Critical path: CLI Routine -> compute_table_columns_diff -> columns_are_equivalent -> column_types_are_equivalent -> enums_are_equivalent (MODIFIED) -> Schema Diff Result
If the interaction diagram doesn't appear, refresh the page to render it. You can disable interaction diagrams by customizing agent settings. Refer to documentation. |
Code Review Agent Run #63fbc9Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Note
Make
enums_are_equivalentcompare members by name/value (order-insensitive) and add tests for varied ordering across string/int/metadata cases.diff_strategy.rs):enums_are_equivalentto compare members by name/value instead of index (order-insensitive), including string↔int cross-mapping for TypeScript string enums vs ClickHouse.Written by Cursor Bugbot for commit 148ae59. This will update automatically on new commits. Configure here.
Summary by Bito