[PR #434] [MERGED] Fix migrate import: omit locale on PATCH + select draft AppInfo #525

Closed
opened 2026-02-26 22:31:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/434
Author: @cameronehrlich
Created: 2/7/2026
Status: Merged
Merged: 2/7/2026
Merged by: @rudrankriyam

Base: mainHead: fix/migrate-import-draft-appinfo


📝 Commits (1)

  • 0e70a36 Fix migrate import for draft app info

📊 Changes

3 files changed (+98 additions, -2 deletions)

View changed files

📝 internal/asc/client.go (+6 -0)
📝 internal/asc/client_http_test.go (+44 -0)
📝 internal/cli/migrate/migrate.go (+48 -2)

📄 Description

This fixes two issues that break asc migrate import for apps with multiple localizations.

  1. Omit immutable locale on PATCH updates
  • App Store Connect rejects UPDATE requests that include locale:
    The attribute 'locale' can not be included in a 'UPDATE' request
  • UpdateAppStoreVersionLocalization and UpdateAppInfoLocalization now clear attributes.Locale before building the PATCH payload.
  • Added unit tests that assert "locale" is not present in the JSON body for these PATCH requests.
  1. Prefer the draft (editable) AppInfo during migrate import/export
  • Apps can have multiple AppInfo records (commonly a live one in READY_FOR_DISTRIBUTION and a draft one in PREPARE_FOR_SUBMISSION).
  • Updating AppInfoLocalization.name/subtitle against the live AppInfo fails with:
    The field 'name' can not be modified in the current state.
  • migrate import and migrate export now select the AppInfo in PREPARE_FOR_SUBMISSION when present, otherwise fall back sensibly.

Validation

  • go test ./...
  • Manual end-to-end migrate import run against a real app that has both live + draft AppInfo records; confirmed the CLI targets the PREPARE_FOR_SUBMISSION AppInfo and completes without API errors.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/434 **Author:** [@cameronehrlich](https://github.com/cameronehrlich) **Created:** 2/7/2026 **Status:** ✅ Merged **Merged:** 2/7/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `fix/migrate-import-draft-appinfo` --- ### 📝 Commits (1) - [`0e70a36`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/0e70a36bac657fb2d20bd92b2cb9d18a02f3596e) Fix migrate import for draft app info ### 📊 Changes **3 files changed** (+98 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `internal/asc/client.go` (+6 -0) 📝 `internal/asc/client_http_test.go` (+44 -0) 📝 `internal/cli/migrate/migrate.go` (+48 -2) </details> ### 📄 Description This fixes two issues that break `asc migrate import` for apps with multiple localizations. 1) Omit immutable `locale` on PATCH updates - App Store Connect rejects UPDATE requests that include `locale`: `The attribute 'locale' can not be included in a 'UPDATE' request` - `UpdateAppStoreVersionLocalization` and `UpdateAppInfoLocalization` now clear `attributes.Locale` before building the PATCH payload. - Added unit tests that assert `"locale"` is not present in the JSON body for these PATCH requests. 2) Prefer the draft (editable) AppInfo during migrate import/export - Apps can have multiple `AppInfo` records (commonly a live one in `READY_FOR_DISTRIBUTION` and a draft one in `PREPARE_FOR_SUBMISSION`). - Updating `AppInfoLocalization.name/subtitle` against the live AppInfo fails with: `The field 'name' can not be modified in the current state.` - `migrate import` and `migrate export` now select the `AppInfo` in `PREPARE_FOR_SUBMISSION` when present, otherwise fall back sensibly. Validation - `go test ./...` - Manual end-to-end `migrate import` run against a real app that has both live + draft AppInfo records; confirmed the CLI targets the `PREPARE_FOR_SUBMISSION` AppInfo and completes without API errors. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 22:31:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#525
No description provided.