Skip to content
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

[ci_runner] Use merge commit sha from webhook event #6684

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

maggie-lou
Copy link
Contributor

@maggie-lou maggie-lou commented May 31, 2024

To support merge-with-base behavior on pull requests, we've been fetching the target branch with --depth=0 (to ensure the merge-base is fetched) and manually calling git merge on the ci_runner. This can be slow. GitHub automatically generates the mergeCommitSHA on pull requests, so use that from the webhook data instead if it has been set

Related issues: N/A

@maggie-lou maggie-lou force-pushed the merge_commit_sha branch 6 times, most recently from 2753f07 to f08b07f Compare June 3, 2024 17:52
@maggie-lou maggie-lou changed the title [WIP] Use merge commit sha from webhook event [ci_runner] Use merge commit sha from webhook event Jun 3, 2024
@maggie-lou maggie-lou marked this pull request as ready for review June 3, 2024 18:00
// the background job has not completed, or if the webhook provider does not
// provide a generated merge commit. In this case, it should be manually
// generated by merging the pushed and target branches.
MergeCommitSHA string
Copy link
Member

Choose a reason for hiding this comment

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

any idea how reliable this merge_commit_sha is? if we're unsure, can we put it behind a flag and test in dev for a while?

Copy link
Member

Choose a reason for hiding this comment

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

err I guess if it's non-empty, then it should exist remotely, otherwise they wouldn't know the SHA?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it exists on the webhook data, we should be able to reliably fetch it. I'll merge this now, so we'll have until Thursday to see how this does in dev

// the background job has not completed, or if the webhook provider does not
// provide a generated merge commit. In this case, it should be manually
// generated by merging the pushed and target branches.
MergeCommitSHA string
Copy link
Member

Choose a reason for hiding this comment

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

err I guess if it's non-empty, then it should exist remotely, otherwise they wouldn't know the SHA?

@maggie-lou maggie-lou merged commit 05f9501 into master Jun 3, 2024
17 of 18 checks passed
@maggie-lou maggie-lou deleted the merge_commit_sha branch June 3, 2024 21:29
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.

2 participants