-
Notifications
You must be signed in to change notification settings - Fork 9
Add support for managing cluster capacity policy #106
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
…Combine Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
….Combine Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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 support for managing Kusto cluster capacity policies by extending the existing YAML and live-cluster handlers, models, and change orchestration to include capacityPolicy definitions and diff generation.
- Introduces
YamlClusterHandler
and factory to parsecapacityPolicy
from YAML. - Adds
KustoClusterHandler
and factory to load live cluster capacity policies via control commands. - Extends orchestrator, change models, and tests to detect, report, and script capacityPolicy changes.
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
KustoSchemaTools/Parser/YamlClusterHandlerFactory.cs | Added factory class for YAML handler |
KustoSchemaTools/Parser/YamlClusterHandler.cs | Implemented async loading of clusters with capacityPolicy from YAML |
KustoSchemaTools/Parser/KustoClusterHandlerFactory.cs | Added factory using DI for creating live-cluster handler |
KustoSchemaTools/Parser/IKustoClusterHandlerFactory.cs | Introduced interface for Kusto handler factory |
KustoSchemaTools/Parser/KustoClusterHandler.cs | Implemented async loading of live cluster capacity policy |
KustoSchemaTools/Model/ClusterCapacityPolicy.cs | Added model and nested capacity classes for cluster policies |
KustoSchemaTools/Model/Cluster.cs | Extended Cluster to include optional CapacityPolicy |
KustoSchemaTools/KustoClusterOrchestrator.cs | Updated orchestrator to generate and sequence capacityPolicy diffs |
KustoSchemaTools/Changes/PolicyChange.cs | Added generic PolicyChange<T> type for policy diffs |
KustoSchemaTools/Changes/ClusterChanges.cs | Added reflection-based comparison and script generation for policies |
KustoSchemaTools/Changes/ClusterChangeSet.cs | Extended change set to aggregate policy change scripts |
KustoSchemaTools.Tests/Parser/YamlClusterHandlerTests.cs | Added tests covering YAML loading, missing/invalid files |
KustoSchemaTools.Tests/KustoClusterOrchestratorTests.cs | Extended orchestrator tests to cover capacityPolicy scenarios |
KustoSchemaTools.Tests/DemoData/ClusterScopedChanges/multipleClusters.yml | Sample YAML with multiple clusters and capacityPolicy definitions |
KustoSchemaTools.Tests/Changes/ClusterChangesTest.cs | Added tests for detecting policy changes in ClusterChanges |
Comments suppressed due to low confidence (2)
KustoSchemaTools/Parser/KustoClusterHandler.cs:48
- Add unit tests for KustoClusterHandler.LoadAsync to cover edge cases such as no rows returned, empty or malformed policy JSON, and ensure CapacityPolicy is set appropriately or remains null.
catch (System.Exception ex)
KustoSchemaTools/Changes/ClusterChanges.cs:38
- [nitpick] The entityName for policy changes is hardcoded as "default". Consider using a meaningful identifier or passing the actual policy name to improve clarity in change markdown.
"default",
…b/KustoSchemaTools into ashleyvansp/capacityPolicy
Overview
This pull request introduces the functionality to manage cluster configuration changes. Previously, KustoSchemaTools only managed database-level changes such as tables and permissions. The first supported cluster configuration feature is capacity policies.
See the README for more details about how it works.
Coming in follow-up PRs:
KustoClusterOrchestrator
apply()
method which executes the scripts generated in the "diff" stepKustoSchemaToolsAction
changes to make the orchestrator available in a GitHub Actionhttps://github.com/github/data/issues/9010