diff --git a/scripts/ios-fleet.sha256 b/scripts/ios-fleet.sha256 index 14e08526..1795e4b5 100644 --- a/scripts/ios-fleet.sha256 +++ b/scripts/ios-fleet.sha256 @@ -2,7 +2,7 @@ # GitHub-hosted macos-latest ships from this copy, not /Users/jay/apps/ios-fleet. # Refresh with: bash scripts/ios-fleet-pin.sh --update (then land it in a PR) 645a5e07868f416cbd30270505f052ff4f3f0fb11efbfb26783c7a2b36d07304 ship-testflight.sh -ae1a380d41ed8ee9f19b99d7a420a0fab4d5352e2fb300e8625b423cffb2ecd5 asc-api.mjs +e7381b34f0dbea3585537b03435212f04c66d8d46741148490fb1186a8a47d33 asc-api.mjs 1d57b7bb3c76bf73f6ed932bfc34a937a2aa8ea1aa483d60d3ae0849576ec595 asc-key.mjs 3de97aa5b28a8f15571eb4ec3c34436d720b99bd43f852c320387d57ea3927ca apps.json b41b09704f40be9e0a14a66ec302589d763b03ef65baf37437c00fdaa55287d0 AppUpdatePrompt.swift diff --git a/scripts/ios-fleet/asc-api.mjs b/scripts/ios-fleet/asc-api.mjs index 9cab5e95..d6334084 100644 --- a/scripts/ios-fleet/asc-api.mjs +++ b/scripts/ios-fleet/asc-api.mjs @@ -1749,29 +1749,32 @@ async function main() { // Hand-written parse, not zod: see ensure-appstore-profiles above. const EMAIL_RE = /^[^\s@,]+@[^\s@,]+\.[^\s@,]+$/; const raw = String(process.env.ASC_STANDING_TESTERS || ""); - const emails = [...new Set(raw.split(/[\s,;]+/).map((e) => e.trim().toLowerCase()).filter(Boolean))]; + let emails = [...new Set(raw.split(/[\s,;]+/).map((e) => e.trim().toLowerCase()).filter(Boolean))]; const mask = maskEmail; if (!/^\d+$/.test(appId)) { console.error(`${prefix}: usage: node asc-api.mjs ensure-standing-testers [buildVersion]`); process.exit(2); } + const rows = ascRows; + const errText = ascErrorText; + let warnings = 0; + const warn = (msg) => { warnings += 1; console.error(`${prefix}: WARNING ${msg}`); }; + // The email list is never REQUIRED: the external group already holds the + // standing people, so an empty list is not a failure. The build still has + // to reach that group and Beta App Review. A bad list is a warning about + // the list, never a reason to exit before the build is assigned. if (!emails.length) { - console.error(`${prefix}: ASC_STANDING_TESTERS is empty; set the repo secret to the standing tester emails`); - process.exit(2); + console.error(`${prefix}: no tester list; the members of the external group stay as they are`); } - const bad = emails.filter((e) => !EMAIL_RE.test(e)); - if (bad.length) { - console.error(`${prefix}: ASC_STANDING_TESTERS has ${bad.length} malformed entr${bad.length === 1 ? "y" : "ies"}; nothing changed`); - process.exit(2); + const badEmails = emails.filter((e) => !EMAIL_RE.test(e)); + if (badEmails.length) { + warn(`ASC_STANDING_TESTERS has ${badEmails.length} malformed entr${badEmails.length === 1 ? "y" : "ies"}; they are ignored`); } + emails = emails.filter((e) => EMAIL_RE.test(e)); if (emails.length > 5) { - console.error(`${prefix}: ASC_STANDING_TESTERS lists ${emails.length} emails; the standing list is three. Refusing to invite`); - process.exit(2); + warn(`ASC_STANDING_TESTERS lists ${emails.length} valid emails; the standing list is three, and only the first five are added`); } - const rows = ascRows; - const errText = ascErrorText; - let warnings = 0; - const warn = (msg) => { warnings += 1; console.error(`${prefix}: WARNING ${msg}`); }; + emails = emails.slice(0, 5); // 1) External beta group: reuse "Public Beta" or the first external group; // create a private "Public Beta" (public link off) only when none exists. @@ -1801,13 +1804,20 @@ async function main() { } // 2) Testers: add each standing email to the group, reusing tester records. - const inGroupRes = await api("GET", `/v1/betaGroups/${group.id}/betaTesters?limit=200&fields[betaTesters]=email`); - if (!inGroupRes.ok) { - warn(`could not list testers in group "${group.attributes?.name}" (${errText(inGroupRes)}); not re-adding anyone`); - process.exit(3); + // Only touch the group's testers when there is a list to add. A failed + // tester listing is a warning, never a reason to skip the build assignment. + let inGroup = new Set(); + let listable = emails.length > 0; + if (listable) { + const inGroupRes = await api("GET", `/v1/betaGroups/${group.id}/betaTesters?limit=200&fields[betaTesters]=email`); + if (!inGroupRes.ok) { + warn(`could not list testers in group "${group.attributes?.name}" (${errText(inGroupRes)}); not re-adding anyone`); + listable = false; + } else { + inGroup = new Set(rows(inGroupRes).map((t) => String(t.attributes?.email || "").toLowerCase())); + } } - const inGroup = new Set(rows(inGroupRes).map((t) => String(t.attributes?.email || "").toLowerCase())); - for (const email of emails) { + for (const email of (listable ? emails : [])) { if (inGroup.has(email)) { console.error(`${prefix}: ${mask(email)} already in group`); continue; @@ -1822,15 +1832,8 @@ async function main() { } } - // 2b) Internal group: App Store Connect users install every build with no - // Beta App Review. This is the path that reaches the owner's phone; a - // new app record has none until this creates it (GH #1018). - // Its warnings go through warn(), so they count toward the exit code. - await ensureInternalTesterGroup({ - api, appId, emails, - log: (m) => console.error(`${prefix}: ${m}`), - warn - }); + // No internal group: iOS TestFlight uses the external group only (owner, + // 2026-11-24). An internal group an app record already has is left alone. // 3) Build: the given CFBundleVersion, else the newest upload. const buildQuery = wantBuild