Use new 'nickname' field for bitbucket cloud

Bitbucket is deprecating the username field.
See: https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr
This commit is contained in:
Luke Kysow
2019-02-28 10:04:57 -05:00
parent 5e9464b820
commit 09b92cd207
4 changed files with 7 additions and 5 deletions

View File

@@ -320,12 +320,12 @@ func (e *EventParser) parseCommonBitbucketCloudEventData(event bitbucketcloud.Co
URL: *event.PullRequest.Links.HTML.HREF,
HeadBranch: *event.PullRequest.Source.Branch.Name,
BaseBranch: *event.PullRequest.Destination.Branch.Name,
Author: *event.Actor.Username,
Author: *event.Actor.Nickname,
State: prState,
BaseRepo: baseRepo,
}
user = models.User{
Username: *event.Actor.Username,
Username: *event.Actor.Nickname,
}
return
}

View File

@@ -235,6 +235,7 @@
},
"actor": {
"username": "lkysow",
"nickname": "lkysow",
"display_name": "Luke",
"account_id": "557058:dc3817de-68b5-45cd-b81c-5c39d2560090",
"links": {
@@ -289,4 +290,4 @@
"is_private": false,
"uuid": "{94189367-116b-436a-9f77-2314b97a6067}"
}
}
}

View File

@@ -183,6 +183,7 @@
},
"actor": {
"username": "lkysow",
"nickname": "lkysow",
"display_name": "Luke",
"account_id": "557058:dc3817de-68b5-45cd-b81c-5c39d2560090",
"links": {
@@ -237,4 +238,4 @@
"is_private": false,
"uuid": "{94189367-116b-436a-9f77-2314b97a6067}"
}
}
}

View File

@@ -38,7 +38,7 @@ type DiffStatFile struct {
}
type Actor struct {
Username *string `json:"username,omitempty" validate:"required"`
Nickname *string `json:"nickname,omitempty" validate:"required"`
}
type Repository struct {
FullName *string `json:"full_name,omitempty" validate:"required"`