Skip to content

Fix handling GitHub PR commits on rebased PRs (prod)#4969

Merged
lukaszgryglicki merged 3 commits intomainfrom
unicron-fix-40633-prod
Apr 1, 2026
Merged

Fix handling GitHub PR commits on rebased PRs (prod)#4969
lukaszgryglicki merged 3 commits intomainfrom
unicron-fix-40633-prod

Conversation

@lukaszgryglicki
Copy link
Copy Markdown
Member

Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io

Assisted by OpenAI

Assisted by GitHub 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)
@lukaszgryglicki lukaszgryglicki self-assigned this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 06:45
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f911284d-aa7f-458c-9a66-67188195edad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch unicron-fix-40633-prod

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
@lukaszgryglicki lukaszgryglicki merged commit 04dccf9 into main Apr 1, 2026
7 checks passed
@lukaszgryglicki lukaszgryglicki deleted the unicron-fix-40633-prod branch April 1, 2026 08:36
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.

3 participants