[go: up one dir, main page]

Skip to content

Bitbucket Server Importer - Use user object info for merged event imports

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

In !177321 (merged), @jnutt pointed out that Bitbucket Server returns the merging user's details in the committer fields don't match the merging user when merged using the fasr-forward strategy because there's no merge commit. Therefore, the imported merged event might not be accurate to the user that actually merged the pull request on Bitbucket Server. Fortunately, Bitbucket Server returns a user object in the activity object, which is the user who performed the merge, regardless of merge strategy.

Proposed Solution

Update BitbucketServer::Representation::Activity to reference user fields in committer_user, committer_name, committer_username, and committer_email, similar to the approver and decliner attributes.

Optional refactor

The committer, approver, and decliner methods in BitbucketServer::Representation::Activity will be identical to one another. The only reason committer_username would belong to a committer is because the activity object contains action: 'MERGED'. If it makes sense to do so, these methods could be aliases of one another to DRY up this class.

Edited by 🤖 GitLab Bot 🤖