Play 'Live' only when the public store page proves it: play status checks https://play.google.com/store/apps/details?id=<pkg> (no auth, 4 s timeout, cached 5 min; publicPage in the JSON), a completed production release with a 404 page is 'Sent to Google (in review or not yet published)', 200 is live for the first release or when the page shows the versionName, otherwise 'Released to production (Google may still be reviewing)', offline is unknown; new phases sent / released in the desktop Releases tab, Portfolio, release status | plan; versions matched across the stores without trailing .0 parts (App Store 1.0 and Play 1.0.0 are one row and one train, each side shows its own string); tests/play-public-version-match.test.ts, desktop boot check release-state cases (page 404 and 200) (pitfall 56)
This commit is contained in:
parent
aa72204a06
commit
be9ff8b788
18 changed files with 436 additions and 30 deletions
|
|
@ -4,10 +4,10 @@
|
|||
// stage for the same store state. Pure; the store reads are `apple status --json` / `play status --json`, turned into
|
||||
// StoreRelease rows by cli/lib/portfolio.ts.
|
||||
import type { ReleaseTrain, StoreRelease } from './desktop-protocol';
|
||||
import { cmpVersion } from './portfolio';
|
||||
import { cmpVersion, displayVersion, PHASE_RANK, REACHING, sameVersion, versionKey } from './portfolio';
|
||||
import type { Finding } from './validate-rules';
|
||||
|
||||
export { cmpVersion };
|
||||
export { cmpVersion, displayVersion, sameVersion, versionKey };
|
||||
|
||||
export type Tone = 'ok' | 'warn' | 'bad' | 'info' | 'neutral' | 'accent';
|
||||
|
||||
|
|
@ -36,6 +36,8 @@ export function laneOf(store: 'ios' | 'android', r: StoreRelease | null, testfli
|
|||
case 'testing': return { ...base, at: 1, tone: 'info', share: null };
|
||||
case 'review': return { ...base, at: 2, tone: 'warn', share: null };
|
||||
case 'approved': return { ...base, at: 2, tone: 'ok', share: null };
|
||||
case 'sent': return { ...base, at: 2, tone: 'warn', share: null };
|
||||
case 'released': return { ...base, at: 3, tone: r.publicPage === 'unknown' ? 'neutral' : 'info', share: null };
|
||||
case 'rejected': return { ...base, at: 2, tone: 'bad', share: null };
|
||||
case 'live': return { ...base, at: 4, tone: 'ok', share: 1 };
|
||||
case 'rollout': return { ...base, at: 4, tone: 'accent', share: r.fraction ?? null };
|
||||
|
|
@ -49,23 +51,26 @@ export interface BetaBuilds { builds: { version: string | null; internal: string
|
|||
|
||||
/** Both lanes of a train; iOS counts TestFlight as reached when a build of that version is in beta testing. */
|
||||
export function trainLanes(t: ReleaseTrain, tf?: BetaBuilds | null): Lane[] {
|
||||
const inBeta = !!tf?.builds.some(b => b.version === t.version && /IN_BETA_TESTING|BETA_APPROVED|READY_FOR_BETA_TESTING/.test(`${b.internal ?? ''} ${b.external ?? ''}`));
|
||||
const inBeta = !!tf?.builds.some(b => sameVersion(b.version, t.version) && /IN_BETA_TESTING|BETA_APPROVED|READY_FOR_BETA_TESTING/.test(`${b.internal ?? ''} ${b.external ?? ''}`));
|
||||
return [laneOf('ios', t.ios, inBeta), laneOf('android', t.android)];
|
||||
}
|
||||
|
||||
/** Every distinct version of the store releases, newest first, with both stores' release (best phase per store). */
|
||||
export function versionHistory(all: StoreRelease[]): ReleaseTrain[] {
|
||||
const rank: Record<string, number> = { live: 0, rollout: 1, halted: 2, approved: 3, review: 4, rejected: 5, testing: 6, draft: 7, other: 8 };
|
||||
const versions = [...new Set(all.map(r => r.version).filter((v): v is string => !!v))].sort(cmpVersion).reverse();
|
||||
const best = (store: 'ios' | 'android', v: string) => all.filter(r => r.store === store && r.version === v).sort((a, b) => (rank[a.phase] ?? 9) - (rank[b.phase] ?? 9))[0] ?? null;
|
||||
return versions.map(v => ({ version: v, ios: best('ios', v), android: best('android', v) }));
|
||||
const keys = new Map<string, string[]>(); // one row per release: 1.0 (App Store) and 1.0.0 (Play) are the same
|
||||
for (const v of all.map(r => r.version).filter((x): x is string => !!x)) { const k = versionKey(v); keys.set(k, [...(keys.get(k) ?? []), v]); }
|
||||
const best = (store: 'ios' | 'android', k: string) => all.filter(r => r.store === store && !!r.version && versionKey(r.version) === k).sort((a, b) => (PHASE_RANK[a.phase] ?? 99) - (PHASE_RANK[b.phase] ?? 99))[0] ?? null;
|
||||
return [...keys].map(([k, vs]) => {
|
||||
const ios = best('ios', k), android = best('android', k);
|
||||
return { version: displayVersion([android?.version, ios?.version, ...vs]), ios, android };
|
||||
}).sort((a, b) => cmpVersion(b.version, a.version));
|
||||
}
|
||||
|
||||
/** On one store: the highest version reaching users (live or rolling out) and the highest version above it. */
|
||||
export function storeNow(all: StoreRelease[], store: 'ios' | 'android'): { now: StoreRelease | null; next: StoreRelease | null } {
|
||||
const rs = all.filter((r): r is StoreRelease & { version: string } => r.store === store && !!r.version);
|
||||
const desc = (a: { version: string }, b: { version: string }) => cmpVersion(b.version, a.version);
|
||||
const now = rs.filter(r => r.phase === 'live' || r.phase === 'rollout' || r.phase === 'halted').sort(desc)[0] ?? null;
|
||||
const now = rs.filter(r => REACHING.has(r.phase)).sort(desc)[0] ?? null;
|
||||
const next = rs.filter(r => !now || cmpVersion(r.version, now.version) > 0).sort(desc)[0] ?? null;
|
||||
return { now, next };
|
||||
}
|
||||
|
|
@ -80,6 +85,8 @@ export function laneText(l: Lane): string {
|
|||
const stage = STAGES[l.at] ?? 'build';
|
||||
const p = l.release.phase;
|
||||
if (p === 'live') return 'live'; // the whole track filled: everyone has it
|
||||
if (p === 'sent') return 'review (sent to Google: in review or not yet published)';
|
||||
if (p === 'released') return l.release.publicPage === 'unknown' ? 'released to production (public page not readable: live unknown)' : 'released to production (Google may still be reviewing)';
|
||||
const word = p === stage || (p === 'draft' && stage === 'build') || (p === 'other' && stage === 'build') ? stage : `${stage} (${p})`;
|
||||
if (p === 'rollout' || p === 'halted') return `${word} ${pctText(l.share)}`.trim();
|
||||
return word;
|
||||
|
|
@ -176,6 +183,12 @@ function storeSteps(store: 'ios' | 'android', v: string, r: StoreRelease | null,
|
|||
case 'rejected':
|
||||
steps.push({ kind: 'owner', text: `resubmit ${v} after the fix (owner)`, fix: store === 'ios' ? 'App Store Connect > App Review > reply / resubmit' : 'Play Console > Publishing overview' });
|
||||
break;
|
||||
case 'sent':
|
||||
steps.push({ kind: 'wait', text: `${v} is sent to Google (production completed, the store page is not public yet): in review or not yet published`, fix: 'storebound play status (checks the public store page)' });
|
||||
break;
|
||||
case 'released':
|
||||
steps.push({ kind: 'wait', text: r!.publicPage === 'unknown' ? `${v} is released to production; the public store page could not be read, so live is unknown` : `${v} is released to production; Google may still be reviewing it (the app is public, this version is not proven live)`, fix: 'storebound play status' });
|
||||
break;
|
||||
case 'review':
|
||||
steps.push({ kind: 'wait', text: `${v} is in review (${r!.state}); nothing to do until the store answers`, fix: store === 'ios' ? 'storebound apple status --wait-review' : 'storebound play status' });
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue