[PR #136] [MERGED] Fix users command: required name flags for invite, role filter for list #317

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

📋 Pull Request Information

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

Base: cursor/users-and-invitations-support-6bceHead: fix/users-command-improvements


📝 Commits (1)

  • e819355 Fix users command: add required name flags for invite, role filter for list

📊 Changes

4 files changed (+50 additions, -18 deletions)

View changed files

📝 cmd/commands_test.go (+14 -4)
📝 cmd/users.go (+26 -14)
📝 internal/asc/client_options.go (+7 -0)
📝 internal/asc/client_queries.go (+3 -0)

📄 Description

Summary

Fixes critical issues found during code review and end-to-end testing of PR #101.

Changes

  • Add --first-name and --last-name required flags to users invite - The App Store Connect API requires firstName attribute, without which invitations fail
  • Add --role filter flag to users list - Allows filtering users by role (e.g., --role "ADMIN" or --role "DEVELOPER,APP_MANAGER")
  • Improve error message in users update when visible apps operation fails after roles update succeeds
  • Remove dead validation code that was unreachable due to parseCommaSeparatedIDs already handling empty strings

Testing Performed

Automated Tests

  • All user validation tests pass (go test -run "Users" ./cmd/)
  • Added new test cases for --first-name and --last-name validation

End-to-End Tests (against real App Store Connect API)

Command Result
asc users list --role "ADMIN" Filters correctly
asc users invite --email "..." --first-name "..." --last-name "..." --roles "DEVELOPER" --visible-app "..." Creates invitation
asc users invites list Lists invitations
asc users invites get --id "..." Retrieves invitation
asc users invites revoke --id "..." --confirm Revokes invitation
Error handling for missing --first-name Shows clear error
Error handling for missing --last-name Shows clear error

Before merging PR #101 to main, recommend testing:

  1. Invite a real user to App Store Connect (not just test emails) and verify they receive the invitation
  2. Accept an invitation and verify the user appears in users list
  3. Test users delete with an actual user (carefully, in a test account if possible)
  4. Test users update --roles to change a user's role and verify with users get

🔄 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/136 **Author:** [@swiftlysingh](https://github.com/swiftlysingh) **Created:** 1/25/2026 **Status:** ✅ Merged **Merged:** 1/25/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `cursor/users-and-invitations-support-6bce` ← **Head:** `fix/users-command-improvements` --- ### 📝 Commits (1) - [`e819355`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/e819355db060a63928dec9de83c0954e081328d1) Fix users command: add required name flags for invite, role filter for list ### 📊 Changes **4 files changed** (+50 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `cmd/commands_test.go` (+14 -4) 📝 `cmd/users.go` (+26 -14) 📝 `internal/asc/client_options.go` (+7 -0) 📝 `internal/asc/client_queries.go` (+3 -0) </details> ### 📄 Description ## Summary Fixes critical issues found during code review and end-to-end testing of PR #101. ## Changes - **Add `--first-name` and `--last-name` required flags to `users invite`** - The App Store Connect API requires `firstName` attribute, without which invitations fail - **Add `--role` filter flag to `users list`** - Allows filtering users by role (e.g., `--role "ADMIN"` or `--role "DEVELOPER,APP_MANAGER"`) - **Improve error message** in `users update` when visible apps operation fails after roles update succeeds - **Remove dead validation code** that was unreachable due to `parseCommaSeparatedIDs` already handling empty strings ## Testing Performed ### Automated Tests - All user validation tests pass (`go test -run "Users" ./cmd/`) - Added new test cases for `--first-name` and `--last-name` validation ### End-to-End Tests (against real App Store Connect API) | Command | Result | |---------|--------| | `asc users list --role "ADMIN"` | ✅ Filters correctly | | `asc users invite --email "..." --first-name "..." --last-name "..." --roles "DEVELOPER" --visible-app "..."` | ✅ Creates invitation | | `asc users invites list` | ✅ Lists invitations | | `asc users invites get --id "..."` | ✅ Retrieves invitation | | `asc users invites revoke --id "..." --confirm` | ✅ Revokes invitation | | Error handling for missing `--first-name` | ✅ Shows clear error | | Error handling for missing `--last-name` | ✅ Shows clear error | ## Manual Testing Recommended Before merging PR #101 to main, recommend testing: 1. **Invite a real user** to App Store Connect (not just test emails) and verify they receive the invitation 2. **Accept an invitation** and verify the user appears in `users list` 3. **Test `users delete`** with an actual user (carefully, in a test account if possible) 4. **Test `users update --roles`** to change a user's role and verify with `users get` --- <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:33 +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#317
No description provided.