feat(users): add bulk user deletion command#83
Conversation
Adds delete users with filtering, dry-run/confirm behavior, tests, and parity/spec updates. Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d5fd1c26e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new bulk tscli delete users command to support filter-driven multi-user deletion with a dry-run default, updates OpenAPI parity mappings/specs, and extends CLI test coverage/documentation to include the new command.
Changes:
- Introduce
tscli delete userswith validated filters (--status,--last-seen,--devices), admin safeguards (--admins), and--confirmfor mutations. - Extend CLI parity + example-output tests and refresh API mock fixtures to support bulk-user deletion flows.
- Update OpenAPI command-operation mappings and add/extend spec documents describing the bulk deletion workflow.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/cli/testdata/leaf_commands.txt | Adds delete users to the leaf-command manifest coverage list. |
| test/cli/parity_new_commands_test.go | Adds mocked-API tests for dry-run vs confirmed bulk deletion; adds validation expectations. |
| test/cli/example_output_test.go | Adds output-shape coverage for delete users in example-output suite. |
| pkg/contract/openapi/command-operation-map.yaml | Maps delete users to list-users + per-user delete operations for parity. |
| openspec/specs/openapi-command-parity/spec.md | Updates parity spec to explicitly cover bulk user deletion workflow. |
| openspec/specs/bulk-user-deletion/spec.md | New spec defining behavior, validation, safeguards, and output expectations. |
| openspec/changes/archive/2026-04-15-add-delete-users-command/tasks.md | New archived change record/tasks checklist for the feature. |
| openspec/changes/archive/2026-04-15-add-delete-users-command/specs/openapi-command-parity/spec.md | Archived spec delta for parity requirements. |
| openspec/changes/archive/2026-04-15-add-delete-users-command/specs/bulk-user-deletion/spec.md | Archived spec delta for bulk-user deletion requirements. |
| openspec/changes/archive/2026-04-15-add-delete-users-command/proposal.md | Archived proposal describing motivation and impact. |
| openspec/changes/archive/2026-04-15-add-delete-users-command/design.md | Archived design notes for command behavior and safety model. |
| openspec/changes/archive/2026-04-15-add-delete-users-command/.openspec.yaml | Adds openspec metadata for the archived change. |
| internal/testutil/apimock/fixtures.go | Expands user fixtures and adds a suspended user to enable filtering scenarios. |
| docs/commands/tscli_delete_users.md | Generated docs page for the new delete users command. |
| docs/commands/tscli_delete.md | Adds delete users to the delete command group docs. |
| docs/commands/_sidebar.md | Adds delete users to docs sidebar navigation. |
| docs/commands/README.md | Adds delete users to docs README command index. |
| cmd/tscli/delete/users/cli_test.go | Adds unit tests for filter validation, candidate selection, and dry-run/confirm behavior. |
| cmd/tscli/delete/users/cli.go | Implements the bulk deletion command, filtering, and structured summary output. |
| cmd/tscli/delete/devices/cli_test.go | Adds validation coverage for rejecting unexpected positional args. |
| cmd/tscli/delete/devices/cli.go | Enforces cobra.NoArgs to reject positional args. |
| cmd/tscli/delete/cli.go | Registers the new delete users command under the delete command group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
368f6d8 to
d6d9cc9
Compare
Adds delete users with filtering, dry-run/confirm behavior, tests, and parity/spec updates.
Signed-off-by: Lee Briggs lee@leebriggs.co.uk