[PR #436] [MERGED] migrate: follow-up hardening for appInfo selection #524

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/436
Author: @rudrankriyam
Created: 2/7/2026
Status: Merged
Merged: 2/7/2026
Merged by: @rudrankriyam

Base: mainHead: followup/migrate-appinfo-selector-hardening


📝 Commits (1)

  • fe56d70 migrate: harden app info selection logic

📊 Changes

2 files changed (+62 additions, -30 deletions)

View changed files

📝 internal/cli/migrate/migrate.go (+29 -30)
📝 internal/cli/migrate/migrate_test.go (+33 -0)

📄 Description

Summary

Follow-up PR after #434 and #435 to harden migrate appInfo selection and remove drift between import/export paths.

The 5 follow-up changes

  1. Unify selector usage: migrate export now uses selectBestAppInfoID (same as migrate import) instead of a separate helper.
  2. Remove duplicate selector path: deleted pickEditableAppInfoID to avoid divergent logic over time.
  3. Nil/empty safety: selectBestAppInfoID now safely handles nil and empty responses.
  4. State fallback hardening: fallback selection now considers both state and appStoreState and treats live states (READY_FOR_DISTRIBUTION, READY_FOR_SALE) as non-editable.
  5. Regression coverage: added tests for nil/empty selector input and state-only selection behavior when appStoreState is missing.

Validation

  • go test ./internal/cli/migrate -run "TestSelectBestAppInfoID" -count=1
  • make test
  • make build

Notes

  • make format was attempted but gofumpt is not installed in this environment; files were formatted with gofmt.

🔄 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/436 **Author:** [@rudrankriyam](https://github.com/rudrankriyam) **Created:** 2/7/2026 **Status:** ✅ Merged **Merged:** 2/7/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `followup/migrate-appinfo-selector-hardening` --- ### 📝 Commits (1) - [`fe56d70`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/fe56d708c794cec968912883972df374e5e6ee7c) migrate: harden app info selection logic ### 📊 Changes **2 files changed** (+62 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `internal/cli/migrate/migrate.go` (+29 -30) 📝 `internal/cli/migrate/migrate_test.go` (+33 -0) </details> ### 📄 Description ## Summary Follow-up PR after #434 and #435 to harden `migrate` appInfo selection and remove drift between import/export paths. ## The 5 follow-up changes 1. **Unify selector usage**: `migrate export` now uses `selectBestAppInfoID` (same as `migrate import`) instead of a separate helper. 2. **Remove duplicate selector path**: deleted `pickEditableAppInfoID` to avoid divergent logic over time. 3. **Nil/empty safety**: `selectBestAppInfoID` now safely handles `nil` and empty responses. 4. **State fallback hardening**: fallback selection now considers both `state` and `appStoreState` and treats live states (`READY_FOR_DISTRIBUTION`, `READY_FOR_SALE`) as non-editable. 5. **Regression coverage**: added tests for nil/empty selector input and state-only selection behavior when `appStoreState` is missing. ## Validation - `go test ./internal/cli/migrate -run "TestSelectBestAppInfoID" -count=1` - `make test` - `make build` ## Notes - `make format` was attempted but `gofumpt` is not installed in this environment; files were formatted with `gofmt`. --- <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#524
No description provided.