[GH-ISSUE #468] Parity: Bundle ID capability update endpoint (PATCH) #130

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

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

Overview

Add parity support for updating an existing bundle ID capability.

Scope (OpenAPI resources)

  • PATCH /v1/bundleIdCapabilities/{id}

Current state

Current capability support includes:

  • list capabilities for a bundle ID
  • create capability
  • delete capability

Update/patch for an existing capability is still missing.

Proposed CLI

Add a dedicated update command:

  • asc bundle-ids capabilities update --id "CAPABILITY_ID" --settings '[{"key":"ICLOUD_VERSION","options":[{"key":"XCODE_13","enabled":true}]}]'

Optional (if API schema supports it safely):

  • --capability for capability type updates

Examples:

  • asc bundle-ids capabilities update --id "CAPABILITY_ID" --settings '[{"key":"ICLOUD_VERSION","options":[{"key":"XCODE_13","enabled":true}]}]'
  • asc bundle-ids capabilities update --id "CAPABILITY_ID" --output table

Flag patterns

Common: --id, --settings, --output, --pretty

Validation rules:

  • --id is required
  • At least one update field is required
  • --settings must be valid JSON array

Detailed TODO

  • Add update request/attribute types for bundle ID capabilities in internal/asc/signing.go.
  • Add client method in internal/asc/client_signing.go:
    • UpdateBundleIDCapability(ctx, capabilityID, attrs) -> PATCH /v1/bundleIdCapabilities/{id}
  • Add CLI subcommand in internal/cli/bundleids/bundle_ids_capabilities.go:
    • BundleIDsCapabilitiesUpdateCommand()
  • Reuse/extend existing JSON settings parsing helper for update payload validation.
  • Wire command into the capabilities command group and help output.

Acceptance criteria

  • Existing bundle ID capability can be patched by ID.
  • Invalid JSON settings fail with clear usage error.
  • Missing update fields fail with clear usage error.
  • make format, make lint, and make test pass.

Tests

  • HTTP client test for PATCH /v1/bundleIdCapabilities/{id} with payload assertion.
  • cmdtests for required --id validation.
  • cmdtests for invalid --settings JSON.
  • cmdtests for success path and output handling.

Implementation notes

  • Follow existing certificate update pattern (PATCH) for structure and tests.
  • Keep behavior explicit and non-interactive.

References

  • docs/openapi/paths.txt
  • docs/openapi/latest.json
  • internal/asc/client_signing.go
  • internal/asc/signing.go
  • internal/cli/bundleids/bundle_ids_capabilities.go
Originally created by @rudrankriyam on GitHub (Feb 10, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/468 # Overview Add parity support for updating an existing bundle ID capability. # Scope (OpenAPI resources) - `PATCH /v1/bundleIdCapabilities/{id}` # Current state Current capability support includes: - list capabilities for a bundle ID - create capability - delete capability Update/patch for an existing capability is still missing. # Proposed CLI Add a dedicated update command: - `asc bundle-ids capabilities update --id "CAPABILITY_ID" --settings '[{"key":"ICLOUD_VERSION","options":[{"key":"XCODE_13","enabled":true}]}]'` Optional (if API schema supports it safely): - `--capability` for capability type updates Examples: - `asc bundle-ids capabilities update --id "CAPABILITY_ID" --settings '[{"key":"ICLOUD_VERSION","options":[{"key":"XCODE_13","enabled":true}]}]'` - `asc bundle-ids capabilities update --id "CAPABILITY_ID" --output table` # Flag patterns Common: `--id`, `--settings`, `--output`, `--pretty` Validation rules: - `--id` is required - At least one update field is required - `--settings` must be valid JSON array # Detailed TODO - [ ] Add update request/attribute types for bundle ID capabilities in `internal/asc/signing.go`. - [ ] Add client method in `internal/asc/client_signing.go`: - [ ] `UpdateBundleIDCapability(ctx, capabilityID, attrs)` -> `PATCH /v1/bundleIdCapabilities/{id}` - [ ] Add CLI subcommand in `internal/cli/bundleids/bundle_ids_capabilities.go`: - [ ] `BundleIDsCapabilitiesUpdateCommand()` - [ ] Reuse/extend existing JSON settings parsing helper for update payload validation. - [ ] Wire command into the capabilities command group and help output. # Acceptance criteria - [ ] Existing bundle ID capability can be patched by ID. - [ ] Invalid JSON settings fail with clear usage error. - [ ] Missing update fields fail with clear usage error. - [ ] `make format`, `make lint`, and `make test` pass. # Tests - [ ] HTTP client test for `PATCH /v1/bundleIdCapabilities/{id}` with payload assertion. - [ ] cmdtests for required `--id` validation. - [ ] cmdtests for invalid `--settings` JSON. - [ ] cmdtests for success path and output handling. # Implementation notes - Follow existing certificate update pattern (`PATCH`) for structure and tests. - Keep behavior explicit and non-interactive. # References - `docs/openapi/paths.txt` - `docs/openapi/latest.json` - `internal/asc/client_signing.go` - `internal/asc/signing.go` - `internal/cli/bundleids/bundle_ids_capabilities.go`
kerem closed this issue 2026-02-26 21:33:40 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Feb 10, 2026):

@cursor Please implement this issue end-to-end.

What to build

Add update support for existing bundle ID capabilities.

Endpoint to add

  • PATCH /v1/bundleIdCapabilities/{id}

Implementation plan

  1. Types (internal/asc/signing.go)
  • Add update request types for bundle ID capabilities:
    • update attributes
    • update data envelope
    • update request envelope
  • Keep payload sparse (only explicitly set fields).
  1. Client (internal/asc/client_signing.go)
  • Add method:
    • UpdateBundleIDCapability(ctx, capabilityID, attrs)
  • Use path: /v1/bundleIdCapabilities/{id}
  • Return parsed BundleIDCapabilityResponse.
  1. CLI (internal/cli/bundleids/bundle_ids_capabilities.go)
  • Add subcommand:
    • asc bundle-ids capabilities update --id "CAPABILITY_ID" --settings 'JSON'
  • Reuse JSON settings parser used by create path.
  • Validation:
    • --id required
    • at least one update field required
    • invalid --settings JSON should return usage error (exit code 2)
  • Wire into BundleIDsCapabilitiesCommand() subcommands list.

New tests to write

A) Client HTTP tests (internal/asc/client_http_test.go)

  • TestUpdateBundleIDCapability_UsesPatchPath
    • assert method PATCH
    • assert path /v1/bundleIdCapabilities/{id}
    • assert request body type is bundleIdCapabilities
    • assert settings payload shape

