Skip to content

#840 Upload App Store screenshots through the App Store Connect API - #852

Merged
ivanfenenko merged 1 commit into
mainfrom
feature/840-asc-screenshot-upload
Oct 26, 2026
Merged

ivanfenenko merged 1 commit into
mainfrom
feature/840-asc-screenshot-upload

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds scripts/store-screenshots/upload-app-store.mjs (npm run store:upload-app-store), run locally with ASC_KEY_ID, ASC_ISSUER_ID and ASC_API_KEY_PATH.
  • Reads the rendered slides in store-screenshots/spectrum/app-store-iphone-6.9/ and app-store-ipad-13/ in file-name order. Before any API call it refuses wrong pixel sizes, alpha channels and more than 10 shots. A missing or empty folder skips that device and leaves its set untouched.
  • Finds the single editable iOS version (--version to choose) and its en-US localization (--locale), deletes the old screenshots for each display type (APP_IPHONE_67, APP_IPAD_PRO_3GEN_129), uploads the new ones, confirms each with its MD5, sets the order, and waits for processing. If Apple rejects a file, it stops with Apple's reason.
  • Never submits for review: the client allows only the five screenshot write endpoints and refuses every other write before a request goes out. --dry-run lists what would be deleted and uploaded and refuses all writes.
  • A 403 is reported as a missing App Manager or Admin role.

Checks

  • npm run store:fixture-server:test: 33/33 pass, including 14 new tests that run against an in-memory App Store Connect (auth token signature, folder validation, write allowlist, dry run, set creation, upload order and checksums, a rejected upload).
  • Planned against the current local renders: iPhone and iPad each have 5 valid PNGs.
  • Not yet run against App Store Connect: no API key on the dev Mac. The first real use should be a --dry-run.

Issue

Risks / Follow-ups

  • Apple has deprecated the appScreenshotSets / appScreenshots endpoints in favour of the App Asset Library. They still work, but will need porting eventually.
  • The display-type mapping (1320×2868 → APP_IPHONE_67, 2064×2752 → APP_IPAD_PRO_3GEN_129) comes from Apple's screenshot specifications and the API enum; the first real upload confirms it.
  • The ASC key must have the App Manager or Admin role; that's still a check on Store Screenshots: App Store Connect upload script #840.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need.

Adds scripts/store-screenshots/upload-app-store.mjs: validates the rendered
iPhone 6.9" and iPad 13" slides, then replaces those screenshot sets on the
editable version's en-US localization in file order, waits for processing,
and refuses every write other than the screenshot endpoints. --dry-run only
reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko marked this pull request as ready for review October 26, 2026 14:29
@ivanfenenko
ivanfenenko merged commit 959f4bd into main Oct 26, 2026
2 checks passed
@ivanfenenko
ivanfenenko deleted the feature/840-asc-screenshot-upload branch October 26, 2026 14:29

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: 1 finding(s) that 2+ of 3 passes agreed on.

2 finding(s) from a single pass, not posted
  • scripts/store-screenshots/upload-app-store.mjs:395 medium: Reorder PATCH targets a read-only App Store Connect relationship (deepseek-v4.1-flash)
  • scripts/store-screenshots/upload-app-store.mjs:569 low: Main-entry guard misses symlinked invocation paths, so the script silently does nothing (glm-5.3-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.111


const PNG_SIG = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
// PNG colour types 4 (grey + alpha) and 6 (RGBA); App Store Connect rejects alpha.
const PNG_ALPHA_COLOR_TYPES = new Set([4, 6]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low: Alpha pre-check misses palette PNGs (color type 3) with a tRNS transparency chunk

readPngHeader flags alpha only for PNG colour types 4 and 6. A palette (colour type 3) PNG that carries transparency in a tRNS chunk has a real alpha channel but reports hasAlpha: false, so planTarget declares the folder "ready" and the delete/upload cycle runs. The pre-check exists precisely to avoid Apple rejecting a file after the old screenshots for the display type have already been deleted; this variant defeats it.

Failure scenario: store-screenshots/spectrum/app-store-iphone-6.9/ contains valid-sized PNGs saved as palette PNGs with a tRNS transparency chunk (a palette-based optimizer or export step): planTarget returns ready, the run deletes all existing APP_IPHONE_67 screenshots, uploads, Apple processing rejects the file(s) with an alpha error, the script aborts, and the display type is left with zero screenshots despite the pre-flight validation the PR promises

Found by 2 of 3 passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant