-
Notifications
You must be signed in to change notification settings - Fork 292
fix: use merge-base for accurate change detection in pj-rehearse #4869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: use merge-base for accurate change detection in pj-rehearse #4869
Conversation
When a PR is created from an outdated base branch commit, git diff-tree comparisons can be incorrect because they compare against the old base SHA instead of finding the actual merge point. This fix uses git merge-base to find the common ancestor between the base SHA and HEAD, ensuring accurate change detection even when: - The base branch has moved forward significantly - The PR was created from an outdated commit - Merge commits exist in the PR history This resolves the issue where pj-rehearse fails to detect changes until the PR is rebased onto the latest base branch. Related: Fixes issue where rehearsable tests are not detected when PR base branch is outdated
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
WalkthroughThis change modifies the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (1)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deepsm007 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test images |
|
@deepsm007: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
I'm not sure the code we are changing here is ever exercised by |
When a PR is created from an outdated base branch commit, git diff-tree comparisons can be incorrect because they compare against the old base SHA instead of finding the actual merge point.
This fix uses git merge-base to find the common ancestor between the base SHA and HEAD, ensuring accurate change detection even when:
This resolves the issue where pj-rehearse fails to detect changes until the PR is rebased onto the latest base branch.
/cc @danilo-gemoli @openshift/test-platform
/hold