feat(policies): inject per-evaluation project context for chainloop.* built-ins#3094
Merged
migmartri merged 1 commit intochainloop-dev:mainfrom May 5, 2026
Conversation
… built-ins Adds engine-level project name + version that propagates into the per-evaluation context.Context so chainloop.* built-ins can scope their queries (e.g. chainloop.findings) without the rego author having to pass project metadata explicitly. The crafter populates the context from workflow metadata for both material and attestation-level policy evaluation, and `chainloop policy develop eval` gains `--project` / `--project-version` flags so authors can supply the same context locally. Refs: chainloop-dev#3090 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
jiparis
approved these changes
May 5, 2026
Member
|
awesome! I managed something similar just for ATTESTATION materials (since they bring the project already). This is smarter. |
Member
Author
Yep I know, I thought it was possible but then I realized is only available for attestation-type policies :) |
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.
Summary
Adds engine-level project name + version that propagates into the per-evaluation
context.Contextsochainloop.*built-ins (e.g.chainloop.findings,chainloop.project_compliance) can scope their queries automatically without the rego author writing project metadata in the policy.engine.WithProjectContext(name, version)option, propagated to built-ins throughbctx.Contextviabuiltins.WithProjectContext/ProjectContextFromContexthelpers.NewPolicyVerifier/NewPolicyGroupVerifiercall (material verification and attestation-level evaluation) by reading workflow metadata.chainloop policy develop evalgains--project/--project-versionflags so authors can supply the same context locally.Closes #3090