B) CLI cmdtests (new file)

  • internal/cli/cmdtest/bundle_ids_capabilities_update_test.go

Add test cases:

  • missing --id -> usage error
  • no update fields -> usage error
  • invalid --settings JSON -> usage error
  • success path -> returns updated resource output

C) Command/help coverage

  • Ensure command appears under asc bundle-ids capabilities --help output and has examples.

How to test locally

Run exactly:

  • make format
  • make lint
  • make test

Targeted tests:

  • go test ./internal/asc -run UpdateBundleIDCapability
  • go test ./internal/cli/cmdtest -run BundleID.*Capabilities.*Update

Done criteria

  • Patch endpoint is reachable via CLI update command.
  • Validation and output behavior are covered by cmdtests.
  • All checks pass (format, lint, test).
<!-- gh-comment-id:3877922530 --> @rudrankriyam commented on GitHub (Feb 10, 2026): @cursor Please implement this issue end-to-end. ## What to build Add update support for existing bundle ID capabilities. ### Endpoint to add - `PATCH /v1/bundleIdCapabilities/{id}` ## Implementation plan 1. **Types (`internal/asc/signing.go`)** - Add update request types for bundle ID capabilities: - update attributes - update data envelope - update request envelope - Keep payload sparse (only explicitly set fields). 2. **Client (`internal/asc/client_signing.go`)** - Add method: - `UpdateBundleIDCapability(ctx, capabilityID, attrs)` - Use path: `/v1/bundleIdCapabilities/{id}` - Return parsed `BundleIDCapabilityResponse`. 3. **CLI (`internal/cli/bundleids/bundle_ids_capabilities.go`)** - Add subcommand: - `asc bundle-ids capabilities update --id "CAPABILITY_ID" --settings 'JSON'` - Reuse JSON settings parser used by create path. - Validation: - `--id` required - at least one update field required - invalid `--settings` JSON should return usage error (exit code 2) - Wire into `BundleIDsCapabilitiesCommand()` subcommands list. ## New tests to write ### A) Client HTTP tests (`internal/asc/client_http_test.go`) - `TestUpdateBundleIDCapability_UsesPatchPath` - assert method `PATCH` - assert path `/v1/bundleIdCapabilities/{id}` - assert request body type is `bundleIdCapabilities` - assert settings payload shape ### B) CLI cmdtests (new file) - `internal/cli/cmdtest/bundle_ids_capabilities_update_test.go` Add test cases: - missing `--id` -> usage error - no update fields -> usage error - invalid `--settings` JSON -> usage error - success path -> returns updated resource output ### C) Command/help coverage - Ensure command appears under `asc bundle-ids capabilities --help` output and has examples. ## How to test locally Run exactly: - `make format` - `make lint` - `make test` Targeted tests: - `go test ./internal/asc -run UpdateBundleIDCapability` - `go test ./internal/cli/cmdtest -run BundleID.*Capabilities.*Update` ## Done criteria - Patch endpoint is reachable via CLI update command. - Validation and output behavior are covered by cmdtests. - All checks pass (`format`, `lint`, `test`).
Author
Owner

