[PR #340] [MERGED] UX improvment #450

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

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/340
Author: @tantshirt
Created: 1/30/2026
Status: Merged
Merged: 1/30/2026
Merged by: @rudrankriyam

Base: mainHead: main


📝 Commits (10+)

  • a20046d chore: ignore BMAD workflow system folders
  • 847027f feat: add global progress plumbing
  • a5ba5c4 feat: add progress gating plumbing
  • a54940a feat: suggest similar commands on typos
  • 8795b54 feat: add completion command
  • 7aad144 feat: add actionable error hints
  • 8e0e025 feat: add --retry-log override for retry logging
  • a4739bc Merge pull request #2 from tantshirt/feat/add-progress-plumbing
  • f86133e Merge pull request #3 from tantshirt/feat/did-you-mean-suggestions
  • c96724b Merge pull request #4 from tantshirt/feat/completion-command

📊 Changes

19 files changed (+786 additions, -49 deletions)

View changed files

📝 .gitignore (+4 -0)
📝 cmd/root.go (+15 -1)
cmd/run.go (+41 -0)
📝 internal/asc/client_core.go (+34 -12)
internal/asc/retry_log_test.go (+37 -0)
📝 internal/cli/cmdtest/commands_test.go (+67 -0)
internal/cli/cmdtest/error_hints_test.go (+37 -0)
📝 internal/cli/cmdtest/product_pages_test.go (+2 -0)
📝 internal/cli/cmdtest/webhooks_test.go (+1 -0)
internal/cli/completion/completion.go (+119 -0)
📝 internal/cli/registry/registry.go (+5 -1)
internal/cli/shared/errfmt/errfmt.go (+66 -0)
internal/cli/shared/errfmt/errfmt_test.go (+50 -0)
internal/cli/shared/sanitize.go (+19 -0)
internal/cli/shared/sanitize_test.go (+12 -0)
📝 internal/cli/shared/shared.go (+42 -3)
📝 internal/cli/shared/shared_test.go (+97 -0)
internal/cli/shared/suggest/suggest.go (+137 -0)
📝 main.go (+1 -32)

📄 Description

This pull request introduces several improvements and new features to the CLI, focusing on enhanced error handling with actionable hints, improved retry logging configuration, shell completion support, and better user experience for unknown commands. It also adds comprehensive tests for these new capabilities.

Error handling and user hints:

  • Introduced a new error formatting package (errfmt) that classifies common errors (such as missing authentication, forbidden, unauthorized, and timeouts) and prints actionable hints to the user, improving troubleshooting and onboarding. [1] [2] [3] [4]
  • Updated authentication error handling to use a custom error type (missingAuthError) for better error classification and hinting. [1] [2]

Retry logging configuration:

  • Refactored retry logging logic to allow explicit override via a new SetRetryLogOverride function, which takes precedence over environment variables and config files. This enables more flexible and testable control of retry logging. [1] [2] [3] [4] [5] [6]

Shell completion support:

  • Added a new completion subcommand that prints shell completion scripts for bash, zsh, and fish, improving CLI usability. [1] [2] [3] [4]
  • Included tests to verify correct output and error handling for the completion command.

User experience improvements:

  • Enhanced handling of unknown commands to suggest similar valid commands, reducing user frustration and speeding up correction of typos. [1] [2] [3]
  • Added a new Run function to the CLI entrypoint for consistent error handling and process exit codes, including integration with the new error formatting and hints. [1] [2]

Testing and quality:

  • Added or expanded tests for error hinting, retry logging override, shell completion scripts, and command suggestion functionality. [1] [2] [3] [4] [5]

These changes collectively improve the CLI's robustness, user-friendliness, and maintainability.


🔄 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/340 **Author:** [@tantshirt](https://github.com/tantshirt) **Created:** 1/30/2026 **Status:** ✅ Merged **Merged:** 1/30/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`a20046d`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/a20046df1ee7e8db3fe93fd88f88a71bc5ca8d8d) chore: ignore BMAD workflow system folders - [`847027f`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/847027fb70a0c2f461172124a0e79896ff8410b6) feat: add global progress plumbing - [`a5ba5c4`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/a5ba5c4fd71f239535da142fa50cc6db69ac002d) feat: add progress gating plumbing - [`a54940a`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/a54940aa997ce778958908433e17d20dfe3910af) feat: suggest similar commands on typos - [`8795b54`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/8795b541df1a49b7535e1d87d1ea7293db6e4fb0) feat: add completion command - [`7aad144`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/7aad14405f82f7abf368139853de218a85435e03) feat: add actionable error hints - [`8e0e025`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/8e0e0254379bf54d406d4e534865b81f15bd18ad) feat: add --retry-log override for retry logging - [`a4739bc`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/a4739bc06f095da735eaff70d428a693444b5ece) Merge pull request #2 from tantshirt/feat/add-progress-plumbing - [`f86133e`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/f86133e3d6921347eb7e4c87d0befe09e7d9fe90) Merge pull request #3 from tantshirt/feat/did-you-mean-suggestions - [`c96724b`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/c96724b65f424d5d157f6fb2dfdf6a60228d4b85) Merge pull request #4 from tantshirt/feat/completion-command ### 📊 Changes **19 files changed** (+786 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+4 -0) 📝 `cmd/root.go` (+15 -1) ➕ `cmd/run.go` (+41 -0) 📝 `internal/asc/client_core.go` (+34 -12) ➕ `internal/asc/retry_log_test.go` (+37 -0) 📝 `internal/cli/cmdtest/commands_test.go` (+67 -0) ➕ `internal/cli/cmdtest/error_hints_test.go` (+37 -0) 📝 `internal/cli/cmdtest/product_pages_test.go` (+2 -0) 📝 `internal/cli/cmdtest/webhooks_test.go` (+1 -0) ➕ `internal/cli/completion/completion.go` (+119 -0) 📝 `internal/cli/registry/registry.go` (+5 -1) ➕ `internal/cli/shared/errfmt/errfmt.go` (+66 -0) ➕ `internal/cli/shared/errfmt/errfmt_test.go` (+50 -0) ➕ `internal/cli/shared/sanitize.go` (+19 -0) ➕ `internal/cli/shared/sanitize_test.go` (+12 -0) 📝 `internal/cli/shared/shared.go` (+42 -3) 📝 `internal/cli/shared/shared_test.go` (+97 -0) ➕ `internal/cli/shared/suggest/suggest.go` (+137 -0) 📝 `main.go` (+1 -32) </details> ### 📄 Description This pull request introduces several improvements and new features to the CLI, focusing on enhanced error handling with actionable hints, improved retry logging configuration, shell completion support, and better user experience for unknown commands. It also adds comprehensive tests for these new capabilities. **Error handling and user hints:** - Introduced a new error formatting package (`errfmt`) that classifies common errors (such as missing authentication, forbidden, unauthorized, and timeouts) and prints actionable hints to the user, improving troubleshooting and onboarding. [[1]](diffhunk://#diff-1ec68d7e391e57a6425aa33804136c15867202c7b02f40bd05d574d014bb330bR1-R66) [[2]](diffhunk://#diff-e55debcd2284898d8a9693d4b7e4ab7a1cd8ac5a3ca6f199dd4f275961b8fb3aR1-R50) [[3]](diffhunk://#diff-f330679056c70ec2f96a45f7ca9263860ee99fdd18ca88b70de816b68bfd0710R43-R93) [[4]](diffhunk://#diff-f330679056c70ec2f96a45f7ca9263860ee99fdd18ca88b70de816b68bfd0710L283-R317) - Updated authentication error handling to use a custom error type (`missingAuthError`) for better error classification and hinting. [[1]](diffhunk://#diff-f330679056c70ec2f96a45f7ca9263860ee99fdd18ca88b70de816b68bfd0710R43-R93) [[2]](diffhunk://#diff-f330679056c70ec2f96a45f7ca9263860ee99fdd18ca88b70de816b68bfd0710L283-R317) **Retry logging configuration:** - Refactored retry logging logic to allow explicit override via a new `SetRetryLogOverride` function, which takes precedence over environment variables and config files. This enables more flexible and testable control of retry logging. [[1]](diffhunk://#diff-be981e0e4b7393e507e5d4fee5a498981da4809eac825f794ac8b795a565c56dR14) [[2]](diffhunk://#diff-be981e0e4b7393e507e5d4fee5a498981da4809eac825f794ac8b795a565c56dR48-R79) [[3]](diffhunk://#diff-be981e0e4b7393e507e5d4fee5a498981da4809eac825f794ac8b795a565c56dL211-R244) [[4]](diffhunk://#diff-be981e0e4b7393e507e5d4fee5a498981da4809eac825f794ac8b795a565c56dL227-L237) [[5]](diffhunk://#diff-f330679056c70ec2f96a45f7ca9263860ee99fdd18ca88b70de816b68bfd0710R335-R340) [[6]](diffhunk://#diff-2e85ce64e9964124f9f1c634f1603d33aa9a5f47498b0297a7e946c35076899aR1-R37) **Shell completion support:** - Added a new `completion` subcommand that prints shell completion scripts for bash, zsh, and fish, improving CLI usability. [[1]](diffhunk://#diff-6e015ad636cf545cfc552f18707249916bd5b7672623481ce5f4d1c5e5529bc1R1-R120) [[2]](diffhunk://#diff-b5af701dbe664f0d16668bff0dd49d831ee91142cddd705694731fadddde9499R27) [[3]](diffhunk://#diff-b5af701dbe664f0d16668bff0dd49d831ee91142cddd705694731fadddde9499L82-R83) [[4]](diffhunk://#diff-b5af701dbe664f0d16668bff0dd49d831ee91142cddd705694731fadddde9499R147-R149) - Included tests to verify correct output and error handling for the `completion` command. **User experience improvements:** - Enhanced handling of unknown commands to suggest similar valid commands, reducing user frustration and speeding up correction of typos. [[1]](diffhunk://#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fR8-R14) [[2]](diffhunk://#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fR32-R46) [[3]](diffhunk://#diff-9f5df669875d426f308dae0a996b6ad22db5b5dc8bb99d3a5e8d789d9d0ad9a7R206-R230) - Added a new `Run` function to the CLI entrypoint for consistent error handling and process exit codes, including integration with the new error formatting and hints. [[1]](diffhunk://#diff-8146f8148ccbf6711d65f532f6ab9a7c8dfbdc3960c7ffc974f17d6d224dd349R1-R41) [[2]](diffhunk://#diff-8ce7dd588960628a5e066b90d40081b90ff9d5b8872e1770189bc3aca586dee6R1-R37) **Testing and quality:** - Added or expanded tests for error hinting, retry logging override, shell completion scripts, and command suggestion functionality. [[1]](diffhunk://#diff-2e85ce64e9964124f9f1c634f1603d33aa9a5f47498b0297a7e946c35076899aR1-R37) [[2]](diffhunk://#diff-e55debcd2284898d8a9693d4b7e4ab7a1cd8ac5a3ca6f199dd4f275961b8fb3aR1-R50) [[3]](diffhunk://#diff-9f5df669875d426f308dae0a996b6ad22db5b5dc8bb99d3a5e8d789d9d0ad9a7R142-R183) [[4]](diffhunk://#diff-9f5df669875d426f308dae0a996b6ad22db5b5dc8bb99d3a5e8d789d9d0ad9a7R206-R230) [[5]](diffhunk://#diff-8ce7dd588960628a5e066b90d40081b90ff9d5b8872e1770189bc3aca586dee6R1-R37) These changes collectively improve the CLI's robustness, user-friendliness, and maintainability. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 22:30:59 +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#450
No description provided.