Files
mattermost/server/cmd
b6a9a0b51c 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 <matty-code@mattermost.com>

* 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 <matty-code@mattermost.com>

* 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 <matty-code@mattermost.com>

* 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: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: mattermost-code <matty-code@mattermost.com>
2026-06-25 12:37:26 +02:00
..