forked from jenkins-x/go-scm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Handle BitBucket Server "pr:from_ref_updated" hook
Introduced in BitBucket Server 7.0 - as far as I can tell, there isn't yet an equivalent in BitBucket Cloud. fixes jenkins-x/lighthouse#511 Signed-off-by: Andrew Bayer <[email protected]>
- Loading branch information
Showing
8 changed files
with
262 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"eventKey": "pr:from_ref_updated", | ||
"date": "2018-07-05T19:21:30+0000", | ||
"actor": { | ||
"name": "jcitizen", | ||
"emailAddress": "[email protected]", | ||
"id": 1, | ||
"displayName": "Jane Citizen", | ||
"active": true, | ||
"slug": "jcitizen", | ||
"type": "NORMAL" | ||
}, | ||
"pullRequest": { | ||
"id": 2, | ||
"version": 0, | ||
"title": "added LICENSE", | ||
"description": "added BSD license text", | ||
"state": "OPEN", | ||
"open": true, | ||
"closed": false, | ||
"createdDate": 1530818490848, | ||
"updatedDate": 1530818490848, | ||
"fromRef": { | ||
"id": "refs/heads/develop", | ||
"displayId": "develop", | ||
"latestCommit": "208b0a5c05eddadad01f2aed8802fe0c3b3eaf5e", | ||
"repository": { | ||
"slug": "my-repo", | ||
"id": 1, | ||
"name": "my-repo", | ||
"scmId": "git", | ||
"state": "AVAILABLE", | ||
"statusMessage": "Available", | ||
"forkable": true, | ||
"project": { | ||
"key": "PRJ", | ||
"id": 2, | ||
"name": "PRJ", | ||
"public": false, | ||
"type": "NORMAL" | ||
}, | ||
"public": false | ||
} | ||
}, | ||
"toRef": { | ||
"id": "refs/heads/master", | ||
"displayId": "master", | ||
"latestCommit": "823b2230a56056231c9425d63758fa87078a66b4", | ||
"repository": { | ||
"slug": "my-repo", | ||
"id": 1, | ||
"name": "my-repo", | ||
"scmId": "git", | ||
"state": "AVAILABLE", | ||
"statusMessage": "Available", | ||
"forkable": true, | ||
"project": { | ||
"key": "PRJ", | ||
"id": 2, | ||
"name": "PRJ", | ||
"public": false, | ||
"type": "NORMAL" | ||
}, | ||
"public": false | ||
} | ||
}, | ||
"locked": false, | ||
"author": { | ||
"user": { | ||
"name": "jcitizen", | ||
"emailAddress": "[email protected]", | ||
"id": 1, | ||
"displayName": "Jane Citizen", | ||
"active": true, | ||
"slug": "jcitizen", | ||
"type": "NORMAL" | ||
}, | ||
"role": "AUTHOR", | ||
"approved": false, | ||
"status": "UNAPPROVED" | ||
}, | ||
"reviewers": [], | ||
"participants": [] | ||
}, | ||
"previousFromHash": "99f3ea32043ba3ecaa28de6046b420de70257d80" | ||
} |
78 changes: 78 additions & 0 deletions
78
scm/driver/stash/testdata/webhooks/pr_ref_updated.json.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"Action": "synchronized", | ||
"Repo": { | ||
"ID": "1", | ||
"Namespace": "PRJ", | ||
"Name": "my-repo", | ||
"Perm": null, | ||
"Branch": "master", | ||
"Private": true, | ||
"Clone": "", | ||
"CloneSSH": "", | ||
"Link": "", | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
}, | ||
"PullRequest": { | ||
"Number": 2, | ||
"Title": "added LICENSE", | ||
"Body": "added BSD license text", | ||
"Sha": "208b0a5c05eddadad01f2aed8802fe0c3b3eaf5e", | ||
"Ref": "refs/pull-requests/2/from", | ||
"Source": "develop", | ||
"Target": "master", | ||
"Fork": "PRJ/my-repo", | ||
"Link": "", | ||
"Closed": false, | ||
"Merged": false, | ||
"State": "open", | ||
"Base": { | ||
"Ref": "master", | ||
"Sha": "208b0a5c05eddadad01f2aed8802fe0c3b3eaf5e", | ||
"Repo": { | ||
"ID": "1", | ||
"Namespace": "PRJ", | ||
"Name": "my-repo", | ||
"Perm": null, | ||
"Branch": "master", | ||
"Private": true, | ||
"Clone": "", | ||
"CloneSSH": "", | ||
"Link": "", | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
} | ||
}, | ||
"Head": { | ||
"Ref": "master", | ||
"Sha": "208b0a5c05eddadad01f2aed8802fe0c3b3eaf5e", | ||
"Repo": { | ||
"ID": "1", | ||
"Namespace": "PRJ", | ||
"Name": "my-repo", | ||
"Perm": null, | ||
"Branch": "master", | ||
"Private": true, | ||
"Clone": "", | ||
"CloneSSH": "", | ||
"Link": "", | ||
"Created": "0001-01-01T00:00:00Z", | ||
"Updated": "0001-01-01T00:00:00Z" | ||
} | ||
}, | ||
"Author": { | ||
"Login": "jcitizen", | ||
"Name": "Jane Citizen", | ||
"Email": "[email protected]", | ||
"Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" | ||
}, | ||
"Created": "2018-07-05T12:21:30-07:00", | ||
"Updated": "2018-07-05T12:21:30-07:00" | ||
}, | ||
"Sender": { | ||
"Login": "jcitizen", | ||
"Name": "Jane Citizen", | ||
"Email": "[email protected]", | ||
"Avatar": "https://www.gravatar.com/avatar/9e26471d35a78862c17e467d87cddedf.jpg" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.