testflight: description keys by language id or App Store locale, unknown keys are a config error, primary-locale check before Beta App Review

This commit is contained in:
CRTkafa 2026-10-29 22:33:59 +07:00
parent e185b61c8e
commit 1abd0936c3
6 changed files with 35 additions and 3 deletions

View file

@ -319,6 +319,16 @@ export async function run(ctx: Ctx): Promise<void> {
if (a.has('submit-review') && review) log(TAG, `beta review: already submitted (${review.attributes?.betaReviewState ?? '?'})`);
if (external.length && !a.has('submit-review') && b.detail?.externalBuildState === 'READY_FOR_BETA_SUBMISSION')
warn(TAG, 'external testers only get the build after Beta App Review: add --submit-review (asks first) or submit it in App Store Connect');
// Beta App Review refuses a build whose app has no beta localization in its primary locale (422
// MISSING_BETA_APP_LOCALIZATION): said before the submit, in the dry run too
if (wantsReview) {
const primary = String((await c.maybe(`/v1/apps/${appId}?fields[apps]=primaryLocale`))?.data?.attributes?.primaryLocale ?? '');
const have = (await c.all(`/v1/apps/${appId}/betaAppLocalizations?limit=200`)).map((l: J) => String(l.attributes.locale));
if (primary && !have.includes(primary)) {
const msg = `Beta App Review needs test information in the app's primary locale ${primary} (has: ${have.join(', ') || 'none'}): add it to apple.testflight.description (key ${primary} or its language id), then storebound apple testflight info`;
if (dry) warn(TAG, msg); else throw new Error(msg);
}
}
if (dry) {
await execute(c.asc, [...reqs, ...(wantsReview ? [betaReviewReq(b.id)] : [])], { dry, tag: TAG });
done(TAG, 'distribute checked (dry run)');