Unicron 4835 handle edge cases prod#4837
Conversation
…llback Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
…e-cases Handle too big commits, missing commits from fork PRs, golang REST fallback
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the CLA backend to gracefully handle edge cases in PR processing across both Python and Go implementations. The changes ensure robust handling of large comment bodies, PRs with many commits from forks, and edge cases in commit SHA retrieval.
Key Changes:
- Implemented comment body size limiting to prevent exceeding the 64KB GitHub limit by trimming SHA lists when comments become too large
- Refactored PR commit fetching to use merge-base history traversal, supporting PRs with > 250 commits and graceful REST API fallback
- Added comprehensive logging of distinct commit metadata (SHAs, author IDs, logins, emails, names) to track commit summaries vs actual commits
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cla-backend/cla/utils.py | Added comment trimming logic to handle oversized comment bodies and SHA list truncation |
| cla-backend/cla/models/github_models.py | Rewrote GraphQL commit iteration to use merge-base history traversal with fallback handling and enhanced logging |
| cla-backend-go/github/github_repository.go | Mirrored Python changes with merge-base history traversal, comment trimming, improved error handling, and consistent logging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pythonandgolangbackends.pythonandgolangbackends).cc @mlehotskylf @ahmedomosanya @jarias-lfx - this is for #4835.
Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io
Assisted by OpenAI
Assisted by GitHub Copilot