[BITBUCKET CLOUD] Invalid pagination / missing next
See original GitHub issueI tried to loop over my workspaces and over the repos to get all pipelines with the following code:
from atlassian.bitbucket.cloud import Cloud
from pprint import pprint
bb = Cloud(
url="https://api.bitbucket.org",
username="myusr",
password="mypass",
)
for x in bb.workspaces.each():
print(x.name)
if x.slug == "myworkspace":
y = x.repositories.get("myrepo")
print(y.name, y.description)
pipes = y.pipelines.each()
for p in pipes:
print(p.build_number)
It returns the following error
AssertionError: Wrong response for url [https://api.bitbucket.org/2.0/repositories/.../.../pipelines], the size attribute doesn't match the number of recieved values:
JSON Output of the request like this one:
{
"page": 1,
"pagelen": 10,
"values": [....10 pipes here...],
"size": 21
}
The size
option gave me the total number of pipelines (21). But the response only gave me 10 pipes with no next
attribute. Therefore an error happend here:
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Getting Something went wrong Error while fetching
Solved: Hey!! I am trying to fetch all the files from my directory. The curl which I am using is ``` curl -u...
Read more >bitbucket API 2.0 page parameters using non-default pagelen
ORIGINAL ANSWER: I was able to get around this by creating a bash script that looped through each page of 10 results, adding...
Read more >Pagination doesn't work with API Version 2.0 Calls - Bitbucket
The fetch all finds the first 10 results and as soon as it attempts the next page call you will get: Resource not...
Read more >Terraform Cloud API Documentation - HashiCorp Developer
All requests must be authenticated with a bearer token. Use the HTTP header Authorization with the value Bearer <token> . If the token...
Read more >Two-factor authentication - GitLab Docs
Any existing recovery codes you saved will be invalidated. (yes/no) yes Your two-factor authentication recovery codes are: 119135e5a3ebce8e 11f6v2a498810dcd ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the quick fix.
Another error occured when calling
completed_on
@ pipeline level:https://github.com/atlassian-api/atlassian-python-api/blob/c51db61ae02333e9454a0ebdd0923f080be8f890/atlassian/bitbucket/cloud/repositories/pipelines.py#L120
One hint from my site. The workspace is accessed by the slug or the uuid. Therefore changing the code:
to
will be faster if you have several workspaces.