Skip to content

feat(engine): add commit iteration support for pull request evaluation#6372

Open
sachin9058 wants to merge 2 commits intomindersec:mainfrom
sachin9058:feat/commit-iteration-support
Open

feat(engine): add commit iteration support for pull request evaluation#6372
sachin9058 wants to merge 2 commits intomindersec:mainfrom
sachin9058:feat/commit-iteration-support

Conversation

@sachin9058
Copy link
Copy Markdown
Contributor

Summary

This PR introduces basic support for iterating over all commits in a pull request during evaluation.

Currently, Minder evaluates only the final (HEAD) state of a pull request. This change lays the groundwork for future commit-level policies by exposing commit data such as SHA and message across all commits in the PR.

The implementation:

  • Adds commit iteration logic in the evaluation flow using a provider-agnostic interface (commitLister)
  • Supports pagination when fetching commits from the provider
  • Logs commit metadata (SHA and message) in a structured way for debugging and future extension

This change is intentionally scoped to be foundational and does not introduce any policy enforcement yet.

Fixes #2176

Testing

  • Verified that commit iteration works across multiple pages of commits
  • Confirmed that the logic is a no-op for providers that do not implement commitLister
  • Ran full test suite:
    go test ./...
  • Ensured no existing functionality is affected

@sachin9058 sachin9058 requested a review from a team as a code owner April 15, 2026 04:57
@sachin9058
Copy link
Copy Markdown
Contributor Author

Note: Observed a data race in TestNatsChannel related to NATS JetStream internals. This appears to be upstream and unrelated to the changes in this PR.

@sachin9058
Copy link
Copy Markdown
Contributor Author

@evankanderson This PR is intentionally scoped as a foundational step toward commit-level evaluation.

It introduces commit iteration support across pull requests while keeping the existing behavior unchanged. This allows future enhancements such as commit-level policy checks (e.g., content, message format, metadata) to build on top of this without expanding the scope of this PR.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage is 60.096%sachin9058:feat/commit-iteration-support into mindersec:main. No base build found for mindersec:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not all commits being added to main are checked during PR

2 participants