[PR #582] [MERGED] feat: Add workflow command for multi-step automation sequences #638

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

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/582
Author: @mithileshchellappan
Created: 2/16/2026
Status: Merged
Merged: 2/18/2026
Merged by: @rudrankriyam

Base: mainHead: feat/workflow-command


📝 Commits (10+)

  • 7a83048 feat: Add workflow command for multi-step automation sequences
  • 4490d22 test: Add failure handling and error reporting CLI tests
  • 86f1a77 fix(workflow): tighten execution and parsing
  • 1176cb2 merge: sync origin/main into feat/workflow-command
  • 184fd0b Merge remote-tracking branch 'origin/main' into feat/workflow-command
  • d8f585d Merge branch 'main' into feat/workflow-command
  • 1013d44 fix: reject null step elements and zero stale fields in Step.UnmarshalJSON
  • d0c0ee5 fix: use slices.Clone to avoid append-on-sub-slice aliasing in cycle detection
  • 35ada17 fix: sort workflow names before validation for deterministic error ordering
  • b2f1a4f fix: reject whitespace-only keys in ParseParams

📊 Changes

12 files changed (+3994 additions, -0 deletions)

View changed files

internal/cli/cmdtest/workflow_test.go (+1136 -0)
📝 internal/cli/docs/templates/ASC.md (+1 -0)
📝 internal/cli/registry/registry.go (+2 -0)
internal/cli/workflow/workflow.go (+292 -0)
internal/workflow/env.go (+125 -0)
internal/workflow/env_test.go (+291 -0)
internal/workflow/execute.go (+184 -0)
internal/workflow/execute_test.go (+1076 -0)
internal/workflow/load.go (+62 -0)
internal/workflow/validate.go (+206 -0)
internal/workflow/validate_test.go (+552 -0)
internal/workflow/workflow.go (+67 -0)

📄 Description

Summary

  • Add asc workflow run|validate|list commands for defining named, multi-step automation sequences in .asc/workflow.json
  • Core library (internal/workflow/) has zero codebase imports — stdlib only, immediately extractable to its own module
  • Thin CLI adapter (internal/cli/workflow/) uses only 3 symbols from shared

Features

  • Env merging: global → workflow → CLI params (KEY:VALUE or KEY=VALUE), with $VAR / ${VAR} expansion
  • Conditionals: "if": "VAR_NAME" skips step when variable is falsy
  • Sub-workflows: "workflow": "name" with with: env passing, cycle detection, max depth 16
  • Private workflows: callable only as sub-workflows, not directly from CLI
  • Hooks: before_all, after_all, error at the definition level
  • Dry-run: --dry-run previews expanded commands without executing
  • Validation: detects missing steps, invalid names, dangling refs, cycles — all errors reported as structured JSON
  • Failure handling: partial JSON results on step failure with error details per step
  • JSON output: all commands output structured JSON (--pretty for indentation)

Test plan

  • 100% statement coverage on internal/workflow/ (64 unit tests)
  • 22 CLI integration tests in cmdtest covering:
    • Help output, missing name, missing file, invalid params
    • Dry-run preview, pretty JSON, runtime params (KEY:VALUE and KEY=VALUE)
    • Params controlling conditionals end-to-end
    • Private workflow rejection
    • Step failure → partial JSON + ReportedError
    • Invalid JSON → parse error surfaced
    • Validate: valid/invalid/multiple errors/cycle detection
    • List: single workflow, sorted output, missing file
  • make format clean
  • ASC_BYPASS_KEYCHAIN=1 make test — all 85 packages pass

Closes #581

🤖 Generated with Claude Code


🔄 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/582 **Author:** [@mithileshchellappan](https://github.com/mithileshchellappan) **Created:** 2/16/2026 **Status:** ✅ Merged **Merged:** 2/18/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `feat/workflow-command` --- ### 📝 Commits (10+) - [`7a83048`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/7a830484e27bc114221eeb690302e490a94daad9) feat: Add workflow command for multi-step automation sequences - [`4490d22`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/4490d22b4049d4518e94bdb29a071d2786fcf977) test: Add failure handling and error reporting CLI tests - [`86f1a77`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/86f1a77382bf909f6a6c199f137001033e0f22cd) fix(workflow): tighten execution and parsing - [`1176cb2`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/1176cb2112a05ab79ceff143dc423899f74997d0) merge: sync origin/main into feat/workflow-command - [`184fd0b`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/184fd0b36af1cd6aa84ac56fb319245efc72d07b) Merge remote-tracking branch 'origin/main' into feat/workflow-command - [`d8f585d`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/d8f585d989c8abc18edb63fd35aced5669308376) Merge branch 'main' into feat/workflow-command - [`1013d44`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/1013d44617b4021afd7a32f9593addd4db672fc1) fix: reject null step elements and zero stale fields in Step.UnmarshalJSON - [`d0c0ee5`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/d0c0ee51dde88ed130400884eeca8354a56fd82a) fix: use slices.Clone to avoid append-on-sub-slice aliasing in cycle detection - [`35ada17`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/35ada1713b015ea8c677aae6e3e50727c18b4cb7) fix: sort workflow names before validation for deterministic error ordering - [`b2f1a4f`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/b2f1a4fe0a98e8269ec62077652aaf44ae78b5fa) fix: reject whitespace-only keys in ParseParams ### 📊 Changes **12 files changed** (+3994 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `internal/cli/cmdtest/workflow_test.go` (+1136 -0) 📝 `internal/cli/docs/templates/ASC.md` (+1 -0) 📝 `internal/cli/registry/registry.go` (+2 -0) ➕ `internal/cli/workflow/workflow.go` (+292 -0) ➕ `internal/workflow/env.go` (+125 -0) ➕ `internal/workflow/env_test.go` (+291 -0) ➕ `internal/workflow/execute.go` (+184 -0) ➕ `internal/workflow/execute_test.go` (+1076 -0) ➕ `internal/workflow/load.go` (+62 -0) ➕ `internal/workflow/validate.go` (+206 -0) ➕ `internal/workflow/validate_test.go` (+552 -0) ➕ `internal/workflow/workflow.go` (+67 -0) </details> ### 📄 Description ## Summary - Add `asc workflow run|validate|list` commands for defining named, multi-step automation sequences in `.asc/workflow.json` - Core library (`internal/workflow/`) has **zero codebase imports** — stdlib only, immediately extractable to its own module - Thin CLI adapter (`internal/cli/workflow/`) uses only 3 symbols from `shared` ## Features - **Env merging**: global → workflow → CLI params (`KEY:VALUE` or `KEY=VALUE`), with `$VAR` / `${VAR}` expansion - **Conditionals**: `"if": "VAR_NAME"` skips step when variable is falsy - **Sub-workflows**: `"workflow": "name"` with `with:` env passing, cycle detection, max depth 16 - **Private workflows**: callable only as sub-workflows, not directly from CLI - **Hooks**: `before_all`, `after_all`, `error` at the definition level - **Dry-run**: `--dry-run` previews expanded commands without executing - **Validation**: detects missing steps, invalid names, dangling refs, cycles — all errors reported as structured JSON - **Failure handling**: partial JSON results on step failure with error details per step - **JSON output**: all commands output structured JSON (`--pretty` for indentation) ## Test plan - [x] 100% statement coverage on `internal/workflow/` (64 unit tests) - [x] 22 CLI integration tests in `cmdtest` covering: - [x] Help output, missing name, missing file, invalid params - [x] Dry-run preview, pretty JSON, runtime params (`KEY:VALUE` and `KEY=VALUE`) - [x] Params controlling conditionals end-to-end - [x] Private workflow rejection - [x] Step failure → partial JSON + ReportedError - [x] Invalid JSON → parse error surfaced - [x] Validate: valid/invalid/multiple errors/cycle detection - [x] List: single workflow, sorted output, missing file - [x] `make format` clean - [x] `ASC_BYPASS_KEYCHAIN=1 make test` — all 85 packages pass Closes #581 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:53 +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#638
No description provided.