fix(cluster): validate policy bundle semantics - #444
Open
viveknathani wants to merge 2 commits into
Open
Conversation
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.
What & why
Semantically validate referenced policy bundles during shared cluster config loading, so
cluster validate, plan, and apply reportpolicy_invalidbefore acquiring the cluster lock or creating state. This prevents invalid policy scopes from surviving until server boot and adds regression coverage and documentation for the validation boundary.Backing issue / RFC
Checklist
Local verification
cargo test --workspace --quiet— passedgit diff --check— passedNotes for reviewers
Policy validation now runs through the shared cluster config path, so validate, plan, and apply reject invalid bundles consistently and before changing cluster state.
Existing test fixtures were updated to include the required policy version.
Greptile Summary
The PR moves semantic policy validation into shared cluster configuration loading, causing invalid bundles and binding-kind mismatches to fail before cluster state or locking operations.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported binding-kind gap is now enforced through the appropriate server and graph policy loaders before stateful cluster operations.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A[cluster.yaml and policy YAML] --> B[load_desired] B --> C[PolicyConfig semantic validation] C --> D{applies_to} D -->|cluster| E[Server policy kind validation] D -->|graph| F[Graph policy kind validation] E --> G{Valid?} F --> G G -->|No| H[policy_invalid diagnostic] G -->|Yes| I[DesiredCluster] I --> J[validate / plan / apply] J --> K[Lock and state operations]Reviews (2): Last reviewed commit: "fix(cluster): validate policy binding ki..." | Re-trigger Greptile
Context used (3)
omnigraph-cluster)