* Updates buildFieldAttrs to preseve existing attrs when editing a field
* Fix preserve option issue for select/multiselect type fields
* Fix linter
---------
(cherry picked from commit 3f675734bb)
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
* Improves `mmctl cpa` subcommands' output to show human readable values instead of IDs
* Adds mmctl docs updates
* Fixed linter
---------
(cherry picked from commit cd3f4483ee)
Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
* Adds Custom Profile Attribute field commands to mmctl
* Fix linter
* Refactor buildFieldAttrs
* Reverse test to match implementation
* Adds a confirmation prompt
* Refactor the tests
---------
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>
- Removed UpdateUserEmailCmd and UpdateUsernameCmd commands
- Deleted updateUserEmailCmdF and updateUsernameCmdF functions
- Commands were deprecated in favor of 'mmctl user edit email/username'
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* MM-64807: Deprecate format parameter in client config endpoint
- Remove requirement for format=old query parameter in /api/v4/config/client
- Endpoint now returns client configuration by default without parameters
- Maintain backward compatibility - format parameter is accepted but ignored
- Replace GetOldClientConfig with GetClientConfig across all clients
- Update API documentation to reflect simplified endpoint
- Update webapp client to remove format parameter usage
The endpoint previously returned HTTP 501 without format=old parameter.
Now it returns the client configuration directly, making the API more
intuitive while preserving compatibility with existing clients.
* Update i18n strings after format parameter deprecation
* Update E2E tests to use getClientConfig instead of getClientConfigOld
- Replace getClientConfigOld calls in playwright test library
- Aligns with format parameter deprecation in MM-64807
* Keep format=old parameter in webapp getClientConfig for pre-v11 compatibility
* MM-63726: Adjust default MaxOpenConns/MaxIdleConns settings
- Change MaxOpenConns from 300 to 100
- Change MaxIdleConns from 20 to 50
- Establish a healthier 2:1 ratio instead of the previous 15:1
- Remove hardcoded values from config files to use new defaults
* Fix mmctl config test for updated MaxIdleConns default
Update test expectation from 20 to 50 to match the new default
value for SqlSettings.MaxIdleConns that was changed in the previous
commit.
* MM-6449 - manage channel access rules permissions backend part
* add the system console changes to show the new permission
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Add mmctl user edit command
* Add e2e tests
* Use right client method to update authdata
* implement local API endpoint
* Don't allow users to clear the authdata
* make mmctl-docs
* Fix casing
* Fix example
* make mmctl-docs
* Simplify error message
* Fix test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* 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>
This commit exposes audit logging functionality to plugins via the plugin API, allowing plugins to create and log audit records. Additionally, it addresses a gob encoding issue that could cause plugin crashes when audit data contains nil pointers or unregistered types.
* 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
* 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
* 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
* 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>
* 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>
* 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>
* 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>
* do not error on exportFile error
* add tests for local and s3 storage exporting with missing file
* linting
* fix attachment path validation in mmctl
There are several steps that a server runs through inside (*Server).Start
after ch.initPlugins() till the signal handler is reached which handles
the server shutdown procedure.
The issue arises when the server is shutdown after ch.initPlugins() completes
but before (*Server).Start finishes. In that case, the plugins are all started
but they won't be shut down cleanly.
To fix this edge-case, we set up an intermediate signal handler, which
attaches itself as soon as ch.initPlugins is finished, allowing us to run
the cleanup code in case the shutdown happens before (*Server).Start finishes.
And when we do reach the main signal handler, we don't need this intermediate
handler any more. So we just reset the handlers and use the main signal handler
which takes care of shutting down the whole server.
Note: This is still not 100% bug-proof because ch.initPlugins() will initialize
_all_ plugins, and the shutdown can happen just after one plugin is initialized.
To handle that case will require the need to set up signal handlers after every
plugin init which feels like overkill to me.
A sample flow diagram to visualize better:
Edge-case
server.Start()
|
ch.initPlugins()
|
<ctrl-c>
|
execute signal handler, os.Exit(1)
Happy-path
server.Start()
|
ch.initPlugins()
|
server.Start() finished
|
reset old signal handler
|
setup main signal handler
|
server runs on as usual until shutdown
https://mattermost.atlassian.net/browse/MM-49353
```release-note
NONE
```