Fix handling GitHub PR commits on rebased PRs (prod)#4969
Fix handling GitHub PR commits on rebased PRs (prod)#4969lukaszgryglicki merged 3 commits intomainfrom
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 ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Fixes PR commit enumeration for rebased / large GitHub pull requests by switching commit listing logic to a compare-based approach (base SHA … head SHA) and tightening REST fallback behavior when commit lists may be truncated.
Changes:
- Replace GraphQL-based PR commit traversal with compare-endpoint pagination in Python and Go implementations.
- Block “unsafe” REST PR-commits fallback when commit counts are unknown or potentially truncated (250 limit).
- Add/adjust unit tests and add helper CLI scripts to inspect PR commit enumeration results.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/get_pr_commits.py | Adds a Python helper script to compare GraphQL/REST/compare-based commit enumeration outputs. |
| tests/functional/cypress/e2e/v4/signatures.cy.ts | Minor assertion style change (gte(0)), no functional impact. |
| cla-backend/cla/tests/unit/test_github_models.py | Adds unit tests covering compare retry behavior and blocking unsafe REST fallback. |
| cla-backend/cla/models/github_models.py | Introduces iter_pr_commits_compare() and routes PR commit author extraction through compare-based enumeration; adjusts check-run summary text. |
| cla-backend-go/github/github_repository.go | Implements compare-based commit listing with retries + parallel page fetching; adds compare-based author extraction and guarded REST fallback. |
| cla-backend-go/github/github_repository_test.go | Adds tests for compare retry behavior and page-order preservation under parallel fetching. |
| cla-backend-go/cmd/get_pr_commits/main.go | Adds a Go helper CLI for listing PR commits using compare-based enumeration. |
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)
Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io
Assisted by OpenAI
Assisted by GitHub Copilot