Skip to content

Commit

Permalink
feat(policy): Introduce policy engine for semantic convention registr…
Browse files Browse the repository at this point in the history
…y checks

This commit introduces a new policy engine, `weaver_checker`, to validate semantic convention registries against custom rules defined using the Rego language. The engine offers enhanced flexibility and control over registry compliance checks.

Key improvements:
- Policy engine implementation: A new crate, weaver_checker, was created to wrap the `regorus` crate and provide a convenient interface for defining and executing `Rego` policies against semantic convention registries.
- Policy separation: Policy checks are now decoupled from registry loading for improved performance and maintainability.
- Policy examples: Example `Rego` policies for comparing released and unreleased versions of semantic conventions are included for reference and demonstration.
- Documentation: Comprehensive documentation on the policy engine and its usage is added, including updates to the otel-weaver-platform diagram.
- Unit tests and coverage: Unit tests were added to ensure the functionality of the policy engine, and test coverage was improved to meet project criteria.
- Registry check command: A new CLI option `--before-resolution-policies` allows applying policies before schema resolution.
  • Loading branch information
lquerel authored Apr 12, 2024
1 parent acf6fd0 commit 57e6f1a
Show file tree
Hide file tree
Showing 41 changed files with 2,127 additions and 558 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
paths:
- .github/workflows/publish-docker.yml
- 'src/**'
- 'creates/**'
- 'crates/**'

jobs:
tests:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ just.zsh
# test generated code
**/observed_output/*

/output
# Ignore output files generated by weaver
**/output/*

# Coverage results
lcov.info
Loading

0 comments on commit 57e6f1a

Please sign in to comment.