feat(engine): expose structured commit metadata for pull request evaluation#6380
feat(engine): expose structured commit metadata for pull request evaluation#6380sachin9058 wants to merge 3 commits into
Conversation
|
This follows up on the earlier commit iteration work and prepares the system for future commit-level policy checks. |
|
This test appears to be timing-sensitive. It passes consistently locally and may be flaky due to the short wait duration. |
|
Question: do we have a high-level design for what's being built, and how it will be used? Given that this probably requires exposing some number of functions to e.g. the Rego evaluator, it would be handy to follow this approach:
|
|
@evankanderson Thanks for the suggestion I’ve added a proposed high-level design in #2176 outlining how the pieces fit together and example usage. Happy to iterate on the design before proceeding further. |
Summary
This PR builds on the existing commit iteration support by introducing structured commit metadata extraction for pull request evaluation.
Previously, commit data was accessed directly from provider-specific objects within the evaluation flow. This change introduces a lightweight abstraction (
CommitInfo) to normalize commonly used fields such as SHA, message (first line), and author.The implementation:
commitinfopackage to avoid import cycles and provide a reusable abstractionCommitInfostruct for normalized commit metadataThis change is intentionally scoped as a foundational improvement and does not introduce any commit-level policy enforcement.
Testing
go test ./...