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

Bitbucket sha fix for merged pr #225

Merged
merged 4 commits into from
Sep 14, 2022
Merged

Bitbucket sha fix for merged pr #225

merged 4 commits into from
Sep 14, 2022

Conversation

raghavharness
Copy link
Contributor

@raghavharness raghavharness commented Sep 14, 2022

For bitbucket, since we don't have pull-request refs so we use source branch to clone the PR. But in cases where source branch is deleted when pr is merged, git clone gets failed. To prevent that we'll use the merge commit instead of source branch latest commit.

@bradrydzewski
Copy link
Member

@raghavharness please keep in mind that there are multiple consumers of this library, and that changes made for Harness have the potential to break other consumers, such as Drone. For example, when Drone executes a pipeline for a pull request, it clones the base branch and then manually performs the merge. Moving from commit sha to merge sha would break the clone step in Drone for Bitbucket.

Instead of changing the behavior of an existing field, I have added a new Merge field that you can use to capture the merge sha. https://github.com/drone/go-scm/blob/master/scm/pr.go#L27

Copy link
Member

@bradrydzewski bradrydzewski left a comment

Choose a reason for hiding this comment

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

capture merge sha in PullRequest.Merge field instead

@raghavharness
Copy link
Contributor Author

Sure, thanks @bradrydzewski for the inputs.

@raghavharness
Copy link
Contributor Author

@bradrydzewski @tphoney Have addressed your comment, can you please review once. Thanks.

@bradrydzewski bradrydzewski merged commit b1a365c into master Sep 14, 2022
@tphoney tphoney added the bug label Nov 22, 2022
@tphoney tphoney deleted the bitbucket_sha_fix branch February 3, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants