feat(rvm): implement Azure Policy condition evaluation#661
feat(rvm): implement Azure Policy condition evaluation#661anakrish merged 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Azure Policy condition evaluation support to the RVM, including all condition operators and structured allOf/anyOf short-circuit execution, gated behind feature = "azure_policy".
Changes:
- Introduces consolidated
Instruction::PolicyConditionwithPolicyOpsub-opcodes, plus structuredLogicalBlock*instructions forallOf/anyOf. - Implements Azure Policy comparison, containment, pattern matching, and existence semantics in the VM dispatch path (feature-gated).
- Adds YAML VM test suites covering operator behavior and
allOf/anyOfcontrol flow.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rvm/vm/suites/azure_policy/policy_operators.yaml | Adds operator matrix tests for Azure Policy condition ops. |
| tests/rvm/vm/suites/azure_policy/policy_allof_anyof.yaml | Adds structured instruction tests for allOf/anyOf short-circuiting. |
| src/rvm/vm/dispatch.rs | Adds feature-gated execution for policy ops and logical blocks. |
| src/rvm/tests/vm.rs | Runs Azure Policy YAML suites when azure_policy feature is enabled. |
| src/rvm/tests/instruction_parser.rs | Parses the new policy/logical-block test instructions. |
| src/rvm/program/listing.rs | Updates assembly listing naming/formatting for new instructions. |
| src/rvm/instructions/types.rs | Adds PolicyOp and LogicalBlockMode enums. |
| src/rvm/instructions/mod.rs | Adds new instruction variants to the main instruction enum. |
| src/rvm/instructions/display.rs | Adds Display formatting for new instructions. |
| src/builtins/azure_policy/helpers.rs | Adds helper functions for coercion, comparison, and pattern matching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d1a428a to
6ae9eb4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6ae9eb4 to
1667341
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1667341 to
b56c706
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b56c706 to
a06a568
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a06a568 to
ed403f1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ed403f1 to
7b43bc9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7b43bc9 to
7c02934
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7c02934 to
9f7dd59
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f7dd59 to
154d39a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6a31c0c to
185f21b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
185f21b to
31aa333
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add VM support for Azure Policy's condition operators and allOf/anyOf short-circuit logic, gated behind cfg(feature = "azure_policy"). Policy conditions (equals, contains, like, match, exists, and their negations — 21 total) are encoded as a single PolicyCondition instruction with a PolicyOp sub-opcode rather than bloating the Instruction enum with 21 variants. The dispatch handles Azure Policy's quirky comparison semantics: case-insensitive string comparison, string↔number coercion, null vs undefined distinction, and element-wise collection membership. allOf/anyOf blocks use four instructions — LogicalBlockStart, AllOfNext/AnyOfNext, and LogicalBlockEnd — that wire up a result register and short-circuit on the first failing (allOf) or passing (anyOf) child. Helper functions for case-folded comparison, wildcard/glob matching, and type coercion live in builtins::azure_policy::helpers. Two YAML test suites (~2200 lines) exercise the full operator matrix and the allOf/anyOf control flow.
31aa333 to
ed23f2b
Compare
Add VM support for Azure Policy's condition operators and allOf/anyOf
short-circuit logic, gated behind cfg(feature = "azure_policy").
Policy conditions (equals, contains, like, match, exists, and their
negations — 21 total) are encoded as a single PolicyCondition
instruction with a PolicyOp sub-opcode rather than bloating the
Instruction enum with 21 variants. The dispatch handles Azure Policy's
quirky comparison semantics: case-insensitive string comparison,
string↔number coercion, null vs undefined distinction, and element-wise
collection membership.
allOf/anyOf blocks use four instructions — LogicalBlockStart,
AllOfNext/AnyOfNext, and LogicalBlockEnd — that wire up a result
register and short-circuit on the first failing (allOf) or passing
(anyOf) child.
Helper functions for case-folded comparison, wildcard/glob matching, and
type coercion live in builtins::azure_policy::helpers.
Two YAML test suites (~2200 lines) exercise the full operator matrix and
the allOf/anyOf control flow.