Skip to content

Commit 6cda429

Browse files
committed
feat: Complete target system with C# bindings and resource inference
- Add comprehensive target system with TargetRegistry and target-aware compilation - Implement resource type inference from policy equality expressions - Create modular C# bindings with separate wrapper classes for each concept - Add thread-safe CompiledPolicy with reference counting for safe disposal - Enhance FFI with detailed error propagation and target functionality - Create TargetExampleApp demonstrating Azure Policy integration - Add CI/CD pipeline testing for all C# applications - Support target definitions with schema validation and resource selectors - Implement PolicyModule struct and target-aware compilation methods - Add comprehensive test coverage for target functionality Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
1 parent d0ebfc7 commit 6cda429

68 files changed

Lines changed: 9756 additions & 997 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-csharp.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,38 @@ jobs:
140140
uses: actions/download-artifact@v4
141141
with:
142142
name: regorus-nuget
143-
path: ./bindings/csharp/Regorus.Tests/regorus-nuget/
143+
path: ./bindings/csharp/regorus-nuget/
144144

145145
- name: Restore Regorus.Tests
146-
run: dotnet restore /p:RestoreAdditionalProjectSources=./regorus-nuget
146+
run: dotnet restore /p:RestoreAdditionalProjectSources=../regorus-nuget
147147
working-directory: ./bindings/csharp/Regorus.Tests
148148

149149
- name: Run Regorus.Tests
150150
run: dotnet test --no-restore
151151
working-directory: ./bindings/csharp/Regorus.Tests
152+
153+
- name: Restore TestApp
154+
run: dotnet restore /p:RestoreAdditionalProjectSources=../regorus-nuget
155+
working-directory: ./bindings/csharp/TestApp
156+
157+
- name: Build TestApp
158+
run: dotnet build --no-restore
159+
working-directory: ./bindings/csharp/TestApp
160+
161+
- name: Run TestApp
162+
run: dotnet run --no-build --framework net8.0
163+
working-directory: ./bindings/csharp/TestApp
164+
165+
- name: Restore TargetExampleApp
166+
run: dotnet restore /p:RestoreAdditionalProjectSources=../regorus-nuget
167+
working-directory: ./bindings/csharp/TargetExampleApp
168+
169+
- name: Build TargetExampleApp
170+
run: dotnet build --no-restore
171+
working-directory: ./bindings/csharp/TargetExampleApp
172+
173+
- name: Run TargetExampleApp
174+
run: dotnet run --no-build --framework net8.0
175+
working-directory: ./bindings/csharp/TargetExampleApp
176+
177+

Cargo.lock

Lines changed: 67 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ anyhow = { version = "1.0.45", default-features = false }
9393
serde = {version = "1.0.150", default-features = false, features = ["derive", "rc"] }
9494
serde_json = { version = "1.0.89", default-features = false, features = ["alloc"] }
9595
lazy_static = { version = "1.4.0", default-features = false }
96+
thiserror = { version = "2.0", default-features = false }
9697

9798
data-encoding = { version = "2.8.0", optional = true, default-features=false, features = ["alloc"] }
9899
scientific = { version = "0.5.3" }

0 commit comments

Comments
 (0)