@cursor[bot] commented on GitHub (Feb 10, 2026):

Implementation is complete. Here's a summary of what was done:

Types (internal/asc/signing.go):

  • Added BundleIDCapabilityUpdateAttributes with capabilityType and settings fields (both omitempty for sparse payloads)
  • Added BundleIDCapabilityUpdateData envelope with type, ID, and optional attributes
  • Added BundleIDCapabilityUpdateRequest wrapper

Client (internal/asc/client_signing.go):

  • Added UpdateBundleIDCapability(ctx, capabilityID, attrs) method using PATCH /v1/bundleIdCapabilities/{id}, returning *BundleIDCapabilityResponse

CLI (internal/cli/bundleids/bundle_ids_capabilities.go):

  • Added BundleIDsCapabilitiesUpdateCommand() with flags: --id, --capability, --settings, --output, --pretty
  • Validation: --id required, at least one update field required (--capability or --settings), invalid --settings JSON returns usage error (exit code 2)
  • Wired into BundleIDsCapabilitiesCommand() subcommands and updated help examples

Tests:

  • Client HTTP test: TestUpdateBundleIDCapability_UsesPatchPath - asserts PATCH method, correct path, request body type/shape, and settings payload
  • CLI cmdtests (5 tests): missing --id, no update fields, invalid settings JSON, success path with settings, success path with capability type

Verification: make format, make lint, and make test all pass.

View PR

Open in Cursor Open in Web

<!-- gh-comment-id:3877923129 --> @cursor[bot] commented on GitHub (Feb 10, 2026): Implementation is complete. Here's a summary of what was done: **Types** (`internal/asc/signing.go`): - Added `BundleIDCapabilityUpdateAttributes` with `capabilityType` and `settings` fields (both `omitempty` for sparse payloads) - Added `BundleIDCapabilityUpdateData` envelope with type, ID, and optional attributes - Added `BundleIDCapabilityUpdateRequest` wrapper **Client** (`internal/asc/client_signing.go`): - Added `UpdateBundleIDCapability(ctx, capabilityID, attrs)` method using `PATCH /v1/bundleIdCapabilities/{id}`, returning `*BundleIDCapabilityResponse` **CLI** (`internal/cli/bundleids/bundle_ids_capabilities.go`): - Added `BundleIDsCapabilitiesUpdateCommand()` with flags: `--id`, `--capability`, `--settings`, `--output`, `--pretty` - Validation: `--id` required, at least one update field required (`--capability` or `--settings`), invalid `--settings` JSON returns usage error (exit code 2) - Wired into `BundleIDsCapabilitiesCommand()` subcommands and updated help examples **Tests**: - **Client HTTP test**: `TestUpdateBundleIDCapability_UsesPatchPath` - asserts PATCH method, correct path, request body type/shape, and settings payload - **CLI cmdtests** (5 tests): missing `--id`, no update fields, invalid settings JSON, success path with settings, success path with capability type **Verification**: `make format`, `make lint`, and `make test` all pass. <p><a href="https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/471"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-pr-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-pr-light.png"><img alt="View PR" width="86" height="28" src="https://cursor.com/assets/images/view-pr-light.png"></picture></a></p> <p><a href="https://cursor.com/background-agent?bcId=bc-2c105ec0-3a0f-4ac3-872e-64feed0d5356"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-2c105ec0-3a0f-4ac3-872e-64feed0d5356"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a></p>
Author
Owner

@rudrankriyam commented on GitHub (Feb 10, 2026):

Implemented and merged in #471.
Bundle ID capability PATCH parity is now covered in client and CLI, with audit fixes and tests.
Closing as complete.

<!-- gh-comment-id:3878644711 --> @rudrankriyam commented on GitHub (Feb 10, 2026): Implemented and merged in #471. Bundle ID capability PATCH parity is now covered in client and CLI, with audit fixes and tests. Closing as complete.
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#130
No description provided.