Verified Commit 6a4f332f authored by Georg Krause's avatar Georg Krause
Browse files

Make contributions skripts handle more than 100 issues/merge requests

parent a4c51faa
......@@ -10,28 +10,36 @@ WEBLATE_COMPONENT_ID = "funkwhale/front"
def get_issues(next_release):
url = GITLAB_URL + "/api/v4/issues"
# TODO assumes we have less than 100 issues per Milestone
response = requests.get(
url,
params={"per_page": 100, "milestone": next_release, "scope": "all"},
headers={"PRIVATE-TOKEN": os.environ["PRIVATE_TOKEN"]},
)
response.raise_for_status()
while url:
response = requests.get(
url,
params={"per_page": 20, "milestone": next_release, "scope": "all"},
headers={"PRIVATE-TOKEN": os.environ["PRIVATE_TOKEN"]},
)
response.raise_for_status()
yield from response.json()
return response.json()
if "next" in response.links:
url = response.links["next"]["url"]
else:
url = None
def get_merge_requests(next_release):
url = GITLAB_URL + "/api/v4/merge_requests"
# TODO assumes we have less than 100 issues per Milestone
response = requests.get(
url,
params={"per_page": 100, "milestone": next_release, "scope": "all"},
headers={"PRIVATE-TOKEN": os.environ["PRIVATE_TOKEN"]},
)
response.raise_for_status()
return response.json()
while url:
response = requests.get(
url,
params={"per_page": 20, "milestone": next_release, "scope": "all"},
headers={"PRIVATE-TOKEN": os.environ["PRIVATE_TOKEN"]},
)
response.raise_for_status()
yield from response.json()
if "next" in response.links:
url = response.links["next"]["url"]
else:
url = None
def get_participants(project_id, issue_iid, object_type="issues"):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment