Skip to content

feat(azure-policy): add compiler skeleton with core types and stubs#674

Open
anakrish wants to merge 1 commit intomicrosoft:mainfrom
anakrish:azure-policy-compiler-v2
Open

feat(azure-policy): add compiler skeleton with core types and stubs#674
anakrish wants to merge 1 commit intomicrosoft:mainfrom
anakrish:azure-policy-compiler-v2

Conversation

@anakrish
Copy link
Copy Markdown
Collaborator

Add the compiler module structure with:

  • core.rs: Compiler struct, CountBinding, new(), compile() pipeline, register allocation, span/emit helpers
  • mod.rs: module declarations, public entry points (compile_policy_rule, compile_policy_definition, etc.)
  • utils.rs: pure helper functions (path splitting, JSON conversion)
  • Stub files for conditions, expressions, fields, template dispatch, count, effects, and metadata — real implementations follow in subsequent commits.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial Azure Policy AST → RVM compiler module scaffold under languages::azure_policy, establishing public compile entry points, core compiler state/register plumbing, and a set of stub submodules to be implemented in follow-up commits.

Changes:

  • Exposes a new azure_policy::compiler module and public compile entry points for rules/definitions (with alias-resolution variants).
  • Introduces Compiler core infrastructure (program construction, register allocation, span/source mapping, emit helpers).
  • Adds utility helpers for path splitting and AST JSON → runtime Value conversion; other compiler submodules are currently stubs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/languages/azure_policy/mod.rs Exposes the new compiler module from the Azure Policy language surface.
src/languages/azure_policy/compiler/mod.rs Defines compiler module layout and public compilation entry points + parameter-default extraction.
src/languages/azure_policy/compiler/core.rs Core Compiler struct, program pipeline skeleton, register/span/emit helpers.
src/languages/azure_policy/compiler/utils.rs Helper functions for literal extraction, path splitting, and JSON value conversion to runtime Value.
src/languages/azure_policy/compiler/conditions.rs Stub for constraint/condition compilation.
src/languages/azure_policy/compiler/conditions_wildcard.rs Stub for wildcard condition handling.
src/languages/azure_policy/compiler/count.rs Stub for count loop compilation (+ placeholder optimization hook).
src/languages/azure_policy/compiler/count_any.rs Stub for count→Any optimization.
src/languages/azure_policy/compiler/count_bindings.rs Stub for count-binding resolution and current() references.
src/languages/azure_policy/compiler/effects.rs Stub for effect compilation and wrapping result.
src/languages/azure_policy/compiler/effects_modify_append.rs Stub for Modify/Append effect detail compilation.
src/languages/azure_policy/compiler/expressions.rs Stub for template/call expression compilation.
src/languages/azure_policy/compiler/fields.rs Stub for field-kind/path/resource path compilation.
src/languages/azure_policy/compiler/metadata.rs Stub for metadata/annotation accumulation and population.
src/languages/azure_policy/compiler/template_dispatch.rs Stub for ARM template function dispatch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish force-pushed the azure-policy-compiler-v2 branch 2 times, most recently from 6d193d1 to e5a924b Compare April 13, 2026 19:11
@anakrish anakrish requested a review from Copilot April 13, 2026 20:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish force-pushed the azure-policy-compiler-v2 branch from 96d273e to 0e8a5f0 Compare April 13, 2026 22:59
@anakrish anakrish requested a review from Copilot April 13, 2026 23:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish force-pushed the azure-policy-compiler-v2 branch from 78d4e2a to 00d8e7b Compare April 14, 2026 09:57
@anakrish anakrish requested a review from Copilot April 14, 2026 10:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add the compiler module structure with:
- core.rs: Compiler struct, CountBinding, new(), compile() pipeline,
  register allocation, span/emit helpers
- mod.rs: module declarations, public entry points
  (compile_policy_rule, compile_policy_definition, etc.)
- utils.rs: pure helper functions (path splitting, JSON conversion)
- Stub files for conditions, expressions, fields, template dispatch,
  count, effects, and metadata — real implementations follow in
  subsequent commits.
@anakrish anakrish force-pushed the azure-policy-compiler-v2 branch from b775003 to 68d935f Compare April 14, 2026 16:52
@anakrish anakrish requested a review from Copilot April 14, 2026 17:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@anakrish anakrish marked this pull request as ready for review April 14, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants