-
Notifications
You must be signed in to change notification settings - Fork 12
Implement apply() for cluster configuration changes #110
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
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 adds the ability to diff and apply cluster configuration changes by implementing ApplyAsync() (and its helper WriteAsync/ExecuteClusterScriptAsync) in KustoClusterHandler and KustoClusterOrchestrator, refactors handlers to use ICslAdminProvider, and updates the capacity policy model to include MirroringCapacity.
- Introduces
ApplyAsyncinKustoClusterOrchestratorto load YAML, generate diffs, and execute scripts. - Implements
WriteAsyncandExecuteClusterScriptAsyncinKustoClusterHandlerto batch and run cluster scripts. - Updates
ClusterCapacityPolicyand related classes to addMirroringCapacityand refactor capacities.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Parser/YamlClusterHandlerFactory.cs | Implements IYamlClusterHandlerFactory |
| Parser/KustoClusterHandlerFactory.cs | Passes AdminClient to handler instead of full client |
| Parser/KustoClusterHandler.cs | Replaces KustoClient with ICslAdminProvider, adds script execution methods |
| Model/ClusterCapacityPolicy.cs | Adds MirroringCapacity, refactors materialized view capacity classes |
| KustoClusterOrchestrator.cs | Adds ApplyAsync for full apply workflow |
| Tests/Parser/KustoClusterHandlerTests.cs | Adds unit tests for WriteAsync and LoadAsync |
| Tests/KustoClusterOrchestratorTests.cs | Updates tests to use ICslAdminProvider mocks |
| Tests/Changes/ClusterChangesTest.cs | Refactors test helpers to match capacity policy changes |
Comments suppressed due to low confidence (1)
KustoSchemaTools.Tests/KustoClusterOrchestratorTests.cs:6
- Essential
usingdirectives for Xunit ([Fact]),System.Threading.Tasks(async/Task), andSystem.Collections.Generic(List<>) were removed, causing compilation errors. Re-add these namespaces at the top of the test file.
using Kusto.Data.Common;
Co-authored-by: Copilot <[email protected]>
Overview
This pull request implements
ApplyAsync()and its helper methods. The method is used to generate changes between the current state (the live Kusto cluster) and a desired state (YAML config file). It then executes those changes by running the change scripts on the Kusto cluster.This PR is a follow-up to #106.
https://github.com/github/data/issues/9010
Changes
ApplyAsync()which diffs then executes cluster configuration changesKustoClusterHandlerto execute cluster scriptsKustoClusterHandlerfor better testabilityClusterCapacityPolicymodel to have parity with the model returned by.show cluster policy capacity