Repository Public BSD-3-Clause
1#!/usr/bin/env python32# =============================================================================3# SP BOUCHER | SOFTWARE & RESEARCH4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# PROJECT METADATA8# -----------------------------------------------------------------------------9# Project : ORIX Maps10# File : scripts/testflight.py11# Description : ORIX Maps — TestFlight follow-up through the App Store12# Connect API (the team key already on this Mac).13# Module : scripts14# Repository : https://git.spboucher.ai/orix-maps15# Created : 2026-11-2516# Last Modified : 2026-11-2517#18# =============================================================================19# AUTHOR & PROFESSIONAL AFFILIATION20# =============================================================================21#22# Author : Simon-Pierre Boucher23# Position : Professor of Finance24# Institution : Université du Québec en Outaouais (UQO)25# Department : Département des sciences administratives26# Organization : SP Boucher27#28# Website : https://spboucher.ai29# Git : https://git.spboucher.ai30#31# =============================================================================32# OFFICIAL CONTACT DIRECTORY33# =============================================================================34#35# General : info@spboucher.ai36# Professional : contact@spboucher.ai37# Direct : simon@spboucher.ai38# Research : research@spboucher.ai39# Development : dev@spboucher.ai40# Support : support@spboucher.ai41# Security/Admin : admin@spboucher.ai42# Notifications : notifications@spboucher.ai43#44# Preferred Contact: support@spboucher.ai45#46# =============================================================================47# COPYRIGHT & INTELLECTUAL PROPERTY48# =============================================================================49#50# Copyright (c) 202651# Simon-Pierre Boucher52#53# All rights reserved where applicable.54#55# This file is governed by the applicable project license,56# copyright notices, institutional agreements and relevant law.57#58# Unless expressly authorized by the applicable license or59# rights holder, copying, redistribution, sublicensing,60# publication and commercial exploitation are not permitted.61#62# Existing third-party rights and notices remain unaffected.63#64# =============================================================================65# CONFIDENTIALITY & SECURITY66# =============================================================================67#68# Classification : Public69# Distribution : Public repository; use is governed by the project license70# Security Contact : admin@spboucher.ai71#72# Access to this source does not independently grant permission73# to redistribute or disclose confidential materials.74#75# Do not embed credentials, private keys, access tokens,76# certificates or confidential personal information.77#78# =============================================================================79# LICENSE & MAINTENANCE80# =============================================================================81#82# License : Proprietary, all rights reserved (see license file)83# License File : LICENSE84# Maintainer : Simon-Pierre Boucher85# Technical Contact: dev@spboucher.ai86#87# =============================================================================88# END OF SP BOUCHER SOURCE HEADER89# =============================================================================9091"""ORIX Maps — TestFlight follow-up through the App Store Connect API (the team key already on this Mac).92usage: testflight.py status | whattotest <build number>93`whattotest` writes the "What to Test" text (en-CA and fr-CA) of a processed build. Nothing here invites external94testers or submits anything to review."""95import json, sys, os96sys.path.insert(0, os.path.dirname(__file__))97import asc9899APP = "6839106764"100NOTES = {101 "en-CA": "First internal build. Please try: 1) Menu (three dots) > Downloaded maps > download \"Québec City region\" (41 MB) or \"Greater Montréal\" (222 MB); 2) turn on airplane mode and check that the map, search (names, addresses, categories) and directions still work; 3) plan a route and use \"Preview the drive (simulation)\", then try real guidance outdoors; 4) touch and hold the map to drop a pin, save it to a collection; 5) record a short track; 6) switch themes with the layers button. Known limits: never run on a physical device before this build (GPS, background guidance and voice are untested on hardware); no elevation data; routes cannot cross between two downloaded regions.",102 "fr-CA": "Premier build interne. À essayer : 1) Menu (trois points) > Cartes téléchargées > télécharger « Région de Québec » (41 Mo) ou « Grand Montréal » (222 Mo) ; 2) activer le mode avion et vérifier que la carte, la recherche (noms, adresses, catégories) et les itinéraires fonctionnent toujours ; 3) planifier un itinéraire et utiliser « Aperçu du trajet (simulation) », puis essayer le guidage réel à l'extérieur ; 4) toucher longuement la carte pour déposer un repère, l'enregistrer dans une collection ; 5) enregistrer une courte trace ; 6) changer de thème avec le bouton des couches. Limites connues : jamais exécuté sur un appareil réel avant ce build (GPS, guidage en arrière-plan et voix non testés sur matériel) ; aucune donnée d'élévation ; un itinéraire ne peut pas passer d'une région téléchargée à une autre.",103}104105def builds():106 s, d = asc.call("GET", f"/v1/builds?filter%5Bapp%5D={APP}&sort=-uploadedDate&limit=10&include=buildBetaDetail")107 beta = {i["id"]: i["attributes"] for i in d.get("included", [])}108 out = []109 for b in d.get("data", []):110 rel = b["relationships"].get("buildBetaDetail", {}).get("data")111 out.append((b["id"], b["attributes"], beta.get(rel["id"], {}) if rel else {}))112 return out113114cmd = sys.argv[1] if len(sys.argv) > 1 else "status"115if cmd == "status":116 for bid, a, x in builds():117 print(f"build {a['version']} | {a['processingState']} | uploaded {a['uploadedDate']} | expires {a.get('expirationDate')} | internal {x.get('internalBuildState')} | external {x.get('externalBuildState')}")118 s, d = asc.call("GET", "/v1/betaGroups/56214beb-0f89-4fa9-93f7-45bc90c6dbc2/betaTesters?fields%5BbetaTesters%5D=state")119 print("internal testers:", [t["attributes"].get("state") for t in d.get("data", [])])120elif cmd == "whattotest":121 target = [b for b in builds() if b[1]["version"] == sys.argv[2]]122 if not target: sys.exit("build not found")123 bid = target[0][0]124 s, d = asc.call("GET", f"/v1/builds/{bid}/betaBuildLocalizations")125 existing = {x["attributes"]["locale"]: x["id"] for x in d.get("data", [])}126 for locale, text in NOTES.items():127 if locale in existing:128 s, r = asc.call("PATCH", f"/v1/betaBuildLocalizations/{existing[locale]}", {"data": {"type": "betaBuildLocalizations", "id": existing[locale], "attributes": {"whatsNew": text}}})129 else:130 s, r = asc.call("POST", "/v1/betaBuildLocalizations", {"data": {"type": "betaBuildLocalizations", "attributes": {"locale": locale, "whatsNew": text}, "relationships": {"build": {"data": {"type": "builds", "id": bid}}}}})131 print(locale, s, json.dumps(r.get("errors", ""))[:300] if s >= 300 else "ok")132else:133 sys.exit(__doc__)134