#2608

fix(versions): list valid --type values and name the missing resource in links errors

Openrudrankriyamwants to merge intofrom

Summary

asc versions links failed for most installs because the --type errors never said what the accepted values were, and a 404 said nothing about which resource was missing.

  • Both --type usage errors now enumerate the ten accepted relationship types: Error: --type is required; must be one of: ... and Error: --type "nope" is not a valid relationship type; must be one of: ... (exit 2, stderr, no prompts).
  • Flag help marks --type required and keeps the same value list; --version-id now says it takes an App Store version ID, not an app ID.
  • A 404 names the resource: an unknown version ID reports app store version "X" was not found; --version-id expects an App Store version ID, not an app ID (list them with: asc versions list --app "APP_ID"), a 404 whose detail names the relationship reports that relationship as missing, and a 404 from a --next/automatic pagination request is attributed to the page URL rather than to --version-id. Any other 404 keeps Apple's message. The original *asc.APIError stays in the chain, so the not-found exit code, HTTP status, and telemetry classification are unchanged.

No default for --type

--type stays required. Telemetry never records flag values (internal/telemetry/event.go, and commands/telemetry.mdx promises sanitized flag names only), so there is no evidence that one relationship type dominates usage. The ten types also split across to-one and to-many semantics with different --limit/--next/--paginate rules, so a silent default would fetch a resource the caller did not ask for.

Verification

  • Live read-only probes against the disposable app confirmed the 404 shapes: an unknown version ID returns There is no resource of type 'appStoreVersions' with id '...', while unconfigured to-one relationships return 200 with null data (so a 404 is almost always a wrong version ID).
  • New cmdtests cover the missing---type and invalid---type value lists, the version-not-found message, a relationship-named 404, an unclassified 404 keeping Apple's message, and the --next attribution; the existing versions diagnostics table was updated.
  • Gates: make generate-command-docs (no change to docs/COMMANDS.md), make build, make format, make check-docs, make lint, ASC_BYPASS_KEYCHAIN=1 make test all pass. codex exec review is clean on both --uncommitted and --base origin/main.

Closes #2596

Activity

1
mintlify[bot]1mo ago

Preview deployment for your docs. Learn more about Mintlify Previews.

ProjectStatusPreviewUpdated
rudrankriyam-app-store-connect-cli-67🟡 Building–Sep 15, 2026, 12:10 PM

💡 Tip: Enable Automations to automatically generate PRs for you.