Hotfix issue with PRs from forked repos#4834
Conversation
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
|
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 addresses an issue where CLA status updates fail for pull requests originating from forked repositories. The fix adds a fallback mechanism to post commit statuses using the PR's commit list when the direct commit object method fails, which commonly occurs with forked repos due to permission differences.
Key Changes:
- Updated
create_commit_status()to accept additional PR and commit SHA parameters for fallback handling - Added new
create_commit_status_pr_hash()helper function to post statuses via PR commit enumeration - Implemented automatic fallback to the new helper when the primary status posting fails
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io
Assisted by OpenAI
Assisted by GitHub Copilot