* MM-68149: upgrade to Go 1.26.2 Update go directive in go.mod and .go-version. * MM-68149: replace pointer helpers with Go 1.26 new() Go 1.26 extends the built-in new() to accept an initial value expression, making typed-pointer helpers like model.NewPointer(x), bToP(x), and boolPtr(x) redundant. Replace every call site with new(x) and remove the now-unused helper functions and their //go:fix inline directives. * MM-68149: apply go fix for reflect API and format-string changes - reflect.Ptr → reflect.Pointer (renamed in Go 1.18, deprecated alias removed in 1.26) - reflect range-over-struct: for i := 0; i < t.NumField(); i++ → for field := range t.Fields() and the equivalent for Methods() and interface types - Fix format-string concatenation and variadic-arg mismatches flagged by go vet * MM-68149: update JPEG fixtures and test infrastructure for Go 1.26 encoder Go 1.26 ships a new image/jpeg encoder that produces slightly different output. Regenerate all JPEG fixture files and switch the comparison helpers from byte-equality to pixel-level comparison with a small per-channel tolerance, so minor encoder drift across patch versions is handled automatically. Add -update-fixtures flag to make it easy to regenerate fixtures after future major Go upgrades. Document the update procedure in tests/README.md. * MM-68149: CI check that go fix ./... produces no changes * Fix real bugs flagged by CodeRabbit review - group.go: set newGroup.MemberCount not group.MemberCount (member count was populated on the wrong variable and lost before publish/return) - file_test.go: guard compareImage(GetFilePreview) on the preview slice length, not the thumbnail slice length (copy-paste error) - config_test.go: remove duplicate MinimumLength assignment * fixup! Fix real bugs flagged by CodeRabbit review |
||
|---|---|---|
| .. | ||
| mattermost-govet | ||
| mmgotool | ||
| sharedchannel-test | ||
| README.md | ||
Tools
This directory aims to provide a set of tools that simplify and enhance various development tasks. This README file serves as a guide to help you understand the directory, features of these tools, and how to get started using it. This is a collection of utilities and scripts designed to streamline common development tasks for Mattermost. These tools aim to help automate repetitive tasks and improve productivity.
Included tools
- mattermost-govet: custom Go vet analyzers enforcing Mattermost-specific code conventions (structured logging, error handling, SQL safety, etc.). Used by
make vetin the server. - mmgotool: is a CLI to help with i18n related checks for the mattermost/server development.
- sharedchannel-test: integration test tool that validates shared channel synchronization (posts, reactions, membership) between two real Mattermost server instances.
Installation & Usage
mmgotool
To install mmgotool, simply run the following command: go install github.com/mattermost/mattermost/tools/mmgotool
Make sure you have the necessary prerequisites such as Go compiler.
mmgotool i18n has following subcommands described below:
check: Check translationscheck-empty-src: Check for empty translation source stringsclean-empty: Clean empty translationsextract: Extract translations
sharedchannel-test
Stands up two Mattermost Enterprise instances, creates a remote cluster connection, and runs integration tests for shared channel synchronization (membership, posts, reactions).
Prerequisites:
make start-docker(Postgres and friends running)- Enterprise repo present at
../../enterprise - An enterprise license file
Usage:
# Managed mode (builds server, starts/stops both instances automatically)
cd tools/sharedchannel-test
go run . --license /path/to/license.mattermost-license --server-dir ../../server
# External mode (connect to already-running instances)
go run . --license /path/to/license.mattermost-license --manage=false \
--server-a http://localhost:9065 --server-b http://localhost:9066