SPB Git

Repository Public License

testflight.py 4.2 KB 48 lines python

1#!/usr/bin/env python32"""ORIX Navigator — TestFlight follow-up through the App Store Connect API (the team key already on this Mac).3usage: testflight.py status | whattotest <build number> | groups4`whattotest` writes the "What to Test" text (en-CA and fr-CA) of a processed build. Nothing here invites external5testers or submits anything to review."""6import json, sys, os7sys.path.insert(0, os.path.dirname(__file__))8import asc910APP = "6839163217"11NOTES = {12    "en-CA": "First internal beta (0.2.0): the fundamental browser in the Lunar Glass design. Please try: 1) browse a few sites, open and close tabs, then quit and relaunch: your tabs should come back; 2) the bottom dock should compact when you scroll down and return when you scroll up, without the page jumping; 3) type a search and an address in the bar (suggestions are local only); 4) bookmarks, history, downloads and themes in Settings; 5) on iPad, the sidebar and a hardware keyboard. Not in this build yet: Orbit view, Split, Command palette, Shield, private windows, Reader, Agent. Known gaps: never run on a physical device before this build; link long-press menu, share sheet and pull to refresh are untested.",13    "fr-CA": "Première bêta interne (0.2.0) : le navigateur fondamental dans le design Lunar Glass. À essayer : 1) naviguer sur quelques sites, ouvrir et fermer des onglets, puis quitter et relancer : les onglets doivent revenir ; 2) le dock du bas doit se compacter au défilement vers le bas et revenir vers le haut, sans saut de page ; 3) saisir une recherche et une adresse dans la barre (suggestions locales seulement) ; 4) favoris, historique, téléchargements et thèmes dans Réglages ; 5) sur iPad, la barre latérale et un clavier physique. Pas encore dans ce build : vue Orbit, Split, palette de commandes, Shield, fenêtres privées, Lecteur, Agent. Limites connues : jamais exécuté sur un appareil réel avant ce build ; menu d’appui long sur les liens, feuille de partage et tirer pour actualiser non testés.",14}1516def builds():17    s, d = asc.call("GET", f"/v1/builds?filter%5Bapp%5D={APP}&sort=-uploadedDate&limit=10&include=buildBetaDetail")18    beta = {i["id"]: i["attributes"] for i in d.get("included", [])}19    out = []20    for b in d.get("data", []):21        rel = b["relationships"].get("buildBetaDetail", {}).get("data")22        out.append((b["id"], b["attributes"], beta.get(rel["id"], {}) if rel else {}))23    return out2425cmd = sys.argv[1] if len(sys.argv) > 1 else "status"26if cmd == "status":27    for bid, a, x in builds():28        print(f"build {a['version']} | {a['processingState']} | uploaded {a['uploadedDate']} | expires {a.get('expirationDate')} | internal {x.get('internalBuildState')} | external {x.get('externalBuildState')}")29    s, d = asc.call("GET", f"/v1/apps/{APP}/betaGroups?fields%5BbetaGroups%5D=name,isInternalGroup,hasAccessToAllBuilds")30    for g in d.get("data", []):31        s2, t = asc.call("GET", f"/v1/betaGroups/{g['id']}/betaTesters?fields%5BbetaTesters%5D=state")32        print("group", g["attributes"]["name"], "| internal", g["attributes"]["isInternalGroup"], "| all builds", g["attributes"].get("hasAccessToAllBuilds"), "| testers", [x["attributes"].get("state") for x in t.get("data", [])])33    if not d.get("data"): print("no beta group on this app yet")34elif cmd == "whattotest":35    target = [b for b in builds() if b[1]["version"] == sys.argv[2]]36    if not target: sys.exit("build not found")37    bid = target[0][0]38    s, d = asc.call("GET", f"/v1/builds/{bid}/betaBuildLocalizations")39    existing = {x["attributes"]["locale"]: x["id"] for x in d.get("data", [])}40    for locale, text in NOTES.items():41        if locale in existing:42            s, r = asc.call("PATCH", f"/v1/betaBuildLocalizations/{existing[locale]}", {"data": {"type": "betaBuildLocalizations", "id": existing[locale], "attributes": {"whatsNew": text}}})43        else:44            s, r = asc.call("POST", "/v1/betaBuildLocalizations", {"data": {"type": "betaBuildLocalizations", "attributes": {"locale": locale, "whatsNew": text}, "relationships": {"build": {"data": {"type": "builds", "id": bid}}}}})45        print(locale, s, json.dumps(r.get("errors", ""))[:300] if s >= 300 else "ok")46else:47    sys.exit(__doc__)48
Files main
Menu

Theme