feat(validate): report screenshot sets over the 10-screenshot cap - #2125
feat(validate): report screenshot sets over the 10-screenshot cap#2125rudrankriyam wants to merge 1 commit into
Conversation
App Store Connect accepts at most 10 screenshots per screenshot set (one display type within one localization), but the validation layer only checked dimensions, platform/display-type fit, and set nonemptiness. An eleventh screenshot failed server-side mid-batch, after earlier uploads had already landed. Add a screenshots.count.exceeds_max error check so validation reports over-full sets before submission. The check runs before the display type is resolved, so sets with unknown or missing display types are still reported, and its remediation names the locale, display type, and count.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Limit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe change adds a maximum of 10 screenshots per set. Validation reports oversized sets before display-type checks and retains dimension and unknown-display-type checks. ChangesScreenshot validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized validation change reports screenshot sets above the 10-screenshot limit before submission; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant ScreenshotSet
participant ScreenshotValidation
participant DisplayTypeValidation
participant ValidationChecks
ScreenshotSet->>ScreenshotValidation: provide screenshot set
ScreenshotValidation->>ValidationChecks: report count error when more than 10 screenshots exist
ScreenshotValidation->>DisplayTypeValidation: continue display-type validation
DisplayTypeValidation->>ValidationChecks: report display-type and dimension checks
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. Track spend and usage in your billing settings. Comment |
Problem
App Store Connect accepts at most 10 screenshots per screenshot set (one display type within one localization).
asc's validation layer checks dimensions, platform/display-type fit, unknown display types, and set nonemptiness, but had no maximum-count check anywhere ininternal/validation/.The result: an eleventh screenshot fails server-side mid-batch, after earlier uploads have already landed, leaving the set in a partially-updated state.
asc validatereported the version as clean right up until that point.Change
Adds a
screenshots.count.exceeds_maxcheck (severityerror) toscreenshotChecksininternal/validation/screenshots.go, soasc validate— and every other consumer of these checks viainternal/validation/report.go— reports over-full sets before submission.LimitScreenshotsPerSet = 10ininternal/validation/limits.go, alongside the existingLimit*constants, so the follow-up upload-preflight wiring can reuse it.screenshot set APP_IPHONE_65 has 11 screenshots, exceeding the maximum of 10Reduce the en-US APP_IPHONE_65 screenshot set from 11 to 10 screenshots or fewercontinueearly). An 11-shot set fails server-side regardless of whetherascrecognizes its display type.Follows the existing
CheckResultID/severity/remediation conventions in the file and the"X exceeds N unit"/ imperative-remediation phrasing used byinternal/validation/metadata.go.Ground truth for the limit
docs/openapi/latest.jsoncarries nomaxItems(0 occurrences across the entire snapshot) and nomaxLengthonAppScreenshotSet/AppScreenshotSetCreateRequest— the cap is not expressed in the schema and is enforced server-side at upload time. Cited here as Apple's documented App Store constraint.docs/API_NOTES.mdhas no existing statement about screenshot counts.appScreenshotSetMaxScreenshots = 10ininternal/cli/assets/assets_screenshots.go, used by the--max-screenshotsdiscovery/limiting logic.internal/screenshotcatalog, or the docs — that the cap differs per display type. A flat 10 matches the repo's own upload-path constant.Scope
Validation layer only. No changes under
internal/cli/assets/or the screenshot upload preflights, which are owned by in-flight PRs #2078 / #2097 / #2102.Follow-up: wiring this same cap into the upload preflight — so
ascrefuses the over-full batch before the first byte goes up, rather than only reporting it at validation time — is deferred until those in-flight screenshot PRs land, at which pointvalidation.LimitScreenshotsPerSetcan replace the privateappScreenshotSetMaxScreenshotsconstant.Tests
TDD, RED first. Added to
internal/validation/screenshot_test.go:TestScreenshotChecks_ExceedsMaxScreenshots— 11 valid-dimension screenshots produce exactly one check:screenshots.count.exceeds_max, error severity, correct locale/resource, message naming display type + count, remediation naming locale + display type + count + limit.TestScreenshotChecks_PassAtMaxScreenshots— exactly 10 is clean (no checks).TestScreenshotChecks_ExceedsMaxAlongsideDimensionMismatch— an over-full set containing one bad-dimension file reports both checks, exactly two.TestScreenshotChecks_ExceedsMaxForUnknownDisplayType— over-full set with an unrecognized display type reports bothcount.exceeds_maxanddisplay_type_unknown.RED confirmed before implementation (3 assertion failures; the "10 is clean" case passed from the start, guarding against an off-by-one). All green after.
Compatibility
Additive. A new error-severity check can newly fail
asc validatefor a version that has an over-full set — which is the point, since that version could not have been submitted successfully anyway. No existing check IDs, messages, or output shapes changed. No command help changed, sodocs/COMMANDS.mdis untouched.Validation
make build,make format,make check-docs,GOLANGCI_LINT_TIMEOUT="10m --allow-parallel-runners" make lint(0 issues), andASC_BYPASS_KEYCHAIN=1 make testall pass — full suite exit 0, zero failures, no flakes hit. The pre-commit hook re-ran docs/format/lint/tests on commit. No live API calls.Summary by CodeRabbit
New Features
Bug Fixes