play: old testing builds below production listed with their replace command (status, validate); 'Not live yet' instead of 'In review'; commit redone without changesNotSentForReview on the auto-send 400; pitfalls #129
This commit is contained in:
parent
83d351cf42
commit
9c001d1ca9
13 changed files with 130 additions and 15 deletions
42
cli/play/old-builds.ts
Normal file
42
cli/play/old-builds.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Builds still active on a testing track below the production build (pitfall 129). Play reviews every active build
|
||||
// with each submission: a policy issue in an old one (a media permission it asked for, "Use alternative system
|
||||
// pickers") blocks "Send changes for review" for the whole app, while the API still reads production as completed.
|
||||
// The Developer API cannot read a bundle's permissions, so each old build is named with the command that replaces it.
|
||||
// Pure.
|
||||
|
||||
export interface TrackLike { track: string; releases?: { name?: string; versionCodes?: string[]; status: string }[] }
|
||||
export interface OldBuild { track: string; versionCodes: number[]; name: string | null; status: string; productionCode: number }
|
||||
|
||||
/** Permissions Play reviews as policy-sensitive (Photo and video permissions, All files access). */
|
||||
export const SENSITIVE_PERMISSIONS = ['READ_MEDIA_IMAGES', 'READ_MEDIA_VIDEO', 'READ_EXTERNAL_STORAGE', 'MANAGE_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE'];
|
||||
|
||||
const ACTIVE = new Set(['completed', 'inProgress', 'halted']);
|
||||
const codes = (r: { versionCodes?: string[] }): number[] => (r.versionCodes ?? []).map(Number).filter(Number.isFinite);
|
||||
|
||||
export function oldTrackBuilds(tracks: TrackLike[]): OldBuild[] {
|
||||
const prod = tracks.find(t => t.track === 'production');
|
||||
const prodCodes = (prod?.releases ?? []).filter(r => ACTIVE.has(r.status)).flatMap(codes);
|
||||
if (!prodCodes.length) return [];
|
||||
const productionCode = Math.max(...prodCodes);
|
||||
const out: OldBuild[] = [];
|
||||
for (const t of tracks) {
|
||||
if (t.track === 'production') continue;
|
||||
for (const r of t.releases ?? []) {
|
||||
const cs = codes(r);
|
||||
if (!ACTIVE.has(r.status) || !cs.length || Math.max(...cs) >= productionCode) continue;
|
||||
out.push({ track: t.track, versionCodes: cs, name: r.name ?? null, status: r.status, productionCode });
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** The track flag of `play release` for a track name (custom closed tracks go by --track). */
|
||||
const trackFlag = (track: string): string => (['internal', 'alpha', 'beta'].includes(track) ? `--${track}` : `--track ${track}`);
|
||||
|
||||
export function oldBuildLines(old: OldBuild[]): string[] {
|
||||
if (!old.length) return [];
|
||||
return [
|
||||
` old builds still active (${old.length}): Play reviews them with every submission; a policy issue in one (e.g. ${SENSITIVE_PERMISSIONS.slice(0, 2).join(' / ')}) blocks Send changes for review. The API cannot read their permissions:`,
|
||||
...old.map(o => ` ${o.track} [${o.versionCodes.join(',')}] ${o.name ?? ''} ${o.status} -> replace: storebound play release --version-code ${o.productionCode} ${trackFlag(o.track)} completed`),
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue