Implement apply() for cluster configuration changes #110
Merged
ashleyvansp merged 9 commits intomainfrom Jul 4, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 <175728472+Copilot@users.noreply.github.com>
alex-slynko
approved these changes
Jul 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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