[GH-ISSUE #48] Add beta-testers get and list --build #11

Closed
opened 2026-02-26 21:32:45 +03:00 by kerem · 3 comments
Owner

Originally created by @rudrankriyam on GitHub (Jan 23, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/48

Summary

Add beta tester detail retrieval and support listing testers by build.

API endpoints

CLI

  • asc beta-testers get --id "TESTER_ID"
  • asc beta-testers list --app "APP_ID" --build "BUILD_ID" [--limit ...] [--next ...] [--paginate]

Output

  • JSON minified default; --output table|markdown; --pretty for JSON.

Tests

  • Client tests for filter[builds]
  • CLI tests for new flags + validation
Originally created by @rudrankriyam on GitHub (Jan 23, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/48 ## Summary Add beta tester detail retrieval and support listing testers by build. ## API endpoints - `GET /v1/betaTesters/{id}` (read) — https://developer.apple.com/documentation/appstoreconnectapi/read_beta_tester_information - `GET /v1/betaTesters` (list) — https://developer.apple.com/documentation/appstoreconnectapi/list_beta_testers - Use `filter[builds]={buildId}` for list-by-build ## CLI - `asc beta-testers get --id "TESTER_ID"` - `asc beta-testers list --app "APP_ID" --build "BUILD_ID" [--limit ...] [--next ...] [--paginate]` ## Output - JSON minified default; `--output table|markdown`; `--pretty` for JSON. ## Tests - Client tests for `filter[builds]` - CLI tests for new flags + validation
kerem closed this issue 2026-02-26 21:32:45 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Jan 23, 2026):

@cursor Please implement this issue.

Implementation Guide

1. Modify cmd/beta.go

Add new subcommand to BetaTestersCommand():

BetaTestersGetCommand()

Also modify BetaTestersListCommand() to support --build filter.

2. Add Client Methods in internal/asc/client.go

// GetBetaTester retrieves a single beta tester by ID
// GET /v1/betaTesters/{id}
func (c *Client) GetBetaTester(ctx context.Context, testerID string) (*BetaTesterResponse, error) {
    url := fmt.Sprintf("%s/betaTesters/%s", baseURL, testerID)
    // GET request
}

// Add new option for build filter
func WithBetaTestersBuildID(buildID string) BetaTestersOption {
    return func(q *betaTestersQuery) {
        q.filterBuilds = buildID
    }
}

Update betaTestersQuery struct:

type betaTestersQuery struct {
    // existing fields...
    filterBuilds string  // NEW: filter[builds]
}

Update buildBetaTestersQuery() to include:

if query.filterBuilds != "" {
    params.Add("filter[builds]", query.filterBuilds)
}

3. Add Response Type

type BetaTesterResponse struct {
    Data  BetaTester `json:"data"`
    Links Links      `json:"links,omitempty"`
}

4. CLI Flags

For get:

  • --id (required, tester ID)
  • --output, --pretty

For list (add new flag):

  • --build (optional, filter by build ID)

5. Testing

Unit tests in cmd/commands_test.go:

{"beta-testers get missing id", []string{"beta-testers", "get"}, ...}
{"beta-testers list with build filter", []string{"beta-testers", "list", "--app", "X", "--build", "Y"}, ...}

Client tests in internal/asc/client_http_test.go:

  • Test filter[builds] query parameter
  • Test GetBetaTester response parsing

Live API test:

# Get a tester ID first
./asc beta-testers list --app 6747745091 --limit 1

# Then test get
./asc beta-testers get --id "TESTER_ID"
./asc beta-testers get --id "TESTER_ID" --output table

# Test list with build filter (get a build ID first)
./asc builds list --app 6747745091 --limit 1
./asc beta-testers list --app 6747745091 --build "BUILD_ID"

6. Output Formatters

Add single-tester formatters:

func printBetaTesterTable(resp *BetaTesterResponse) error {
    // Single row table
}

func printBetaTesterMarkdown(resp *BetaTesterResponse) error {
    // Single row markdown
}

7. Code Standards

  • Use strings.TrimSpace() on tester ID and build ID
  • Follow existing patterns in GetBetaGroup() for single-resource fetch
  • Reuse existing BetaTester and BetaTesterAttributes types
  • Run make format && make lint && make test before committing
<!-- gh-comment-id:3792264734 --> @rudrankriyam commented on GitHub (Jan 23, 2026): @cursor Please implement this issue. ## Implementation Guide ### 1. Modify `cmd/beta.go` Add new subcommand to `BetaTestersCommand()`: ```go BetaTestersGetCommand() ``` Also modify `BetaTestersListCommand()` to support `--build` filter. ### 2. Add Client Methods in `internal/asc/client.go` ```go // GetBetaTester retrieves a single beta tester by ID // GET /v1/betaTesters/{id} func (c *Client) GetBetaTester(ctx context.Context, testerID string) (*BetaTesterResponse, error) { url := fmt.Sprintf("%s/betaTesters/%s", baseURL, testerID) // GET request } // Add new option for build filter func WithBetaTestersBuildID(buildID string) BetaTestersOption { return func(q *betaTestersQuery) { q.filterBuilds = buildID } } ``` Update `betaTestersQuery` struct: ```go type betaTestersQuery struct { // existing fields... filterBuilds string // NEW: filter[builds] } ``` Update `buildBetaTestersQuery()` to include: ```go if query.filterBuilds != "" { params.Add("filter[builds]", query.filterBuilds) } ``` ### 3. Add Response Type ```go type BetaTesterResponse struct { Data BetaTester `json:"data"` Links Links `json:"links,omitempty"` } ``` ### 4. CLI Flags For `get`: - `--id` (required, tester ID) - `--output`, `--pretty` For `list` (add new flag): - `--build` (optional, filter by build ID) ### 5. Testing **Unit tests** in `cmd/commands_test.go`: ```go {"beta-testers get missing id", []string{"beta-testers", "get"}, ...} {"beta-testers list with build filter", []string{"beta-testers", "list", "--app", "X", "--build", "Y"}, ...} ``` **Client tests** in `internal/asc/client_http_test.go`: - Test `filter[builds]` query parameter - Test GetBetaTester response parsing **Live API test**: ```bash # Get a tester ID first ./asc beta-testers list --app 6747745091 --limit 1 # Then test get ./asc beta-testers get --id "TESTER_ID" ./asc beta-testers get --id "TESTER_ID" --output table # Test list with build filter (get a build ID first) ./asc builds list --app 6747745091 --limit 1 ./asc beta-testers list --app 6747745091 --build "BUILD_ID" ``` ### 6. Output Formatters Add single-tester formatters: ```go func printBetaTesterTable(resp *BetaTesterResponse) error { // Single row table } func printBetaTesterMarkdown(resp *BetaTesterResponse) error { // Single row markdown } ``` ### 7. Code Standards - Use `strings.TrimSpace()` on tester ID and build ID - Follow existing patterns in `GetBetaGroup()` for single-resource fetch - Reuse existing `BetaTester` and `BetaTesterAttributes` types - Run `make format && make lint && make test` before committing
Author
Owner

@cursor[bot] commented on GitHub (Jan 23, 2026):

Summary:

  • Added beta-testers get CLI plus --build filtering for beta-testers list, including client support for build filters and single-tester fetch.
  • Added single-tester table/markdown formatters and wired them into output selection.
  • Expanded tests for beta tester validation/flags and new client query/get behavior.

Tests:

  • make format
  • make lint
  • make test

Notes:

  • Live API tests weren’t run (require credentials).

View PR
Open in Cursor Open in Web

<!-- gh-comment-id:3792265056 --> @cursor[bot] commented on GitHub (Jan 23, 2026): Summary: - Added `beta-testers get` CLI plus `--build` filtering for `beta-testers list`, including client support for build filters and single-tester fetch. - Added single-tester table/markdown formatters and wired them into output selection. - Expanded tests for beta tester validation/flags and new client query/get behavior. Tests: - `make format` - `make lint` - `make test` Notes: - Live API tests weren’t run (require credentials). <a href="https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/56"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/view-pr-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/view-pr-light.svg"><img alt="View PR" src="https://cursor.com/view-pr-light.svg"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-4caa7c3c-41e6-4bb1-99f6-a3836290790f"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-4caa7c3c-41e6-4bb1-99f6-a3836290790f"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a>
Author
Owner

@rudrankriyam commented on GitHub (Jan 23, 2026):

Implemented in PR #56 - beta-testers get command and --build filter for list.

<!-- gh-comment-id:3792500988 --> @rudrankriyam commented on GitHub (Jan 23, 2026): Implemented in PR #56 - beta-testers get command and --build filter for list.
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#11
No description provided.