Граф коммитов

903 Коммитов

Автор SHA1 Сообщение Дата
Maria A Nunez
202d125afa [release-10.11] MM-68547: Tighten authorization on group syncable link and patch endpoints (#36434)
Automatic Merge
2026-05-06 08:53:51 +02:00
David Krauser
9408b98025 Manual cherry pick of #35497 (#36341)
Automatic Merge
2026-05-04 09:17:40 +02:00
Mattermost Build
aba9339a24 Automated cherry pick of #36064 (#36320)
Automatic Merge
2026-05-01 00:17:38 +02:00
Mattermost Build
61d68d2d6e MM-68439 Centralize filename handling for FileInfo (#36223) (#36255)
Automatic Merge
2026-04-24 09:17:57 +02:00
Harshil Sharma
5854257739 Manual CP of 35755 for v10.11 (#36135)
Automatic Merge
2026-04-17 21:42:09 +02:00
Alejandro García Montoro
29dd6d0cfd MM-68369: add missing TearDown in TestWebConnRejectBinaryFrameUnauthenticated (#36172)
The test at channels/app/platform/web_conn_test.go was added by #35988
without a defer th.TearDown() call. Setup(t) creates a PlatformService
that opens its own SqlStore pool and runs morph migrations against the
shared temp database. Without TearDown, that pool stays alive until
TestMain exits, so the morph-held idle connections are still attached
to the database when MainHelper.Close runs DROP DATABASE. Postgres
refuses the drop with "is being accessed by other users" and the whole
package panics in teardown.

On master and release-11.4 and later, setupTestHelper registers the
shutdown via tb.Cleanup automatically, so the same test does not leak
there. release-10.11 still uses the manual TearDown pattern, which is
why the fix is scoped to this branch.
2026-04-17 17:27:42 +00:00
Jesse Hallam
73d5f507a4 Cherry-pick Go 1.25.8 upgrade for release-10.11 (#36125)
* ci: shard server Postgres tests into 4 parallel runners (#35739)

* ci: add test sharding plumbing to server CI

Add infrastructure for upcoming test sharding without changing behavior:

- Add shard-index and shard-total inputs to server-test-template.yml
  (defaults preserve existing single-runner behavior)
- Add timing cache restore step (activates only when shard-total > 1)
- Add merge-postgres-test-results job to server-ci.yml that:
  - Merges JUnit XML reports from shard artifacts
  - Saves timing data cache for future shard balancing
  - Handles both single-artifact and multi-shard scenarios
- Add .gitignore entries for timing cache and shard work files

Co-authored-by: Claude <claude@anthropic.com>

* ci: shard server Postgres tests into 4 parallel runners

Extract sharding logic into standalone, tested scripts and enable
4-shard parallel test execution for server Postgres CI:

Scripts:
- server/scripts/shard-split.js: Node.js bin-packing solver that
  assigns test packages to shards using timing data from previous runs.
  Two-tier strategy: light packages (<2min) whole, heavy packages
  (api4, app) split at individual test level.
- server/scripts/run-shard-tests.sh: Multi-run wrapper that calls
  gotestsum directly for each package group with -run regex filters.
- server/scripts/shard-split.test.js: 8 test cases covering round-robin
  fallback, timing-based balancing, heavy package splitting, JUnit XML
  fallback, and enterprise package separation.

Workflow changes:
- server-test-template.yml: Add shard splitting step that discovers test
  packages and runs the solver. Modified Run Tests step to use wrapper
  script when sharding is active.
- server-ci.yml: Add 4-shard matrix to test-postgres-normal. Update
  merge job artifact patterns for shard-specific names.

Performance: 7.2 min with timing cache vs 62.5 min baseline = 88%
wall-time improvement. First run without cache uses JUnit XML fallback
or round-robin, then populates the cache for subsequent runs.

Co-authored-by: Claude <claude@anthropic.com>

* fix: raise heavy package threshold to 5 min to preserve test isolation

sqlstore integrity tests scan the entire database and fail when other
packages' test data is present. At 182s, sqlstore was just over the
120s threshold and getting split at test level. Raising to 300s keeps
only api4 (~38 min) and app (~15 min) as heavy — where the real
sharding gains are — while sqlstore, elasticsearch, etc. stay whole
and maintain their test isolation guarantees.

Co-authored-by: Claude <claude@anthropic.com>

* ci: only save test timing cache on default branch

PR branches always restore from master's timing cache via restore-keys
prefix matching. Timing data is stable day-to-day so this eliminates
cache misses on first PR runs and reduces cache storage.

Co-authored-by: Claude <claude@anthropic.com>

* ci: skip FIPS tests on PRs (enterprise CI handles compile check)

Per review feedback: the enterprise CI already runs a FIPS compile
check on every PR. Running the full FIPS test suite on PRs is redundant
since it uses the identical test suite as non-FIPS — the only
FIPS-specific failure mode is a build failure from non-approved crypto
imports, which the enterprise compile check catches.

Full FIPS tests continue to run on every push to master.

Co-authored-by: Claude <claude@anthropic.com>

* fix: address review feedback on run-shard-tests.sh

- Remove set -e so all test runs execute even if earlier ones fail;
  track failures and exit with error at the end (wiggin77)
- Remove unused top-level COVERAGE_FLAG variable (wiggin77)
- Fix RUN_IDX increment position so report, json, and coverage files
  share the same index (wiggin77)
- Update workflow comment: heavy threshold is 5 min, not 2 min (wiggin77)

Co-authored-by: Claude <claude@anthropic.com>

* style: use node: prefix for built-in fs module in shard-split.js

Co-authored-by: Claude <claude@anthropic.com>

* fix: avoid interpolating file paths into generated shell script

Read shard package lists from files at runtime instead of interpolating
them into the generated script via printf. This prevents theoretical
shell metacharacter injection from directory names, as flagged by
DryRun Security.

Co-authored-by: Claude <claude@anthropic.com>

* fix(ci): rename merged artifact to match server-ci-report glob

The merged artifact was named postgres-server-test-logs-merged which
does not match the *-test-logs pattern in server-ci-report.yml,
causing Postgres test results to be missing from PR/commit reports.

Also pins junit-report-merger to exact version 7.0.0 for supply chain
safety.

Co-authored-by: Claude <claude@anthropic.com>

* fix(ci): pass RACE_MODE env into Docker container

RACE_MODE was set on the host runner but never included in the docker
run --env list. The light-package path worked because the heredoc
expanded on the host, but run-shard-tests.sh reads RACE_MODE at
runtime inside the container where it was unset. This caused heavy
packages (api4, app) to silently lose -race detection.

Co-authored-by: Claude <claude@anthropic.com>

* fix(ci): discover new tests in heavy packages not in timing cache

Tests not present in the timing cache (newly added or renamed) would
not appear in any shard -run regex, causing them to silently skip.
After building items from the cache, run go test -list to discover
current test names and assign any cache-missing tests to shards via
the normal bin-packing algorithm with a small default duration.

Co-authored-by: Claude <claude@anthropic.com>

* fix(ci): add missing line continuation backslash in docker run

The previous --env FIPS_ENABLED line was missing a trailing backslash
after adding --env RACE_MODE, causing docker run to see a truncated
command and fail with "requires at least 1 argument".

Co-authored-by: Claude <claude@anthropic.com>

* fix(ci): add setup-go step for shard test discovery

go test -list in shard-split.js runs on the host runner via execSync,
but Go is only available inside the Docker container. Without this
step, every invocation fails silently and new-test discovery is a
no-op. Adding actions/setup-go before the shard split step ensures
the Go toolchain is available on the host.

Co-authored-by: Claude <claude@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>

* updated go to version 1.25.8 (#35817)

* updated go to version 1.25.8

* updated gotestsum version to work with go 1.25.8

go 1.25 does not work with indirect tools 0.11 dependency pulled by
gotestsum.

* Use sync.WaitGroup.Go to simplify goroutine creation

Replace the wg.Add(1) + go func() { defer wg.Done() }() pattern with
wg.Go(), which was introduced in Go 1.25.

* pushes fips image on workflow dispatch to allow fips test to run on go version update

* fix new requirements for FIPS compliance imposed on updating to go 1.25.8

* updates openssl symbol check for library shipped with FIPS new versions

go-openssl v2 shipped with FIPS versions starting from 1.25 uses mkcgo to generate
bindings causing symbol names to be different.

* removes temp workflow-dispatch condition

* keep versions out of agents md file

* upgrade golangci-lint (#35845)

* test: clean up channel store data after TestChannelStore (#36066)

TestChannelStore sub-tests create channels, members, and team members
using fake TeamIds and UserIds (model.NewId() for non-existent rows).
These records are left in the database and cause integrity tests
(TestCheck*) running in the same binary to fail their full-table scans.

Register a t.Cleanup on TestChannelStore that purges the affected
tables entirely. A blanket purge is safe: the schema enforces no FK
constraints, and every test suite creates its own data independently.

* Fix command injection in server-test-template workflow (#36080)

Replace the unquoted heredoc (which embedded GITHUB_HEAD_REF into a
generated script) with a cp of the existing run-shard-tests.sh, which
already handles the light-only case. Pass BUILD_NUMBER and TEST_TARGET
as explicit docker env vars instead of interpolating them into script
content.

* fix(ci): restore testname format in sharded gotestsum runs (#36078)

run-shard-tests.sh called gotestsum directly without --format, so it
fell back to gotestsum's default (pkgname) instead of the testname
format set by the Makefile. Pass --format "${GOTESTSUM_FORMAT:-testname}"
to match the Makefile default.

Co-authored-by: Mattermost Build <build@mattermost.com>

* fix(lint): fix pre-existing golangci-lint v2.11.4 issues

Fix misspelling in comment and redundant nil check flagged by the
upgraded linter.

* ci: use golang image for test runner on release-10.11

mattermost-build-server images are not built for release branches.
Use the official golang image which is always available for any Go version.

* ci: use mattermost/mattermost-build-server for release-10.11

The mattermostdevelopment/ images are only built for master.
The production mattermost/ images are built for release branches.

* ci: use mattermost/mattermost-build-server in mmctl test template

The mattermostdevelopment/ images are only built for master.
The production mattermost/ images are built for release branches.

---------

Co-authored-by: Pavel Zeman <pavel.zeman@mattermost.com>
Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Carlos Garcia <carlos.garcia@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2026-04-16 09:14:15 -03:00
Caleb Roseland
384635216f Update msgpack fork dependency (#35988) (#36043)
(cherry picked from commit 17939826efa20a97f087b3d390ec5136df350bae)

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-04-16 04:02:45 +00:00
Andre Vasconcelos
667dffe31d Improved processing of attachments (#35854) (#36103)
# Conflicts:
#	server/channels/app/slack.go

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-04-15 22:32:34 +08:00
Harshil Sharma
7526844c50 Fixed URL validation for integration actions (#35857) (#36108)
* Fixed URL validation for integratioon actions

* SImplified check to avoid subpath incompatibility

* minor tweak

* refactored for better tests

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-04-15 22:32:14 +08:00
Christopher Poile
c654f0502f [MM-67143] cherry pick of #34922 (#35800)
Automatic Merge
2026-03-27 07:30:55 +01:00
Guillermo Vayá
532f2882d1 [MM-67377] cherry-pick Fix (#35336) (#35657)
Automatic Merge
2026-03-20 12:30:54 +01:00
Ben Cooke
8ef7f78d8d fix conflicts (#35699)
Automatic Merge
2026-03-20 09:00:55 +01:00
Mattermost Build
24a90356e6 Automated cherry pick of #35490 (#35650)
Automatic Merge
2026-03-18 14:30:54 +01:00
Ibrahim Serdar Acikgoz
e68120775b Cherry pick of a06d506 (#35172) into release-10.11 (#35332)
Automatic Merge
2026-02-17 19:09:27 +02:00
catalintomai
25d7832030 MM-67099 - Membership Sync fix (#35230) (#35329)
Automatic Merge
2026-02-17 18:09:27 +02:00
Mattermost Build
eb8c99fe9c Add fileSize limit to extractors (#35200) (#35280)
Automatic Merge
2026-02-13 14:09:32 +02:00
Andre Vasconcelos
053dcf62b6 MM-67372: Improve link preview metadata handling and filtering (#35178) (#35222)
Automatic Merge
2026-02-13 13:09:26 +02:00
Doug Lauder
a8db85c026 Cherry-pick MM-66789 (Include log viewer (system console) in log root path validation) (#35253)
Automatic Merge
2026-02-13 12:09:37 +02:00
Doug Lauder
463f7a0511 Cherry-pick MM-66789: Restrict log downloads to a root path for support packets (#35164)
Automatic Merge
2026-02-02 21:23:28 +02:00
Mattermost Build
83006ff8ca MM-67279: Fix private channel enumeration via /mute slash command (#35099) (#35149)
Automatic Merge
2026-01-30 18:23:33 +02:00
Christopher Poile
452bad21e9 manual cherry-pick: [MM-67202] Validate auth method in account switch (#34981) (#35143)
* fix account authorization type switch

* improve test clarity

* refactor tests for clarity
2026-01-30 16:36:57 +02:00
Mattermost Build
66fdb3f453 MM-67274: Fix panic in getBrowserVersion with empty User-Agent version (#35098) (#35133)
Automatic Merge
2026-01-30 12:53:37 +02:00
Christopher Poile
f894103741 manual cherrypick: [MM-67074] Integration Action memory use fix (#34896) (#35089)
Automatic Merge
2026-01-28 18:53:28 +02:00
Rajat Dabade
707f7ba42b Cherry-pick PR for guest-user-file-upload-permission for release-10.11 (#35073)
Automatic Merge
2026-01-27 14:53:28 +02:00
Alejandro García Montoro
0655a63354 Check password length (#35062)
Automatic Merge
2026-01-27 08:53:29 +02:00
Christopher Poile
51f2e2fdd5 Manual cherrypick MM-67055: Fix permalink embeds in ws msg (#34893) (#35059)
Automatic Merge
2026-01-26 19:23:30 +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
Rajat Dabade
4b8b1e5ca0 Cherry picker search-api-filter-guest-permission to release-10.11 (#35018)
Automatic Merge
2026-01-22 12:18:51 +02:00
Mattermost Build
3b1b8d9114 Automated cherry pick of #34693 (#34972)
Automatic Merge
2026-01-22 07:18:51 +02:00
Pablo Vélez
43e797010b MM-66092 - enhance user permissions data structure validations (#34654) (#35006)
Automatic Merge
2026-01-21 12:48:52 +02:00
Christopher Poile
ebe1bd4e31 MM-67077: Remove PSD file previews (#34898) (#35000)
Automatic Merge
2026-01-21 12:18:54 +02:00
M-ZubairAhmed
d6d3d5447e Cherry pick of #34679 (#34880)
Automatic Merge
2026-01-08 16:17:31 +02:00
Mattermost Build
fc8b22242d Automated cherry pick of #34441 (#34848)
Automatic Merge
2026-01-07 14:17:32 +02:00
Jesse Hallam
a07b1d7a8c MM-66424: Improve team filtering in common teams API (#34454) (#34854)
Cherry-pick 6404ab29acc04901c5cb1cf5ad97fc3c0693e2cd into release-10.11
2026-01-06 12:50:30 -04:00
Jesse Hallam
989f3a36dc MM-66757: Improve WebSocket user update events (#34600) (#34856)
* improve TestUserUpdateEvents

* improve CheckUserSanitization

* check user sanitization in TestUserUpdateEvents

* minimally sanitize user sent to event creator
2026-01-06 11:22:05 -05:00
Jesse Hallam
c9d60357db MM-65575: Fix server panic when bot posts trigger persistent notifications (#34174) (#34778)
* reproduce panic with test

* allow bots in the profile map

* explicitly prevent sending notifications to bots

* persistent notifications: handle senders not in the channel
2025-12-17 15:06:57 +00:00
Mattermost Build
46b5c436bb MM-66372: Improve OAuth state token validation (#34296) (#34300) 2025-10-28 00:46:33 +00:00
Mattermost Build
f361e7d75a Automated cherry pick of #34247 (#34257)
Automatic Merge
2025-10-27 12:59:15 +02:00
Ibrahim Serdar Acikgoz
9f54e5cdc3 [MM-65684] Sanitize teams for /api/v4/channels/{channel_id}/common_teams endpoint (#34110) (#34182) 2025-10-17 16:55:42 +03:00
JG Heithcock
375ce229f4 MM 65084 server-side (#33861) (#34006) (#34044)
* MM 65084 server-side (#33861) (#34006)

Automatic Merge

* Add ConsumeOnce method to store layers

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-10-06 15:20:08 -07:00
Jesse Hallam
9dd2c6f54f [MM-65837], [MM-65824] - Update Dependencies (#33972) (#34052)
* Update github.com/mholt/archives

* Update github.com/spf13/viper

* make batch migration worker tests less flaky

---------

Co-authored-by: Eva Sarafianou <eva.sarafianou@gmail.com>
2025-10-03 11:12:25 -03:00
Mattermost Build
27fadafead Constant time comparison (#33588) (#33822)
Automatic Merge
2025-09-01 16:34:06 +03:00
Mattermost Build
ef896a4ea6 Mm 64925 - prevent slack import email auto validation for non admin users (#33609) (#33779)
Automatic Merge
2025-08-22 12:34:05 +03:00
Mattermost Build
2d5cdc6e21 [MM-64896][MM-64898] Pass inviteid/tokenid to relay state/props for external auth when auto-joining a team (#33545) (#33666)
Automatic Merge
2025-08-13 13:04:00 +03:00
Mattermost Build
f21005e359 Add URL validation to LinkMetadata cache and store (#31814) (#33453)
Automatic Merge
2025-07-17 20:58:42 +03:00
Mattermost Build
07a34f02b6 MM-64531: [Shared Channels] Users on different remote servers should not communicate unless the remotes have established secure connection. (#30985) (#33434)
Automatic Merge
2025-07-15 11:58:41 +03:00
Mattermost Build
7f4fbd803a MM-62745: [Shared Channels] Fix duplicate mentioning - local user with the same username as someone on the remote server - Part2 (#32101) (#33414)
Automatic Merge
2025-07-14 19:28:42 +03:00
Agniva De Sarker
c4dde3d0ab MM-64632: Fix a panic in bulk import (#33360)
We were incorrect de-referencing the channels slice
without checking for nil pointer first.

https://mattermost.atlassian.net/browse/MM-64632
```release-note
NONE
```
2025-07-09 09:37:36 +05:30
Harrison Healey
4b77485e8f MM-64718 Improve validation of thread follower imports (#33287)
* MM-64718 Improve validation of thread follower imports

* Add additional test cases and restucture tests
2025-07-08 11:57:48 -04:00