[PR #43] [MERGED] feat: add Xcode Cloud CLI support for triggering and monitoring workflows #252

Closed
opened 2026-02-26 21:34:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/43
Author: @swiftlysingh
Created: 1/22/2026
Status: Merged
Merged: 1/23/2026
Merged by: @rudrankriyam

Base: mainHead: feature/xcode-cloud-cli


📝 Commits (4)

  • 88ead69 feat: add Xcode Cloud CLI support for triggering and monitoring workflows
  • 95eba91 feat: harden xcode-cloud flows and add lists
  • c7393ee test: stress paginate build runs
  • ade29a4 fix: harden xcode-cloud pagination and ref matching

📊 Changes

11 files changed (+2537 additions, -12 deletions)

View changed files

📝 Agents.md (+17 -0)
📝 README.md (+44 -0)
📝 cmd/commands.go (+1 -0)
📝 cmd/commands_test.go (+118 -0)
cmd/xcode_cloud.go (+531 -0)
📝 internal/asc/client.go (+60 -11)
📝 internal/asc/client_http_test.go (+212 -0)
📝 internal/asc/client_test.go (+49 -1)
internal/asc/xcode_cloud.go (+915 -0)
internal/asc/xcode_cloud_output.go (+173 -0)
internal/asc/xcode_cloud_test.go (+417 -0)

📄 Description

Summary

Adds Xcode Cloud integration to the CLI, enabling users to trigger workflows and monitor build runs directly from the command line.

Features

New Commands

  • asc xcode-cloud run - Trigger an Xcode Cloud workflow build
  • asc xcode-cloud status - Check the status of a build run

Capabilities

  • Trigger workflows by human-friendly name (--workflow "CI Build") or by ID (--workflow-id)
  • Specify branch/tag by name (--branch "main") or by ID (--git-reference-id)
  • Wait for build completion with --wait flag (with configurable --poll-interval and --timeout)
  • Multiple output formats: JSON (default), table, and markdown
  • Non-zero exit code when builds fail, error, or are canceled

Example Usage

# Trigger a workflow by name
asc xcode-cloud run --app "APP_ID" --workflow "CI Build" --branch "main"

# Trigger and wait for completion
asc xcode-cloud run --app "APP_ID" --workflow "Deploy" --branch "main" --wait

# Check build status
asc xcode-cloud status --run-id "BUILD_RUN_ID"

# Wait for existing build to complete
asc xcode-cloud status --run-id "BUILD_RUN_ID" --wait --output table

Testing

Unit Tests

  • Added comprehensive tests in internal/asc/xcode_cloud_test.go covering:

    • CI products query building with app ID filtering
    • CI workflows query building
    • Git references query building
    • Build runs query building
    • Workflow name resolution (case-insensitive matching, error handling)
    • Git reference resolution (branch/tag matching, canonical name handling)
    • Build run completion status checks
  • Added CLI tests in cmd/commands_test.go covering:

    • Flag validation (mutually exclusive flags, required flags)
    • Help output verification
    • Output formatting (table/markdown)

Manual Testing

Tested against a real App Store Connect account:

  1. List apps - Verified authentication works
  2. Trigger workflow - Successfully triggered a "Beta-Testflight" workflow on the main branch
  3. Monitor status - Used --wait to poll until build completion
  4. Status check - Verified asc xcode-cloud status --run-id returns correct build information including:
    • Build number
    • Execution progress (PENDING → RUNNING → COMPLETE)
    • Completion status
    • Source commit details (SHA, author, message)
    • Timestamps (created, started, finished)

Files Changed

File Description
cmd/xcode_cloud.go New CLI commands for xcode-cloud run and status
cmd/commands.go Register xcode-cloud command
cmd/commands_test.go CLI validation and output tests
internal/asc/xcode_cloud.go API client methods and types for Xcode Cloud
internal/asc/xcode_cloud_output.go Table and markdown formatters
internal/asc/xcode_cloud_test.go Unit tests for API client
internal/asc/client.go Added timeout resolution helper
README.md Documentation for new commands
Agents.md Updated agent guidance

Notes

  • Workflows must have manual start conditions enabled to be triggered via API
  • The --wait flag respects ASC_TIMEOUT environment variable for long-running builds
  • Uses the same authentication flow as other commands (keychain or env vars)

🔄 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/43 **Author:** [@swiftlysingh](https://github.com/swiftlysingh) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 1/23/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `feature/xcode-cloud-cli` --- ### 📝 Commits (4) - [`88ead69`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/88ead6947f6000d65b16a68ff64b9835ae990853) feat: add Xcode Cloud CLI support for triggering and monitoring workflows - [`95eba91`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/95eba91cfd7020f01ce32188a0140b596efa1031) feat: harden xcode-cloud flows and add lists - [`c7393ee`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/c7393ee8b7000c63aacfda75e036dec87e19e95f) test: stress paginate build runs - [`ade29a4`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/ade29a4a758960ea545779ac7eaaecfcd31b5ddd) fix: harden xcode-cloud pagination and ref matching ### 📊 Changes **11 files changed** (+2537 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `Agents.md` (+17 -0) 📝 `README.md` (+44 -0) 📝 `cmd/commands.go` (+1 -0) 📝 `cmd/commands_test.go` (+118 -0) ➕ `cmd/xcode_cloud.go` (+531 -0) 📝 `internal/asc/client.go` (+60 -11) 📝 `internal/asc/client_http_test.go` (+212 -0) 📝 `internal/asc/client_test.go` (+49 -1) ➕ `internal/asc/xcode_cloud.go` (+915 -0) ➕ `internal/asc/xcode_cloud_output.go` (+173 -0) ➕ `internal/asc/xcode_cloud_test.go` (+417 -0) </details> ### 📄 Description ## Summary Adds Xcode Cloud integration to the CLI, enabling users to trigger workflows and monitor build runs directly from the command line. ## Features ### New Commands - **`asc xcode-cloud run`** - Trigger an Xcode Cloud workflow build - **`asc xcode-cloud status`** - Check the status of a build run ### Capabilities - Trigger workflows by human-friendly name (`--workflow "CI Build"`) or by ID (`--workflow-id`) - Specify branch/tag by name (`--branch "main"`) or by ID (`--git-reference-id`) - Wait for build completion with `--wait` flag (with configurable `--poll-interval` and `--timeout`) - Multiple output formats: JSON (default), table, and markdown - Non-zero exit code when builds fail, error, or are canceled ### Example Usage ```bash # Trigger a workflow by name asc xcode-cloud run --app "APP_ID" --workflow "CI Build" --branch "main" # Trigger and wait for completion asc xcode-cloud run --app "APP_ID" --workflow "Deploy" --branch "main" --wait # Check build status asc xcode-cloud status --run-id "BUILD_RUN_ID" # Wait for existing build to complete asc xcode-cloud status --run-id "BUILD_RUN_ID" --wait --output table ``` ## Testing ### Unit Tests - Added comprehensive tests in `internal/asc/xcode_cloud_test.go` covering: - CI products query building with app ID filtering - CI workflows query building - Git references query building - Build runs query building - Workflow name resolution (case-insensitive matching, error handling) - Git reference resolution (branch/tag matching, canonical name handling) - Build run completion status checks - Added CLI tests in `cmd/commands_test.go` covering: - Flag validation (mutually exclusive flags, required flags) - Help output verification - Output formatting (table/markdown) ### Manual Testing Tested against a real App Store Connect account: 1. **List apps** - Verified authentication works 2. **Trigger workflow** - Successfully triggered a "Beta-Testflight" workflow on the main branch 3. **Monitor status** - Used `--wait` to poll until build completion 4. **Status check** - Verified `asc xcode-cloud status --run-id` returns correct build information including: - Build number - Execution progress (PENDING → RUNNING → COMPLETE) - Completion status - Source commit details (SHA, author, message) - Timestamps (created, started, finished) ## Files Changed | File | Description | |------|-------------| | `cmd/xcode_cloud.go` | New CLI commands for xcode-cloud run and status | | `cmd/commands.go` | Register xcode-cloud command | | `cmd/commands_test.go` | CLI validation and output tests | | `internal/asc/xcode_cloud.go` | API client methods and types for Xcode Cloud | | `internal/asc/xcode_cloud_output.go` | Table and markdown formatters | | `internal/asc/xcode_cloud_test.go` | Unit tests for API client | | `internal/asc/client.go` | Added timeout resolution helper | | `README.md` | Documentation for new commands | | `Agents.md` | Updated agent guidance | ## Notes - Workflows must have manual start conditions enabled to be triggered via API - The `--wait` flag respects `ASC_TIMEOUT` environment variable for long-running builds - Uses the same authentication flow as other commands (keychain or env vars) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 21:34:18 +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#252
No description provided.