-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* PullRequests to return the commits too - #1251 * examples for PR commits added - #1251 * TestCase added for PR commits - #1251 * temporary commit to trigger pipeline for error display
- Loading branch information
1 parent
7821e83
commit 65185cb
Showing
5 changed files
with
126 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from atlassian.bitbucket import Cloud | ||
|
||
bitbucket = Cloud(url='https://api.bitbucket.org/', token='random_string_token') | ||
|
||
pr_id = 1 | ||
|
||
if __name__ == "__main__": | ||
data = bitbucket.repositories.get(workspace="workspace1", repo_slug="repository1") | ||
pr = data.pullrequests.get(pr_id) | ||
print(f"For Pull Request ID = {pr.id}") | ||
for pr_commit in pr.commits: | ||
print(f"Commit Id={pr_commit.hash}, Message={pr_commit.message}") |
Empty file.
94 changes: 94 additions & 0 deletions
94
...itbucket/cloud/2.0/repositories/TestWorkspace1/testrepository1/pullrequests/1/commits/GET
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,94 @@ | ||
responses[None] = { | ||
"values": [ | ||
{ | ||
"type": "commit", | ||
"hash": "3a8d6c7910f7bf68f7cf9cc1964998006fa8894b", | ||
"date": "2023-10-08T17:31:20+00:00", | ||
"author": { | ||
"type": "author", | ||
"raw": "user1Name <[email protected]>", | ||
"user": { | ||
"display_name": "user1Name", | ||
"links": { | ||
"self": { | ||
"href": "https://api.bitbucket.org/2.0/users/%7B34318d8b-6c8a-40a7-aea2-572fdd183917%7D" | ||
}, | ||
"avatar": { | ||
"href": "https://secure.gravatar.com/avatar/679c684730037c1250b46c1781701f98?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIP-3.png" | ||
}, | ||
"html": { | ||
"href": "https://bitbucket.org/%7B34318d8b-6c8a-40a7-aea2-572fdd183917%7D/" | ||
} | ||
}, | ||
"type": "user", | ||
"uuid": "{34318d8b-6c8a-40a7-aea2-572fdd183917}", | ||
"account_id": "557058:e7042a01-54b7-447f-9da8-4ad1b1e4afa5", | ||
"nickname": "user1Name" | ||
} | ||
}, | ||
"message": "src created online with Bitbucket", | ||
"summary": { | ||
"type": "rendered", | ||
"raw": "src created online with Bitbucket", | ||
"markup": "markdown", | ||
"html": "<p>src created online with Bitbucket</p>" | ||
}, | ||
"links": { | ||
"self": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" | ||
}, | ||
"html": { | ||
"href": "https://bitbucket.org/TestWorkspace1/testrepository1/commits/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" | ||
}, | ||
"diff": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/diff/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" | ||
}, | ||
"approve": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/approve" | ||
}, | ||
"comments": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/comments" | ||
}, | ||
"statuses": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b/statuses" | ||
}, | ||
"patch": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/patch/3a8d6c7910f7bf68f7cf9cc1964998006fa8894b" | ||
} | ||
}, | ||
"parents": [ | ||
{ | ||
"hash": "08b01c378b0c67999528bdb5d364d1960409cd99", | ||
"links": { | ||
"self": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1/commit/08b01c378b0c67999528bdb5d364d1960409cd99" | ||
}, | ||
"html": { | ||
"href": "https://bitbucket.org/TestWorkspace1/testrepository1/commits/08b01c378b0c67999528bdb5d364d1960409cd99" | ||
} | ||
}, | ||
"type": "commit" | ||
} | ||
], | ||
"repository": { | ||
"type": "repository", | ||
"full_name": "TestWorkspace1/testrepository1", | ||
"links": { | ||
"self": { | ||
"href": "https://api.bitbucket.org/2.0/repositories/TestWorkspace1/testrepository1" | ||
}, | ||
"html": { | ||
"href": "https://bitbucket.org/TestWorkspace1/testrepository1" | ||
}, | ||
"avatar": { | ||
"href": "https://bytebucket.org/ravatar/%7Bc4f5c559-de42-4b98-8502-4d73ee76c393%7D?ts=default" | ||
} | ||
}, | ||
"name": "testrepository1", | ||
"uuid": "{n789754-de42-4b98-8502-4d73ee76c393}" | ||
} | ||
} | ||
], | ||
"pagelen": 10, | ||
"page": 1 | ||
} |
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