mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
compare-settings-to-template: Paginate through all tags.
The default page size is 30, which means this only goes back to 4.6 at present, due to starting with `shared-...` and old `enterprise-...` tags.
This commit is contained in:
committed by
Tim Abbott
parent
b6f6f6db8d
commit
d79776f80d
@@ -4,6 +4,7 @@ import difflib
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
sys.path.append(BASE_DIR)
|
sys.path.append(BASE_DIR)
|
||||||
@@ -24,11 +25,15 @@ import requests
|
|||||||
|
|
||||||
print("Fetching old versions of setting templates from Github...")
|
print("Fetching old versions of setting templates from Github...")
|
||||||
templ = {}
|
templ = {}
|
||||||
resp = requests.get("https://api.github.com/repos/zulip/zulip/tags")
|
url: Optional[str] = "https://api.github.com/repos/zulip/zulip/tags"
|
||||||
|
|
||||||
|
while url is not None:
|
||||||
|
resp = requests.get(url)
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
print(resp.content)
|
print(resp.content)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
url = resp.links.get("next", {}).get("url")
|
||||||
for tag in [t["name"] for t in resp.json()]:
|
for tag in [t["name"] for t in resp.json()]:
|
||||||
if re.match(r"^\d+\.\d+(\.\d+)?$", tag):
|
if re.match(r"^\d+\.\d+(\.\d+)?$", tag):
|
||||||
print(f" - {tag}")
|
print(f" - {tag}")
|
||||||
|
|||||||
Reference in New Issue
Block a user