- Notifications
You must be signed in to change notification settings - Fork13
column order validation feature#125
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 ourterms of service andprivacy 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?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR introduces an optional column order validation feature that prevents new columns from being inserted before existing columns in Kusto table definitions, which can cause update policy failures. The feature is disabled by default and can be enabled via theKUSTO_ENABLE_COLUMN_VALIDATION environment variable or programmatically.
Key Changes:
- Added
ValidationSettingsclass to manage feature flags with environment variable support - Implemented
ColumnOrderValidatorto detect when existing columns appear after new columns in table definitions - Modified
DatabaseChanges.GenerateChangesto optionally apply validation and block deployments with violations
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the column order validation feature, configuration options, and example scenarios |
| KustoSchemaTools/Validation/ValidationResult.cs | New class representing validation success/failure with error messages and severity levels |
| KustoSchemaTools/Validation/ColumnOrderValidator.cs | Core validation logic that checks column ordering rules |
| KustoSchemaTools/Configuration/ValidationSettings.cs | Configuration class with environment variable parsing for feature flags |
| KustoSchemaTools/Changes/DatabaseChanges.cs | Updated to accept validation settings and apply column order checks to table changes |
| KustoSchemaTools.Tests/Parser/KustoClusterHandlerTests.cs | Fixed null forgiving operator usage in test |
| KustoSchemaTools.Tests/Validation/ColumnOrderValidatorTests.cs | Comprehensive unit tests for column order validation logic |
| KustoSchemaTools.Tests/Configuration/ValidationSettingsTests.cs | Tests for configuration parsing and environment variable handling |
| KustoSchemaTools.Tests/Changes/DatabaseChangesValidationFlagTests.cs | Tests verifying validation is only applied when enabled |
| KustoSchemaTools.Tests/Changes/DatabaseChangesColumnValidationTests.cs | Integration tests for validation behavior with various table scenarios |
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
ianwinsemius commentedOct 29, 2025
There have been a couple of incidents related to the order of columns in Kusto not lining up correctly that have been able to merge in warehouse-config. Being able to validate the order of columns prior to merging would potentially prevent future incidents like this. It became clear that the intent of this update wasn't obvious during a discussionearlier. Ref: |
…emoved redundant validation check at writer level
The purpose of this feature is to prevent alterations to existing tables that would insert new columns before existing ones.
KUSTO_ENABLE_COLUMN_VALIDATION must be set to
truein order for this check to come into play. This preserves the current default behavior to prevent existing workflows from being unexpectedly disrupted.When set:
Included are unit tests, documentation, etc.