feat(engine): add commit-level evaluation primitives with ordered multi-commit support#6388
Closed
sachin9058 wants to merge 0 commit into
Closed
feat(engine): add commit-level evaluation primitives with ordered multi-commit support#6388sachin9058 wants to merge 0 commit into
sachin9058 wants to merge 0 commit into
Conversation
Contributor
Author
|
Hi all, just a quick follow-up happy to adjust the design or structure if needed. In particular, I’d appreciate feedback on:
Thanks! |
c80084f to
58a56c3
Compare
58a56c3 to
d547963
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.
Summary
This PR introduces commit-level evaluation primitives for pull request analysis, enabling evaluation of individual commits rather than only the final state (HEAD).
Currently, Minder evaluates only the resulting state of a PR, which can allow intermediate commits containing issues (e.g., vulnerable dependencies or invalid metadata) to be introduced into the repository history. This change provides a flexible foundation to support evaluation across all commits in a PR.
Key changes include:
CommitPolicyinterface for defining commit-level checksCommitEvaluatorfor evaluating commits against one or more policiesEvaluateAllto evaluate all commits in a PR while preserving orderCommitResultto capture structured per-commit evaluation resultsHasPolicyFailureshelper for basic aggregation of resultsHasFailuresas a deprecated alias for backward compatibilityConventionalCommitPolicyas an example policy for commit message validationThis PR focuses on providing reusable evaluation primitives rather than enforcing specific policies. It enables building policies such as:
This builds on previous work:
Fixes #2176
Testing
The changes were tested using unit tests covering:
Evaluation with no policies configured
Evaluation with single and multiple policies
Multi-commit evaluation using
EvaluateAllPreservation of commit order in results
Aggregation behavior using
HasPolicyFailuresEdge cases such as empty commit lists
Validation of commit message formats using
ConventionalCommitPolicy, including:api/v1)All tests were run using the existing Go test suite:
go test ./...No additional configuration is required.