Skip to content

fix(scripts/diff-flat): fetch pull/*/merge, not pull/*/head #27580

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

Merged
merged 2 commits into from
Aug 13, 2025

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Aug 13, 2025

Summary

Changes the diff:flat script to fetch the /merge tip of the PR, rather than the /head tip.

Test results and supporting details

Background

After merging #25352, the PR Review Companion started failing most of the time.

Problem

The workflow uses diff:flat to compare the PR tip with the main branch. For this, it needs the merge base, but the checkout by default doesn't fetch any history, so the merge base was likely not fetched unless the PR was based on the latest main commit.

Solution

Compare the result of merging the PR into the main branch, with the main branch.

Note: Tested this with a local shallow clone of BCD.

Related issues

Otherwise the merge base may not be available.
@caugner caugner requested a review from queengooborg August 13, 2025 16:18
@github-actions github-actions bot added infra Infrastructure issues (npm, GitHub Actions, releases) of this project scripts Issues or pull requests regarding the scripts in scripts/. size:xs [PR only] 0-6 LoC changed labels Aug 13, 2025
@caugner caugner changed the title fix(scripts/diff-flat): use pull/x/merge, not pull/x/head fix(scripts/diff-flat): fetch pull/*/merge, not pull/*/head Aug 13, 2025
@github-actions github-actions bot added size:s [PR only] 7-24 LoC changed and removed size:xs [PR only] 0-6 LoC changed labels Aug 13, 2025
@caugner
Copy link
Contributor Author

caugner commented Aug 13, 2025

Once merged, let's re-enable the workflow.

@queengooborg queengooborg merged commit 7b0d0a1 into main Aug 13, 2025
11 checks passed
@queengooborg queengooborg deleted the use-pull-merge-ref branch August 13, 2025 18:14
@queengooborg
Copy link
Contributor

Workflow has been re-enabled!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Infrastructure issues (npm, GitHub Actions, releases) of this project scripts Issues or pull requests regarding the scripts in scripts/. size:s [PR only] 7-24 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants