[PR #751] [MERGED] Improve TestFlight agent UX across builds, notes, groups, and sync #763

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

📋 Pull Request Information

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

Base: mainHead: fix/testflight-agent-ux


📝 Commits (6)

  • 97e8a3f feat(testflight): streamline build and TestFlight targeting
  • 1af80dc fix(builds): align list marketing version and build number filters
  • d9d3a31 test(testflight): add edge-case coverage for builds and sync workflows
  • 339f84f fix(builds): normalize app lookup and harden CLI validation
  • c7e7902 fix(builds): skip app lookup when using --next
  • 3ed7e6c fix(app-lookup): preserve legacy fuzzy resolution after exact matching

📊 Changes

31 files changed (+3023 additions, -83 deletions)

View changed files

📝 cmd/exit_codes_test.go (+63 -0)
📝 internal/asc/client_builds.go (+7 -4)
📝 internal/asc/client_http_test.go (+66 -0)
📝 internal/asc/client_options.go (+25 -3)
📝 internal/asc/client_queries.go (+4 -3)
📝 internal/asc/client_test.go (+20 -0)
📝 internal/asc/output_builds.go (+2 -1)
📝 internal/asc/output_test.go (+29 -2)
📝 internal/cli/betabuildlocalizations/beta_build_localizations.go (+3 -0)
📝 internal/cli/builds/build_test_notes.go (+42 -5)
📝 internal/cli/builds/builds.go (+101 -3)
📝 internal/cli/builds/builds_commands.go (+86 -4)
internal/cli/builds/builds_commands_test.go (+33 -0)
internal/cli/builds/builds_group_resolver_test.go (+107 -0)
📝 internal/cli/builds/builds_latest.go (+14 -5)
📝 internal/cli/builds/builds_latest_test.go (+19 -1)
internal/cli/cmdtest/beta_groups_add_testers_email_edge_test.go (+204 -0)
internal/cli/cmdtest/builds_flag_validation_test.go (+174 -0)
internal/cli/cmdtest/builds_latest_lookup_test.go (+87 -0)
📝 internal/cli/cmdtest/builds_latest_output_test.go (+251 -37)

...and 11 more files

📄 Description

Summary

  • TestFlight & builds: Streamline build and TestFlight targeting with app lookup helpers, group resolver tests, and improved --app / --bundle-id flag handling across build and testflight commands.
  • README reorganization: Reorder sections for better flow (asc skills → Quick Start → Wall of Apps → Common Workflows), extract CI/CD integrations to docs/CI_CD.md, remove inline Local Validation and Security sections.
  • CONTRIBUTING.md: Add full Local Validation checklist so contributors know the exact pre-PR steps.

Design Rationale

Why pre-release version lookup for --version on builds list

The ASC API's filter[version] on /v1/builds filters by build number (CFBundleVersion), not marketing version (CFBundleShortVersionString). Since --version should mean marketing version for agent UX consistency with builds latest, we resolve the marketing version to pre-release version IDs first, then filter builds by those IDs via filter[preReleaseVersion]. --build-number maps directly to filter[version].

Alternatives considered:

  1. Use filter[version] directly for --version: Rejected because it would filter by build number, contradicting the flag name and builds latest semantics.
  2. Client-side filtering: Rejected because it would require fetching all builds and filtering locally, defeating pagination.

Why ResolveAppIDWithLookup for bundle-ID / app-name resolution

Agents often know apps by bundle ID or name rather than numeric ASC ID. The lookup function tries bundle ID first, then app name, and fails clearly on ambiguity. It short-circuits immediately for numeric IDs (zero API calls).

Why BuildDetails alongside Builds in sync YAML

Builds preserves backward compatibility (simple ID list for scripts). BuildDetails enriches with metadata (build number, processing state, upload date) for agents and humans. Both are gated behind --include-builds.

OpenAPI Cross-Check

  • filter[version] — confirmed on GET /v1/builds (line 27392 of docs/openapi/latest.json)
  • filter[preReleaseVersion] — confirmed on GET /v1/builds (line 27526)
  • filter[expired] — confirmed on GET /v1/builds (line 27406)
  • filter[locale] on /v1/builds/{id}/betaBuildLocalizations — confirmed (line 113319)
  • filter[app] on GET /v1/builds — confirmed (line 27435+)

Test plan

  • make format — passes
  • make lint — passes
  • ASC_BYPASS_KEYCHAIN=1 make test — all tests pass
  • Pre-commit hook ran successfully on commit
  • Invalid-value tests: --id + --build conflict, --build without --locale, invalid locale format, missing --tester/--email, --limit out of range
  • Binary black-box tests: missing --app exit code, conflicting --id + --build exit code
  • Combined --version + --build-number cmdtest verifies both filter[preReleaseVersion] and filter[version] query params
  • Verify README renders correctly on GitHub (section order, ToC links, Wall of Apps markers)
  • Verify docs/CI_CD.md contains all CI/CD provider examples
  • Verify CONTRIBUTING.md Local Validation section is complete

Edge Cases Tested

  • --version with no matching pre-release versions → empty data:[] response
  • --next URL bypasses version filters
  • Pre-release version pagination across multiple pages
  • Bundle-ID / app-name lookup: exact match, ambiguous (multiple), not found
  • Beta group resolution: by ID, by name, ambiguous name, not found, deduplication
  • --email tester resolution: found, not found, multiple matches, deduplication with --tester
  • --build + --locale localization lookup: found, not found, multiple

🔄 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/751 **Author:** [@rudrankriyam](https://github.com/rudrankriyam) **Created:** 2/24/2026 **Status:** ✅ Merged **Merged:** 2/24/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `fix/testflight-agent-ux` --- ### 📝 Commits (6) - [`97e8a3f`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/97e8a3fc765ae0d51778e0f38b84d1e7cdbd2671) feat(testflight): streamline build and TestFlight targeting - [`1af80dc`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/1af80dc2bd37ebe1ca61a2f16b19137f0de6b47d) fix(builds): align list marketing version and build number filters - [`d9d3a31`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/d9d3a312e31aa3ecd103fb275127842a5164e898) test(testflight): add edge-case coverage for builds and sync workflows - [`339f84f`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/339f84fafdde1c5379463e1614abc36a67074da2) fix(builds): normalize app lookup and harden CLI validation - [`c7e7902`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/c7e79026a31c16d4479c54f1aeed4aeaa530ee3b) fix(builds): skip app lookup when using --next - [`3ed7e6c`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/3ed7e6ccf1f5b812aa0e180cdf97fbdcf0b9278d) fix(app-lookup): preserve legacy fuzzy resolution after exact matching ### 📊 Changes **31 files changed** (+3023 additions, -83 deletions) <details> <summary>View changed files</summary> 📝 `cmd/exit_codes_test.go` (+63 -0) 📝 `internal/asc/client_builds.go` (+7 -4) 📝 `internal/asc/client_http_test.go` (+66 -0) 📝 `internal/asc/client_options.go` (+25 -3) 📝 `internal/asc/client_queries.go` (+4 -3) 📝 `internal/asc/client_test.go` (+20 -0) 📝 `internal/asc/output_builds.go` (+2 -1) 📝 `internal/asc/output_test.go` (+29 -2) 📝 `internal/cli/betabuildlocalizations/beta_build_localizations.go` (+3 -0) 📝 `internal/cli/builds/build_test_notes.go` (+42 -5) 📝 `internal/cli/builds/builds.go` (+101 -3) 📝 `internal/cli/builds/builds_commands.go` (+86 -4) ➕ `internal/cli/builds/builds_commands_test.go` (+33 -0) ➕ `internal/cli/builds/builds_group_resolver_test.go` (+107 -0) 📝 `internal/cli/builds/builds_latest.go` (+14 -5) 📝 `internal/cli/builds/builds_latest_test.go` (+19 -1) ➕ `internal/cli/cmdtest/beta_groups_add_testers_email_edge_test.go` (+204 -0) ➕ `internal/cli/cmdtest/builds_flag_validation_test.go` (+174 -0) ➕ `internal/cli/cmdtest/builds_latest_lookup_test.go` (+87 -0) 📝 `internal/cli/cmdtest/builds_latest_output_test.go` (+251 -37) _...and 11 more files_ </details> ### 📄 Description ## Summary - **TestFlight & builds**: Streamline build and TestFlight targeting with app lookup helpers, group resolver tests, and improved `--app` / `--bundle-id` flag handling across build and testflight commands. - **README reorganization**: Reorder sections for better flow (asc skills → Quick Start → Wall of Apps → Common Workflows), extract CI/CD integrations to `docs/CI_CD.md`, remove inline Local Validation and Security sections. - **CONTRIBUTING.md**: Add full Local Validation checklist so contributors know the exact pre-PR steps. ## Design Rationale ### Why pre-release version lookup for `--version` on `builds list` The ASC API's `filter[version]` on `/v1/builds` filters by **build number** (CFBundleVersion), not marketing version (CFBundleShortVersionString). Since `--version` should mean marketing version for agent UX consistency with `builds latest`, we resolve the marketing version to pre-release version IDs first, then filter builds by those IDs via `filter[preReleaseVersion]`. `--build-number` maps directly to `filter[version]`. **Alternatives considered:** 1. *Use `filter[version]` directly for `--version`*: Rejected because it would filter by build number, contradicting the flag name and `builds latest` semantics. 2. *Client-side filtering*: Rejected because it would require fetching all builds and filtering locally, defeating pagination. ### Why `ResolveAppIDWithLookup` for bundle-ID / app-name resolution Agents often know apps by bundle ID or name rather than numeric ASC ID. The lookup function tries bundle ID first, then app name, and fails clearly on ambiguity. It short-circuits immediately for numeric IDs (zero API calls). ### Why `BuildDetails` alongside `Builds` in sync YAML `Builds` preserves backward compatibility (simple ID list for scripts). `BuildDetails` enriches with metadata (build number, processing state, upload date) for agents and humans. Both are gated behind `--include-builds`. ## OpenAPI Cross-Check - `filter[version]` — confirmed on `GET /v1/builds` (line 27392 of `docs/openapi/latest.json`) - `filter[preReleaseVersion]` — confirmed on `GET /v1/builds` (line 27526) - `filter[expired]` — confirmed on `GET /v1/builds` (line 27406) - `filter[locale]` on `/v1/builds/{id}/betaBuildLocalizations` — confirmed (line 113319) - `filter[app]` on `GET /v1/builds` — confirmed (line 27435+) ## Test plan - [x] `make format` — passes - [x] `make lint` — passes - [x] `ASC_BYPASS_KEYCHAIN=1 make test` — all tests pass - [x] Pre-commit hook ran successfully on commit - [x] Invalid-value tests: `--id` + `--build` conflict, `--build` without `--locale`, invalid locale format, missing `--tester`/`--email`, `--limit` out of range - [x] Binary black-box tests: missing `--app` exit code, conflicting `--id` + `--build` exit code - [x] Combined `--version` + `--build-number` cmdtest verifies both `filter[preReleaseVersion]` and `filter[version]` query params - [x] Verify README renders correctly on GitHub (section order, ToC links, Wall of Apps markers) - [x] Verify `docs/CI_CD.md` contains all CI/CD provider examples - [x] Verify `CONTRIBUTING.md` Local Validation section is complete ## Edge Cases Tested - `--version` with no matching pre-release versions → empty `data:[]` response - `--next` URL bypasses version filters - Pre-release version pagination across multiple pages - Bundle-ID / app-name lookup: exact match, ambiguous (multiple), not found - Beta group resolution: by ID, by name, ambiguous name, not found, deduplication - `--email` tester resolution: found, not found, multiple matches, deduplication with `--tester` - `--build` + `--locale` localization lookup: found, not found, multiple --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 22:32:26 +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#763
No description provided.