mirror of
https://github.com/rudrankriyam/App-Store-Connect-CLI.git
synced 2026-04-25 15:45:48 +03:00
[GH-ISSUE #455] CI/CD: deterministic exit codes + optional JUnit reporting (TDD plan) #132
Labels
No labels
bug
bug
documentation
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/App-Store-Connect-CLI#132
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rudrankriyam on GitHub (Feb 9, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/455
Originally assigned to: @rudrankriyam on GitHub.
Summary
Add first-class CI/CD support to
ascwith:1)This issue is intentionally TDD-first and includes a concrete file-by-file plan.
Current state (re-scan notes)
These are the current anchors this work must integrate with:
cmd/run.goand currently returns0/1in most cases.internal/cli/shared/shared.goviaBindRootFlags.internal/cli/shared/errfmt/errfmt.go.internal/asc/errors.goand are produced byParseErrorininternal/asc/client_http.go.ParseErrorcurrently does not carry HTTP status, which limits robust exit-code mapping.internal/cli/cmdtest/*andcaptureOutputininternal/cli/cmdtest/commands_test.go..github/workflows/pr-checks.yml,.github/workflows/main-branch.yml) currently run tests/builds but do not consume JUnit from CLI commands.Goals
ascfailures machine-classifiable in pipelines.Non-goals (for this issue)
--assert state=...).Proposed UX
Exit codes
0123missing auth,unauthorized,forbidden)4510-5910 + (status - 400))60-9960 + (status - 500))Special behavior:
asc --helpand<cmd> --helpremain exit0.ascwith no subcommand is treated as usage error (2).CI report flags (explicit)
--report junit--report-file <path>Behavior:
--report-file.TDD implementation plan (file-by-file)
Phase 1: Exit-code framework
Tests first (RED)
Add
cmd/exit_codes_test.go(new)flag.ErrHelpas usage context ->2shared.ErrMissingAuth->3asc.ErrUnauthorized/asc.ErrForbidden->3asc.ErrNotFound->451Add/extend cmdtest coverage in
internal/cli/cmdtest/exit_codes_test.go(new)asc builds info(missing required flag) returns222asc --helpreturns0asc(no args) returns2Update
internal/cli/cmdtest/error_hints_test.go3(still with hint text)Implementation (GREEN)
Add
cmd/exit_codes.go(new)Update
cmd/run.goreturn 1branches with mapped exit codes0Phase 2: Carry HTTP status into ASC errors
Tests first (RED)
Extend
internal/asc/client_test.goExtend
internal/asc/client_http_test.go404maps not found behavior409maps conflict behavior422maps to 4xx bucket exit conversion path (indirectly via mapper unit test)503maps to 5xx bucket exit conversion pathImplementation (GREEN)
Update
internal/asc/errors.goStatusCodeonAPIErrorErrConflictsentinel and matching logicUpdate
internal/asc/client_http.goParseErrorWithStatus(body []byte, status int)ParseErrorwrapper for compatibility (if needed)resp.StatusCodeat each call siteUpdate
internal/asc/notary.goPhase 3: JUnit report writer + root flags
Tests first (RED)
internal/cli/shared/junit_report_test.go(new)<failure>on errorinternal/cli/cmdtest/ci_report_test.go(new)--report junit --report-file ...creates report withfailures="0"internal/cli/cmdtest/debug_test.goor new dedicated file--report--report-fileImplementation (GREEN)
internal/cli/shared/ci_flags.go(new)internal/cli/shared/junit_report.go(new)internal/cli/shared/shared.goBindRootFlagscmd/run.go--report junitis enabled1Phase 4: Docs + CI examples
Tests/docs first
README.md--report junit+--report-file--no-updaterecommendation for CI determinismAcceptance criteria
--help) remains exit0.3.4.5.10-99buckets.--report junit --report-filewrites valid JUnit XML.make format,make lint, andmake testpass.Example CI usage
Suggested PR slicing
This keeps review scope manageable and preserves TDD discipline.
@rudrankriyam commented on GitHub (Feb 9, 2026):
Closing as resolved by #456 (released in v0.26.0).