Draft
Conversation
a818ddc to
0953819
Compare
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
The idea is that this provides a way to make common library functions available to Conforma policies, without needing to fetch them down as a policy source. It's kind of experimental currently, but the initial motivation is to avoid the awkwardness around the way we'd like to make lib.result_helper availble to users writing their own policies. If we like the idea, it should be simple enough to extend it to whatever shared library we'd like to provide. There are pros and cons with this idea so let's not commit to it fully just yet. In this commit the only embedded rego is a simple "hello_world" rule. Co-Authored-By: Claude <noreply@anthropic.com>
In the previous commit we focus on reading the embded rego files. Here we're writing it out. Introduces a reusable utility function that writes embedded rego files to the filesystem, following the same directory structure pattern used by external policy sources. Also, call it to write the embedded rego to disk when preparing the policy dir for the Conftest evaluator. The function follows the uniqueDestination pattern where each policy source gets its own subdirectory, with "embedded" acting as the identifier for embedded rego files. We're assuming there's only one embedded directory currently. Co-Authored-By: Claude <noreply@anthropic.com>
This commit includes: - features/embedded_rego.feature: Gherkin acceptance test scenario - acceptance/examples/embedded_rego_test.rego: Test policy using ec_lib.hello_world - acceptance/examples/embedded_rego_config.yaml: Policy configuration The acceptance test verifies that: - Embedded rego functions are available in policy evaluation - The ec_lib.hello_world function works correctly - Policies can import and use data.ec_lib namespace - Output contains expected success messages Co-Authored-By: Claude <noreply@anthropic.com>
0953819 to
7103e0d
Compare
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.
It's experimental and wip. Will demo and discuss.