mirror of
https://github.com/rudrankriyam/App-Store-Connect-CLI.git
synced 2026-04-25 23:55:51 +03:00
[PR #466] [MERGED] fix: complete age rating declaration support and handle whatsNew on initial releases #549
Labels
No labels
bug
bug
documentation
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/App-Store-Connect-CLI#549
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/466
Author: @cameronehrlich
Created: 2/10/2026
Status: ✅ Merged
Merged: 2/10/2026
Merged by: @rudrankriyam
Base:
main← Head:fix/age-rating-and-whats-new-errors📝 Commits (7)
f48329bfix: add missing gunsOrOtherWeapons flag and handle whatsNew on initial releases9b1dacffix: add all missing age rating declaration fields from Apple API spec5ecb268refactor: table-driven age rating parsing, fix output display, improve tests6162181style: fix gofumpt struct field alignment13a63f5fix: remove IsBoolFlag from OptionalBool to fix space-separated flag parsing71f35c0fix: harden age rating/localization handling and restore bool flag ergonomicsb07e91bci: increase golangci-lint timeout for stable checks📊 Changes
12 files changed (+613 additions, -115 deletions)
View changed files
📝
Makefile(+2 -1)📝
internal/asc/age_rating.go(+23 -4)📝
internal/asc/output_age_rating.go(+17 -3)📝
internal/asc/output_test.go(+34 -13)📝
internal/cli/agerating/age_rating.go(+134 -84)📝
internal/cli/agerating/age_rating_test.go(+66 -2)📝
internal/cli/cmdtest/promoted_purchases_test.go(+5 -5)📝
internal/cli/shared/localizations.go(+46 -2)➕
internal/cli/shared/localizations_upload_test.go(+204 -0)📝
internal/cli/shared/optional_bool.go(+10 -1)➕
internal/cli/shared/optional_bool_test.go(+66 -0)📝
internal/cli/shared/shared.go(+6 -0)📄 Description
Problem
The
age-rating setcommand fails when trying to update age rating declarations because the CLI is missing several fields that Apple's API now requires. The API returns:Additionally, uploading version localizations with a
whatsNewfield on an initial v1.0 release causes a hard failure, since Apple doesn't support What's New text until there's a prior version.Finally,
OptionalBoolflags like--available-in-new-territoriesfail when using space-separated syntax (--flag true) becauseIsBoolFlag()tells Go's flag parser to treat them as standalone booleans.Solution
1. Add all missing age rating fields
Cross-referenced Apple's OpenAPI spec to add every missing content descriptor:
gunsOrOtherWeaponsadvertisinghealthOrWellnessTopicslootBoxmessagingAndChatparentalControlsageAssuranceuserGeneratedContentageRatingOverridekoreaAgeRatingOverride2. Fix output display
All new fields are now shown in
age-rating get --output tableand--output markdown.3. Table-driven parsing
Refactored
buildAgeRatingAttributesfrom ~130 lines of repetitive blocks into two declarative tables with shared loops. Adding a new field now requires one table entry instead of changes in three places.4. Graceful whatsNew handling
When uploading version localizations for an initial release, the API rejects the whatsNew field. The CLI now catches this, warns the user, and retries without it.
5. Fix OptionalBool space-separated flag parsing
OptionalBoolimplementedIsBoolFlag()returningtrue, which tells Go's flag package to treat the flag like a built-in bool:--flag valueis parsed as--flag(implicit true) + positional arg. This broke--available-in-new-territories trueand any other OptionalBool flag using space-separated syntax.Fix: Remove
IsBoolFlag()entirely so the parser always expects an explicit value. Both--flag=trueand--flag truework correctly after this change.6. Cleanup
--seventeen-plusflag (not in Apple's current API spec)Files changed
internal/asc/age_rating.gointernal/asc/output_age_rating.gointernal/asc/output_test.gointernal/cli/agerating/age_rating.gointernal/cli/agerating/age_rating_test.gointernal/cli/shared/localizations.gointernal/cli/shared/optional_bool.goTest plan
go test ./internal/cli/agerating/- all passgo test ./internal/asc/- all passgo test ./internal/cli/shared/- all passgo test ./internal/cli/apps/- all pass🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.