Files
team/server/cmd
439a9c1825 Move mmctl user deleteall to mmctl system nuke users (#37197)
* Move mmctl user deleteall to system nuke users

Relocate the destructive PermanentDeleteAllUsers command out of the
user namespace into a new system nuke subcommand to reduce the risk of
accidental invocation. Regenerate mmctl docs and move associated unit
and e2e tests accordingly.

Co-authored-by: mattermost-code <[email protected]>

* Address CodeRabbit feedback for system nuke users E2E tests

Exercise SystemNukeUsersCmd with localOnlyPrecheck and --confirm in E2E
tests, verify non-local mode is blocked via subprocess, and update
confirmation text to mention users, posts, and related data.

Co-authored-by: mattermost-code <[email protected]>

* Fix viper local flag pollution in nuke users E2E tests

Avoid setting viper local directly so unit tests that bind the local
flag are not affected when mmctl unit and e2e suites run together.

Co-authored-by: mattermost-code <[email protected]>

* Simplify nuke users E2E test to reuse existing deleteall pattern

Replace the subprocess-based localOnlyPrecheck verification with the
straightforward client-based approach from the original
TestDeleteAllUserCmd. The local-only enforcement is already covered by
the local-only PermanentDeleteAllUsers API endpoint, so the regular and
system-admin clients fail naturally without invoking the precheck. This
also removes the viper local flag manipulation that previously polluted
other E2E tests.

---------

Co-authored-by: mattermost-code <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-25 12:37:26 +02:00
..