Commit Graph

13473 Commits

Author SHA1 Message Date
Claudio Costa
ee3f986da0 [MM-32622] Remove app.WaitForChannelMembership() (#17048)
* Remove app.WaitForChannelMembership

* Fix tests

* Fix test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-31 09:40:35 +02:00
Agniva De Sarker
4ba0c09fc7 MM-34389: Reliable websockets: First commit (#17297)
* MM-34389: Reliable websockets: First commit

This is the first commit which makes some basic changes
to get it ready for the actual implementation.

Changes include:
- A config field to conditionally enable it.
- Refactoring the WriteMessage along with setting the deadline
to a separate method.

The basic idea is that the client sends the connection_id
and sequence_number either during the handshake (via query params),
or during challenge_auth (via added parameters in the map).

If the conn_id is empty, then we create a new one and set it.
Otherwise, we get the queues from a connection manager (TBD)
and attach them to WebConn.

```release-note
NONE
```

https://mattermost.atlassian.net/browse/MM-34389

* Incorporate review comments

* Trigger CI

* removing telemetry

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-31 10:05:32 +05:30
catalintomai
ca9f4c9ed8 MM-32882: Add an unread badge/marker to the Main Menu icon and the ‘Plugin Marketplace’ Menu Item (#16992) 2021-03-29 22:55:44 -07:00
Amy Blais
16e6296c54 Update PULL_REQUEST_TEMPLATE.md (#17208)
Automatic Merge
2021-03-29 18:32:16 +02:00
Agniva De Sarker
7b1dee4936 MM-33818: Add replica lag metric (#17148)
* MM-33818: Add replica lag metric

We add two new metrics for monitoring replica lag:
- Monitor absolute lag based on binlog distance/transaction queue length.
- Monitor time taken for the replica to catch up.

To achieve this, we add a config setting to run a user defined SQL query
on the database.

We need to specify a separate datasource field as part of the config because
in some databases, querying the replica lag value requires elevated credentials
which are not needed for usual running of the application, and can even be a security risk.

Arguably, a peculiar part of the design is the requirement of the query output to be in a (node, value)
format. But since from the application, the SQL query is a black box and the user can set any query
they want, we cannot, in any way templatize this.

And as an extra note, freno also does it in a similar way.

The last bit is because we need to have a separate datasources, now we consume one extra connection
rather than sharing it with the pool. This is an unfortunate result of the design, and while one extra
connection doesn't make much of a difference in a single-tenant scenario. It does make so, in a multi-tenant scenario.
But in a multi-tenant scenario, the expectation would already be to use a connection pool. So this
is not a big concern.

https://mattermost.atlassian.net/browse/MM-33818

```release-note
Two new gauge metrics were added:
mattermost_db_replica_lag_abs and mattermost_db_replica_lag_time, both
containing a label of "node", signifying which db host is the metric from.

These metrics signify the replica lag in absolute terms and in the time dimension
capturing the whole picture of replica lag.

To use these metrics, a separate config section ReplicaLagSettings was added
under SqlSettings. This is an array of maps which contain three keys: DataSource,
QueryAbsoluteLag, and QueryTimeLag. Each map entry is for a single replica instance.

DataSource contains the DB credentials to connect to the replica instance.

QueryAbsoluteLag is a plain SQL query that must return a single row of which the first column
must be the node value of the Prometheus metric, and the second column must be the value of the lag.

QueryTimeLag is the same as above, but used to measure the time lag.

As an example, for AWS Aurora instances, the QueryAbsoluteLag can be:

select server_id, highest_lsn_rcvd-durable_lsn as bindiff from aurora_global_db_instance_status() where server_id=<>

and QueryTimeLag can be:

select server_id, visibility_lag_in_msec from aurora_global_db_instance_status() where server_id=<>

For MySQL Group Replication, the absolute lag can be measured from the number of pending transactions
in the applier queue:

select member_id, count_transaction_remote_in_applier_queue FROM performance_schema.replication_group_member_stats where member_id=<>

Overall, what query to choose is left to the administrator, and depending on the database and need, an appropriate
query can be chosen.
```

* Trigger CI

* Fix tests

* address review comments

* Remove t.Parallel

It was spawning too many connections,
and overloading the docker container.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-29 21:35:24 +05:30
Daniel Espino García
9d997dbbde Add feature flag for apps (#16851)
* Add feature flag for apps

* Update default to false

* Add plugin version Feature Flag

* Fix typo

* Only force shutdown, and leave the enable status dependant on the user (defaulting to enable)

* Remove unneeded tracking of status

* Handle plugin init on startup for locally installed plugin
2021-03-29 15:53:31 +02:00
Doug Lauder
1fb7f512ff fix race in unit test re logging (#17235) 2021-03-29 08:19:42 -04:00
Weblate (bot)
217f614f2d Translations update from Weblate (#17298)
* Added translation using Weblate (English (Australia))

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (2189 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/

* Translated using Weblate (Russian)

Currently translated at 99.8% (2187 of 2190 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (2189 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

Translated using Weblate (Russian)

Currently translated at 98.4% (2156 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (2190 of 2190 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2189 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 99.3% (2175 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (English (Australia))

Currently translated at 100.0% (2190 of 2190 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/

Translated using Weblate (English (Australia))

Currently translated at 100.0% (2189 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2190 of 2190 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

Translated using Weblate (Turkish)

Currently translated at 100.0% (2189 of 2189 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

* Translated using Weblate (Korean)

Currently translated at 84.6% (1854 of 2190 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ko/

* Deleted translation using Weblate (English (Australia))

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2191 of 2191 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

Co-authored-by: Matthew Williams <en_AU@controlaltdieliet.be>
Co-authored-by: Edward Smirnov <ed@microolap.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: aeomin <lin@aeomin.net>
Co-authored-by: Matthew Williams <Matthew.Williams@outlook.com.au>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: teamzamong <heekang@korea.ac.kr>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
2021-03-29 13:18:22 +02:00
Harrison Healey
b3e0db012b MM-27380 Move collapsed categories to server (#17194) 2021-03-26 17:46:56 -04:00
Martin Kraft
5e076ea36f MM-33402: Invalidated the LRU cache for channel members after moderat… (#17171)
* MM-33402: Invalidated the LRU cache for channel members after moderation changes.

* MM-33402: Handles cache invalidation error.

* Revert "MM-33402: Handles cache invalidation error."

This reverts commit 2d30d24658.

* MM-33402: Un-exports method.

* MM-33402: Removes log warning from previous code use.

* MM-33402: Handles possible (store.ChannelStore).GetMembers error.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-26 14:09:32 -04:00
Jesse Hallam
e3ac469ec6 pre-package Incident Collaboration v1.7.0 (#17234) 2021-03-26 10:53:50 -03:00
Agniva De Sarker
f865703ce9 Remove server from WebsocketRouter (#17238)
App contains server.
Server contains WebsocketRouter.

There is no need for WebsocketRouter to contain
server too. As is evident because the code never used it.

```release-note
NONE
```
2021-03-26 15:19:04 +05:30
Claudio Costa
017e14d4b5 [MM-32822] Improve JobServer state handling (#16959)
Automatic Merge
2021-03-26 10:32:16 +01:00
Ibrahim Serdar Acikgoz
85bc354680 [MM-33640] storetest/team_store: use NewTestId for fields like names etc. (#17204)
* storetest/team_store: use NewTestId for fields like names etc.

* reflect review comments

* fix tests

* we love good old C

* remove rand
2021-03-26 10:02:52 +03:00
Claudio Costa
cd0f92e2e7 [MM-34164] Fix flaky TestS3FileBackend (#17229)
* Fix flaky test

* Disable dumping data on error
2021-03-25 16:58:29 +01:00
Elisabeth Kulzer
5329eac020 Upgrade db and version (#17230) 2021-03-25 15:42:27 +01:00
Agniva De Sarker
94abb34821 MM-34271: Skip test TestLoggingAfterInitialized (#17226)
https://mattermost.atlassian.net/browse/MM-34271

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-25 19:29:06 +05:30
Agniva De Sarker
e567ed09e5 MM-34086: Skippping TestStartServerTLSOverwriteCipher (#17225)
https://mattermost.atlassian.net/browse/MM-34086

```release-note
NONE
```
2021-03-25 17:24:18 +05:30
Claudio Costa
28df047d92 Prevent User.Timezone field to overflow DB column capacity (#17220) 2021-03-25 11:38:43 +01:00
Jason Blais
58069ff7dc Update to correct mailing address in outgoing server and portal email (#17223)
* Update cloud_welcome_email.html

* Update en.json
2021-03-25 10:43:11 +01:00
Agniva De Sarker
b950125d4e MM-33945: Update dependencies (#17201)
* MM-33945: Update dependencies

Ran `make update-dependencies`

https://mattermost.atlassian.net/browse/MM-33945

```release-notes
NONE
```

* fix test
2021-03-25 14:45:13 +05:30
Ibrahim Serdar Acikgoz
adcddf350e app/slashcommands/command_loadtest: fix decoding error (#17199)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-25 11:20:22 +03:00
Agniva De Sarker
1578e25537 MM-34171: Fix racy test TestSentry (#17215)
* MM-34171: Fix racy test TestSentry

The NewServer call sets the global mlog Info variable.
But before that, if we call UpdateConfig with the functional options,
then the store.Set method will call mlog.Info before
it could be set.

To fix that, we prepare the updated config
and pass that directly to NewServer to avoid
having to call UpdateConfig.

https://mattermost.atlassian.net/browse/MM-34171

```release-note
NONE
```

* disable watcher

* Trying yet again

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-25 08:50:55 +05:30
Agniva De Sarker
f60b7437da MM-33893: Disable TCP_NO_DELAY for websocket connections (#17129)
* MM-33893: Disable TCP_NO_DELAY for websocket connections

In very large installations, websocket messages cause too much
traffic congestion by sending too small packets and thereby cause
a drop in throughput.

To counter this, we disable the TCP_NO_DELAY flag for websocket
connections. This has shown to give noticeable improvements in
load tests.

We wrap this in a feature flag for now to let it soak in Community
first.

```release-note
NONE
```

https://mattermost.atlassian.net/browse/MM-33893

* fix gorilla specific conn
2021-03-24 21:04:18 +05:30
Hossein
1f165799e0 [MM-34166] Fix Flaky Test TestGenerateSupportPacket (#17207)
* fix flaky tests

* Revert "fix flaky tests"

This reverts commit 255ce27bf6.

* Fix flaky test

* Fix equal
2021-03-24 07:02:17 -04:00
Agniva De Sarker
aba6471512 revertws (#17216)
* Revert "MM-34000: Use non-epoll mode for TLS connections (#17172)"

This reverts commit 2743089b54.

* Revert "MM-33233: Fix double close of webconn pump (#17026)"

This reverts commit 0f98620b65.

* Revert "MM-33836: Detect and upgrade incorrect HTTP version for websocket handshakes (#17142)"

This reverts commit 4c5ea07aff.

* revert i18n

* Revert "MM-21012: Revamp websocket implementation (#16620)"

This reverts commit a246104d04.

* fix go.mod

* Trigger CI
2021-03-24 15:29:23 +05:30
Claudio Costa
6a65b6ceca [MM-33794] Improve password generation during bulk import (#17147)
Automatic Merge
2021-03-24 10:32:16 +01:00
Harrison Healey
2789be220b Stop trying to build mattermost-redux in CI (#17206) 2021-03-23 13:28:43 -04:00
Mario de Frutos Dieguez
3d845feb7e Split CWS url in two: public and API (#17100)
Signed-off-by: Mario de Frutos <mario@defrutos.org>

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 15:27:40 +01:00
Weblate (bot)
545670a047 Translations update from Weblate (#17191)
* Translated using Weblate (Dutch)

Currently translated at 100.0% (2186 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2186 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 100.0% (2186 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2186 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

* Translated using Weblate (Japanese)

Currently translated at 98.5% (2155 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/

* Translated using Weblate (French)

Currently translated at 83.8% (1833 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/fr/

* Translated using Weblate (French)

Currently translated at 83.9% (1836 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/fr/

* Translated using Weblate (Spanish)

Currently translated at 93.5% (2044 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/es/

* Translated using Weblate (Russian)

Currently translated at 95.1% (2080 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2186 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/

* Translated using Weblate (French)

Currently translated at 84.0% (1837 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/fr/

* Translated using Weblate (Russian)

Currently translated at 95.1% (2080 of 2186 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Pierre JENICOT <pierre.jenicot@ac-lille.fr>
Co-authored-by: Cyril LD <c.laguilhon.debat@petitclou.de>
Co-authored-by: jesus.espino <jesus@mattermost.com>
Co-authored-by: Edward Smirnov <ed@microolap.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Elisabeth Kulzer <elisabeth.kulzer@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 13:38:38 +01:00
Eli Yukelzon
0cc72342de MM-33544 is_following prop in getPosts API methods (#17093)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 13:31:54 +02:00
Mario de Frutos Dieguez
c0971970e9 Revert "Fix initialism errors (PR-3) (#17062)" (#17202)
This reverts commit ea61458f16. This was causing panic in the plugins because the client and the plugin API changed with this PR
2021-03-23 10:32:54 +01:00
Allan Guwatudde
26b86cb3ef [MM-34129] - Cloud 'Congratulations!' email format broken (#17198)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-22 19:19:38 -04:00
Haardik Dharma
ea61458f16 Fix initialism errors (PR-3) (#17062)
* Fix initialism errors

* Revert some changes and regenerate file

* Update client4.go

* Update group_test.go

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-22 22:38:19 +03:00
Max Erenberg
0aa6499a48 MM-29607 allow user to deactivate MFA even when disabled (#16994)
Automatic Merge
2021-03-22 19:32:19 +01:00
Max Erenberg
6a77e24adc MM-28090 User settings api when ldap sync (#16822)
Automatic Merge
2021-03-22 19:02:16 +01:00
Agniva De Sarker
4aac52bced Makefile: Refactor test-server-race (#17196)
test-server-race wasn't using the same set of steps
that the test-server step did. Therefore one test was failing.

Refactored it such that scripts/test.sh can be used to run
normal and race tests as well

```release-note
NONE
```
2021-03-22 23:11:50 +05:30
Mattermost Build
9d65b72a3a Bump version (#17195)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-03-22 16:23:11 +01:00
Agniva De Sarker
7c041a0f71 MM-34124: Enable race tests on master branch (#17192)
Automatic Merge
2021-03-22 10:32:16 +01:00
Ibrahim Serdar Acikgoz
35cfab33fc store/post: fix searching for phrases in postgres (#17042)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-22 11:03:26 +03:00
Agniva De Sarker
33e319366c MM-34080: Removing sqlite entirely (#17188)
* MM-34080: Removing sqlite entirely

The initial commit missed removing this blank import.
So the library still remained in our vendor directory.
Removing it for good now.

Bye bye sqlite.

https://mattermost.atlassian.net/browse/MM-34080

* fix go.mod
2021-03-19 20:23:23 +05:30
Agniva De Sarker
2743089b54 MM-34000: Use non-epoll mode for TLS connections (#17172)
* MM-34000: Use non-epoll mode for TLS connections

A *crypto/tls.Conn does not expose the underlying TCP connection
or even a File method to get the underlying file descriptor
like the way a *net/TCPConn does. Therefore the netpoll code would
fail to get the file descriptor.

Relevant issue here: https://github.com/mailru/easygo/issues/3

It is indeed possible to use reflect black magic to get the unexported
member, but I have found unexpected errors during writing to the websocket
by getting the file descriptor this way. I do not want to spend time investigating
this especially since this is already released.

Once this is out, we can decide on the right way to fix this, most probably
by proposing to expose the File method or some other way.

https://mattermost.atlassian.net/browse/MM-34000

```release-note
Fix an issue where websockets wouldn't work with TLS connections.
In that case, we just fall back to the way it works for Windows machines,
which is to use a separate goroutine for reader connection.
```

* Ignore logging errors on non-epoll

On non-epoll systems, we needed to return an error
to break from the loop. But in that case, there is no
need to log the error
2021-03-18 22:27:53 +05:30
Agniva De Sarker
476846c28e Disable unparam (#17167)
Automatic Merge
2021-03-17 18:18:32 +01:00
Claudio Costa
d3a003dcb2 Address outstanding merging issues with cloud branch (#17160) 2021-03-17 10:39:46 +01:00
Jesús Espino
c5e1b36dd3 Making the posts tests a bit more robust (#17151) 2021-03-16 15:55:55 +01:00
Max Erenberg
4699845c0a Mm 29605 read permission s3 bucket (#16977)
Automatic Merge
2021-03-16 15:48:32 +01:00
Claudio Costa
f0ccaa89bf [MM-33603] Fix nil dereference panic in (*App).CreatePost() (#17124)
* Fix possible nil dereference

* fixed nil dereference for unfollowed thread

Co-authored-by: Eli Yukelzon <reflog@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 14:30:52 +01:00
Allan Guwatudde
cee7f8ba4e [MM-33498] - Correct Admin Console Reference (#17076)
* [MM-33498] - Correct Admin Console Reference

* Fix translations

* Fix translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 16:20:00 +03:00
Jesús Espino
7208952010 Improve file search results with postgres (#17112)
* Improve file search results with postgres

* Adding channel id to search results

* Fixing file info saves
2021-03-16 11:19:13 +01:00
Jesús Espino
2417fb265d Moving markdown to corelibs (#16916)
* Moving markdown to corelibs

* Fix golangci-lint problem

* Renaming corelibs to pkg

* Fixing golangci-lint

* Renaming from pkg to shared

* Fixing gofmt

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 11:18:41 +01:00