Skip to content

Commit

Permalink
Merge pull request #502 from runatlantis/bb-cloud-api-deprecation
Browse files Browse the repository at this point in the history
Use new 'nickname' field for bitbucket cloud
  • Loading branch information
lkysow authored Mar 1, 2019
2 parents e9bee6e + 09b92cd commit 308a873
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/events/event_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion server/events/testdata/bitbucket-cloud-comment-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
},
"actor": {
"username": "lkysow",
"nickname": "lkysow",
"display_name": "Luke",
"account_id": "557058:dc3817de-68b5-45cd-b81c-5c39d2560090",
"links": {
Expand Down Expand Up @@ -289,4 +290,4 @@
"is_private": false,
"uuid": "{94189367-116b-436a-9f77-2314b97a6067}"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
},
"actor": {
"username": "lkysow",
"nickname": "lkysow",
"display_name": "Luke",
"account_id": "557058:dc3817de-68b5-45cd-b81c-5c39d2560090",
"links": {
Expand Down Expand Up @@ -237,4 +238,4 @@
"is_private": false,
"uuid": "{94189367-116b-436a-9f77-2314b97a6067}"
}
}
}
2 changes: 1 addition & 1 deletion server/events/vcs/bitbucketcloud/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 308a873

Please sign in to comment.