Hello,
I noticed that if you use python-taiga against https://api.taiga.io/ to list projects it fails.
api.projects.list()
(Traceback (most recent call last):
File "./taiga-stats", line 175, in cmd_list_projects
for proj in api.projects.list():
File "/home/erikw/.virtualenvs/taiga-stats/lib/python3.6/site-packages/taiga/models/base.py", line 41, in list
objects = self.parse_list(result.json())
File "/home/erikw/.virtualenvs/taiga-stats/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
No output fed in to the JSON decoding? So I decided to get down to my friend command line, and this works as expected:
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer ${AUTH_TOKEN}" -s https://api.taiga.io/api/v1/projects
...
<project JSON>
So I drilled down the code and noticed that python-taiga always send the header
x-disable-pagination: True
to disable pagination and get everything at once.
So I plugged this in to the the previous command line
$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer ${AUTH_TOKEN}" -H "x-disable-pagination: True" -s https://api.taiga.io/api/v1/projects
<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>
and now it it also fails like when called with pyhon-taiga.
I simply think this is the situation: now the number of public projects at taiga.io has recently grown too large to be included in one GET request to the project listing API endpoint. But before it was small enough to work.
A user of my project taiga-stats reported this last week.
I guess python-taiga should be adapted to use pagination for requests, so it can handle large taiga instances, like taiga.io now is. And I think this is prioritized to to, as I guess taiga.io is the most used instance of Taiga of them all!
type: feature