125 Коммитов

Автор SHA1 Сообщение Дата
Ibrahim Serdar Acikgoz
21ced4716b [MM-67382] Improve mmctl output by filtering escape sequences #35191 (#35334)
Automatic Merge
2026-02-17 19:09:38 +02:00
Harrison Healey
f000a183fc MM-67335 Fix export files having mismatched permissions (#35182) (10.11) (#35248)
Automatic Merge
2026-02-13 11:39:35 +02:00
Daniel Espino García
21a86506f9 Manual Cherrypick: Add audits for accessing posts without membership (#31266) (#35022)
Automatic Merge
2026-01-26 12:23:28 +02:00
Mattermost Build
06c6ee2566 [MM-66789] Restrict ImportSettings.Directory changes via API and add validation (#34653) (#34987)
Automatic Merge
2026-01-20 12:54:28 +02:00
Mattermost Build
4b56488fcb [MM-65830] Fix mmctl system status exit code for health check failures (#33970) (#34069)
Automatic Merge
2025-10-06 14:43:38 +03:00
Cyrus
e2b6e807c4 [MM-21466] delete users cmd return err (#31191)
* refactored error managment for deleteUsersCmdF

* updated tests related to deleteUsersCmdF

* updated user_e2e_test to reflect changes made to the deleteUsersCmdF function

* Empty-Commit to retrigger workflow

* applied gofmt formating reqs to user_test.go

* added suggested changes to the deleteUsersCmdF regarding error gathering

* added requested changes regarding error aggragation on deleteUsersCmdF

* style(mmctl): removing trailing whitespace

* feat(mmctl): returning errors in deleteUserCmdF on err

* fix(mmctl): returns when err parsing args

* test(mmctl): updated tests to expect err instead of reading printer

* style: updating returned errs

* tests: updated test to reflect error change

* tests(mmctl): updated e2e DeleteUserCmd test

* Update server/cmd/mmctl/commands/user.go

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

* refactor: changing error to return username instead of email

* refactor: changing email to username for errors

---------

Co-authored-by: Arnaud Wanet <andrewwanet9@gmail.com>
Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-07-09 17:12:04 +02:00
Claudio Costa
47a7e62b44 Fix flaky test TestMmctlE2ESuite/TestPreferenceUpdateCmd (#33375) 2025-07-09 08:01:40 -06:00
Claudio Costa
4a7aeae861 [MM-64663] Fix potential panic in mmctl ldap job show command (#32575)
* Fix potential panic in `mmctl ldap job show` command

* fix examples and docs

---------

Co-authored-by: Christopher Poile <cpoile@gmail.com>
2025-07-04 07:48:17 -06:00
Christopher Poile
9b1e03a6b8 [MM-63557] mmctl: Add compliance export create cmd (#30594)
* Refactor job retrieval to support multiple statuses & multiple types

- Updated job retrieval functions to handle multiple job statuses.
- Renamed `GetJobsByTypeAndStatus` to `GetJobsByTypesAndStatuses` for consistency across the codebase.
- Adjusted related function signatures and implementations in the job store and retry layer to accommodate the new method.
- Updated tests to reflect changes in job retrieval logic and ensure proper functionality.

* Add compliance export create command and tests

- Introduced `ComplianceExportCreateCmd` to facilitate the creation of compliance export jobs with options for date, start, and end timestamps.
- Added unit tests for the new command, covering various scenarios including valid and invalid inputs.
- Updated documentation to include usage examples and options for the new command.
- Enhanced existing tests to ensure proper functionality of compliance export job handling.

* update docs

* update tests for new logic

* Refactor message export job tests to use DefaultPreviousJobPageSize

- Updated all test cases in worker_test.go to replace hardcoded page size of 100 with DefaultPreviousJobPageSize for consistency.
- Adjusted the worker.go file to define DefaultPreviousJobPageSize and use it in job retrieval logic.
- Ensured that the changes maintain the functionality of job data initialization and retrieval tests.

* PR comments

* PR comments, simplifications, clarifications, formatting

* prefer hypen over underscore in command names

* merge conflict

* update mmctl docs
2025-06-24 21:38:30 +00:00
Christopher Poile
b33a7e362f [MM-63556] mmctl: Add compliance export download cmd (#30576)
* add mmctl compliance export download command and tests

- Introduced `ComplianceExportDownloadCmd` to facilitate downloading compliance export files.
- Implemented the `DownloadComplianceExport` method in the Client interface for handling file downloads.
- Added unit tests for the download command, covering successful downloads, error handling for non-existent jobs, and retries on failure.
- Included end-to-end tests to validate the command's functionality.
- Updated documentation to include usage examples and options for the new command.

* don't know why this was left out

* PR comments

* adjust test for new retry logic

* refactored download fn for compliance_export and export

* fix test due to fixed logic

* docs
2025-06-24 16:27:54 -04:00
Christopher Poile
e60f878090 [MM-63555] mmctl: Add compliance export show and cancel cmds (#30569)
* add compliance export cancel command and tests

- Introduced `ComplianceExportCancelCmd` to allow cancellation of compliance export jobs.
- Implemented unit tests for the cancellation command, covering successful cancellation, error handling for non-existent jobs, and cancellation in non-cancellable states.
- Added end-to-end tests to validate the command's functionality in the E2E test suite.

* mmctl docs

* clean up example text; remove unneeded getJob

* fix tests

* fix tests, again.

* prefer hyphen for command naming

* update docs
2025-06-24 12:26:43 -04:00
Christopher Poile
9399398e04 [MM-62888] mmctl: Add compliance export list cmd (#30914)
* Add compliance export list cmd and tests

- Introduced `ListComplianceExports` method in the Client interface to retrieve compliance export jobs.
- Added `compliance_export` command with subcommand `list` for listing compliance export jobs, including pagination options.
- Implemented end-to-end and unit tests for the compliance export listing functionality.

* Add docs for mmctl

* fix test typo

* added paging, tested

* update docs with better desc (how it's sorted)

* simplified, reusing job call

* add show cmd, unit tests, e2e tests

* update mmctl docs
2025-06-24 11:20:40 -04:00
Ben Schumacher
cfc1503d62 [MM-63355] Add AuthData to mmctl user search output (#30478) 2025-06-19 11:52:16 +02:00
Jesse Hallam
e6d8bf5835 Upgrade Go to 1.24.3 (#31220)
* Upgrade Go to 1.24.3

Updates the following files:
- server/.go-version: 1.23.9 → 1.24.3
- server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye
- server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3
- server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3

Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking:
- Added response() helper function in slashcommands/util.go for simple string responses
- Removed unused responsef() function from slashcommands/util.go
- Replaced responsef() with response() for translated strings that don't need formatting
- Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation
- Updated marketplace buildURL to handle format strings conditionally

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update generated mocks for Go 1.24.3

Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3.
This addresses mock generation failures that occurred with the Go upgrade.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update to bookworm and fix non-existent sha

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>

* fix non-constant format string

---------

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
2025-06-10 15:04:57 -03:00
Harsh Aulakh
09a2037b61 MMCTL: Add import delete cmd for removing the import files (#29764)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-06-10 12:06:38 +02:00
Claudio Costa
d38c27f96f [MM-64402] Improve validation of imported attachments (#31201)
* Improve validation of imported attachments

* Simplify multiple errors handling

* Improve logic

* Fix abs paths in tests

* Remove redundant clean

* Implement additional validation

* Fix absolute paths in test

* Add additional tests

---------

Co-authored-by: Lorenzo Gallegos <1328683+enzowritescode@users.noreply.github.com>
2025-05-29 07:44:50 +02:00
Harsh Aulakh
8e033f41d1 add config reload e2e tests (#29396)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-05-20 11:26:55 +02:00
Ben Schumacher
c2d08b7540 [MM-63772] Add LDAP setting to re-add removed members (#30787) 2025-05-20 11:15:25 +02:00
Ben Schumacher
e1c94e7b63 Add deactivation status to mmctl user search output (#30379) 2025-05-13 08:52:13 +02:00
KIMBOH LOVETTE
b8b3efda48 [GH-25995]_Validate SITE URL in mmctl auth login (#30362) 2025-05-07 12:24:18 +02:00
Harshil Sharma
a5e68639c2 Channel banner permissions (#30917)
* Fixed save state panel for channel banner

* Defined default background color

* Updated test

* WIP

* wip

* removed unused param

* Updated tests

* CI

* Fixed mmctl test

* Fixed TestDoAdvancedPermissionsMigration test

* Test update

* lint fix

* lint fix

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-05-06 14:03:35 +05:30
AulakhHarsh
3f43a16143 add e2e tests for revokeToken Command (#30149)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-04-14 09:42:35 +02:00
Ben Schumacher
6c8235d031 Fix missing errors in mmctl output (#30567) 2025-03-28 09:30:41 +01:00
AulakhHarsh
3954d2f346 Add e2e tests for showCommandCmdF (#30059)
* add e2e tests for showCommandCmdF

* resolve review comments

* add err check

* remove debug statement

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-03-26 18:05:10 +00:00
Julien Tant
48ea65aa5f [MM-56078] mmctl: assume local mode when no credentials found (#26215)
* assume local mode when no credentials found

* Use variable

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-03-26 13:21:21 +01:00
Alejandro García Montoro
350714f390 Bump Go to v1.23.7 (#30455)
* Update Go version to v1.23.7

* Bump golangci-lint to a version supporting Go 1.23

* Fix golangci-lint warnings

Several rules from gosimple, revive and staticcheck linters were
failing:
- Redefinition of built-in identifiers (max, min, new, recover...)
- Use of printf-like functions with simple strings
- Check for nil slices, when len already takes it into account

* Trigger Build

* Trigger Build

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-03-17 14:22:07 +01:00
Jesse Hallam
fe7d6dcc13 MM-63420: skip flaky tests (#30457) 2025-03-12 15:45:15 +00:00
Agniva De Sarker
ac10bb12a5 Revert "Bump Go version to 1.23.6 (#30242)" (#30359)
This reverts commit acbbd4c58d.
2025-02-27 14:58:51 +05:30
Alejandro García Montoro
acbbd4c58d Bump Go version to 1.23.6 (#30242)
* Bump Go version to 1.23.6

* Update CodeQL Github action as well

* Use server's Go version for CodeQL action

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>

* Empty commit to trigger CI

* Bump golangci-lint to a version supporting Go 1.23

* Fix golangci-lint warnings

Several rules from gosimple, revive and staticcheck linters were
failing:
- Redefinition of built-in identifiers (max, min, new, recover...)
- Use of printf-like functions with simple strings
- Check for nil slices, when len already takes it into account

---------

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2025-02-26 16:43:04 +01:00
Agniva De Sarker
0bdae41603 MM-61215: Clarify to use --bypass-upload flag (#29761)
https://mattermost.atlassian.net/browse/MM-61215

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-02-07 22:12:33 +05:30
Christopher Poile
3a73b517e2 [MM-62775] Fix: Bulk export not completing (#30044)
* do not error on exportFile error

* add tests for local and s3 storage exporting with missing file

* linting

* fix attachment path validation in mmctl
2025-02-04 17:56:11 -05:00
AulakhHarsh
bec3bbf88f add e2e tests for sendPasswordResetEmail cmd (#29907) 2025-01-29 23:29:37 +00:00
Christopher Poile
28c561d643 [MM-62179] Fix: mmctl debug error when setting email (#29953)
* only GetUserByEmail if arg is an email

* fixing tests

* fix typo
2025-01-29 23:45:11 +01:00
Ben Schumacher
8d4bf4bae0 [MM-54288] Support Packet V2 (#29403) 2025-01-13 20:23:09 +01:00
Ibrahim Serdar Acikgoz
424ce2b8db [MM-59503] export: enable exporting configuration with mmctl (#28412) 2024-12-17 10:23:52 +01:00
Jesús Espino
d316df6d28 Replacing interface{} with any everywhere (except generated mocks) (#29446) 2024-12-15 21:11:36 +01:00
Vishal
746eb70e01 [MM-60689] Add Webhook ID in the logs (#28846)
* add webhook id to logs

* Move hook_id context to api level from app level.

* pass errCtx to other references of same app-error-id

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-11-21 13:53:10 +05:30
Seth Foss
2117a4ed30 MM-56632 Display warning if requested mage size exceeds max (#26022) (#27216) 2024-11-06 15:45:56 +01:00
Bernhard Fröhlich
d3c18ee369 Fix mmctl build for FreeBSD (#29112) 2024-11-05 17:57:15 +01:00
Ibrahim Serdar Acikgoz
f41d2d7774 [MM-58745] export/import: enable exporting and importing bots canonically (#28214) 2024-11-01 19:44:30 +01:00
Ben Schumacher
707144d358 [MM-61132] Fix example for mmctl permissions role show command (#28816) 2024-10-24 14:03:21 +02:00
Daniel Espino García
2d96053012 Use flags for create post (#28857)
* Use flags for create post

* Remove unintended file

* Fix unintended change and types

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-10-22 16:00:26 +02:00
Ben Schumacher
2c139a293b Add missing parenthesis in mmctl webhook list (#28778)
* Add missing parenthesis in mmctl webhook list

* Use generics in StoreResult
2024-10-17 07:45:10 +02:00
Nicolas Le Cam
845b5806c0 server: Fix typo in Makefile (#28710) 2024-10-14 10:32:43 +02:00
Agniva De Sarker
a258fd80b2 Remove remaining references to model.NewXX (#28678)
And we remove the deprecated functions to force uses
only of the new function.
```release-note
NONE
```
2024-10-10 22:15:22 +05:30
Ben Cooke
b3c7ef0b97 [MM-56073] MMCTL delete post command (#27539)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-10-08 16:45:31 +02:00
Ibrahim Serdar Acikgoz
076a3cb0d5 cmd/mmctl/user: attempt to improve migrate-auth documentation (#28330) 2024-10-01 12:46:06 +02:00
Ben Schumacher
d9e47522a0 Remove unnecessary copies of loop variables (#28138) 2024-09-11 16:51:30 +02:00
Ibrahim Serdar Acikgoz
4b3de1861f [MM-59519] preserve DM/GM unread/read state over export and import (#27707) 2024-08-26 17:04:48 +02:00
Matthew Straughn
8ccdca0954 [MM-21473] Review archiveTeamsCmdF function to return an error in case of a failure (#26622)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-08-13 16:49:40 +02:00