Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment