Commit Graph

13506 Commits

Author SHA1 Message Date
Weblate (bot)
f145ac202d Translations update from Weblate (#17381)
* Translated using Weblate (Dutch)

Currently translated at 99.2% (2284 of 2301 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 99.3% (2285 of 2301 strings)

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

* Update translation files

Updated by "Remove blank strings" hook in Weblate.

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

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 99.3% (2287 of 2301 strings)

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

Translated using Weblate (Portuguese (Brazil))

Currently translated at 96.0% (2211 of 2301 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2303 of 2303 strings)

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

Translated using Weblate (Swedish)

Currently translated at 99.9% (2301 of 2303 strings)

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

Translated using Weblate (Swedish)

Currently translated at 98.0% (2255 of 2301 strings)

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

Translated using Weblate (Swedish)

Currently translated at 96.7% (2226 of 2301 strings)

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

* Translated using Weblate (Romanian)

Currently translated at 100.0% (2301 of 2301 strings)

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

Translated using Weblate (Romanian)

Currently translated at 94.7% (2181 of 2301 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 88.8% (2045 of 2301 strings)

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

* Translated using Weblate (Dutch)

Currently translated at 100.0% (2303 of 2303 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% (2301 of 2301 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 99.3% (2287 of 2301 strings)

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

* Translated using Weblate (Russian)

Currently translated at 100.0% (2303 of 2303 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% (2301 of 2301 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 95.6% (2201 of 2301 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 100.0% (2303 of 2303 strings)

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

Translated using Weblate (Japanese)

Currently translated at 100.0% (2301 of 2301 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 82.1% (1892 of 2303 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 97.9% (2255 of 2303 strings)

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

* Translated using Weblate (Bulgarian)

Currently translated at 94.9% (2186 of 2303 strings)

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

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: rodrigocorsi <rodrigocorsi@gmail.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Viorel-Cosmin Miron <cosmin@uhlhost.net>
Co-authored-by: Elias  Nahum <elias@mattermost.com>
Co-authored-by: Edward Smirnov <ed@microolap.com>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: William Farelly <wfarelly@orange.fr>
Co-authored-by: Nikolai Zahariev <nikolaiz@yahoo.com>
2021-04-12 17:27:35 +02:00
Eli Young
17a7d5ce29 [MM-31899] Use a custom user-agent when previewing links (#17186)
* Use a custom user-agent when previewing links

Many websites block requests made with Go's default user-agent. We had
previous special-cased Twitter links to use a nonstandard user-agent.
This makes that behavior apply everywhere and also customizes the
user-agent to belong specifically to Mattermost.

* Correctly use custom transport for link previews

This allows us to use the custom user-agent defined in
services/httpservice/client.go.

* Stop leaking server version in custom user-agent

Since the custom user-agent is now used when previewing links, exposing
the server version could provide a vector for a malicious actor to
gather information about private deployments. To avoid this, we switch
to a generic string.

* Remove extraneous Transport creation

MakeClient already creates a transport for us, so this is unnecessary.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-12 09:30:48 -04:00
Jesús Espino
35d00b4644 Enable the errorAssertions govet check for mattermost-server code (#17346)
* Enable the errorAssertions govet check for mattermost-server code

* Removing unnecesary change

* Fixing some tests

* Fixing tests

* Fixing more after merge

* Fixing new offending entries

* Fixing small vet checks

* Fixing new cases detected by govet

* Fixing remote_cluster_test errors

* Fixing assertion

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-12 12:51:31 +02:00
catalintomai
e37e902ddf MM-29584: Make apps plugin hook invocation/registration conditional (#16769) 2021-04-11 19:54:46 -07:00
Max Erenberg
3a3ec001bf [MM-33826] add more detailed S3 error messages (#17182)
Automatic Merge
2021-04-09 18:16:30 +02:00
Mattermost Build
565f65a0c3 Bump version (#17368)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-04-09 13:32:27 +02:00
jingkai
0eafaa502d Refactor SQL queries in store/sqlstore/preference_store.go to use the squirrel builder (#17086)
* refactor: refactored deleteUnusedFeatures

* refactor: refactored Get to remove hardcoded sql queries

* refactor: remove debug log

* refactor: refactored getcategory

* refactor: refactored GetAll to replace with sq

* refactor: refactor delete with sq

* refactor: refactored delete category with sq

* refactor: refactored cleanup flagsbatch

* refactor: refactor save to usq sq

* fix: fixed missing wildcard in LIKE operator

* refactor: fixed previous double call to database with a cleaner approach

* refactor: removed debug logs

* refactor: removed debug logs

* fix: added a new error checking as Limit accepts uint and the function parameter accepts int

* fix: golangcilint error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-09 11:13:31 +02:00
ctlaltdieliet
dfa476a688 Update en.json (#17362) 2021-04-08 11:48:00 +03:00
Max Erenberg
3ad80a2d0f log invalid username (#17345)
Automatic Merge
2021-04-07 20:46:30 +02:00
Agniva De Sarker
5ff151c327 Bump no_output_timeout to 2 hours (#17358) 2021-04-07 21:45:51 +05:30
Ben Cooke
1c3712b344 adding new feature flag (#17308)
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-07 12:12:53 -04:00
Amy Blais
f5d599b728 Update en.json (#17356)
Automatic Merge
2021-04-07 16:16:30 +02:00
Jesús Espino
819e4c0c64 Improve document extraction and including a document extraction command (#17183)
* Add extract documents content command

* Adding the extraction command and making the pure go pdf library as secondary option

* Improving the memory usage and docextractor interface

* Enable content extraction by default in all the instances

* Tiny improvement on archive indexing

* Adding App interface generation and the opentracing layer

* Fixing linter errors

* Addressing PR review comments

* Addressing PR review comments
2021-04-07 13:27:20 +02:00
Ben Schumacher
75824257d5 Add missing wrapped errors (#17339) 2021-04-07 10:44:50 +02:00
Hossein
fef3158bab fix broken test (#17348) 2021-04-06 16:55:20 -04:00
Hossein
daec0b3201 All Sections to SubSections (#16917)
* initial

* Revert "initial"

This reverts commit 3d631aeecd.

* [MM-32352] Add Experimental Subsections BACKEND (#16887)

Automatic Merge

* update appiface

* Fix app layers

* Ancillary Permissions on backend (#17061)

Automatic Merge

* [MM-32799] Add About Section (#17015)

* Add About Section

* add mock key

* Update role.go

* Update role.go

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* [MM-33437] Fix config access tags for experimental settings (#17111)

Automatic Merge

* [MM-32794] Reporting Sub Section (#17035)

* test

* revert

* add permissions

* add new permission stuff

* add store mock

* fix bad merge

* gofmt fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>

* [MM-32343] Environment SubSection (#17054)

* pre-checkout commit

* fix permission for testSiteURL

* pre-merge commit

* increase size of Permissions column in Roles table

* add entry for ENVIRONMENT to testlib/store.go

* use TEXT for Permissions column in Roles table

* use environment subsection permissions for API endpoints

* use subsections permissions for /config/environment

* add suggestions from hahmadia

* update tests to use subsection permissions

* add permissions column back in

* comment out code in upgradeDatabaseToVersion534

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* MM-32351: Add Compliance Subsections (#17023)

* add subsections for compliance sectin

* add to mock functions

* updates for read job

* fixes

* fix test

* update tests

* update tests

* another test fix

* some cleanup

* update mlog

* fix linting

* Fix bad merges

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>

* MM-32347 Site Subsections (#17095)

* Init

* Added migration key in testlib store

* Fix syntax error

* fix bad merge

* fix lint

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* MM-32350 Integrations (#17097)

* implement server subsections

* fix tests

* update test

* go fmt

Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>

* patch forgotten endpoints

* Adding subsection permissions for Authentication (#17087)

* adding new permissions, migrations to do

* permission migrations and ancilary permissions

* running make app-layers

* fixing tests and lint

* adding permissions to saml

* ldap write permissions

* running make app-layers

* fixing conflict

* making app layers

* clean up and fix tests

* change job type

* fix js error, if site url not returned

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>

* Update permissions_migrations.go

* gofmt

* upgrade to 535

* gofmt

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Anurag Shivarathri <anurag6713@gmail.com>
Co-authored-by: Ben Cooke <benkcooke@gmail.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
2021-04-06 10:39:48 -04:00
Scott Bishel
2cb82965b0 MM-33905 -always add FeatureFlags to config (#17163)
* always add FeatureFlags to config

* update const to TitleCase

* gofmt

* update method to use 'access:all'

* update method to use 'access:all'

* fix lint

* gofmt

* added comments

* update name of access tag for any

* fix bad save

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-06 10:39:36 -04:00
Allan Guwatudde
ec5f099313 [MM-34240]-Cloud: Congratulations welcome email missing images (#17338) 2021-04-06 10:13:14 -04:00
Weblate (bot)
d2e269edd2 Translations update from Weblate (#17334)
* Translated using Weblate (Russian)

Currently translated at 100.0% (2299 of 2299 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 97.8% (2249 of 2299 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% (2194 of 2194 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% (2192 of 2192 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2194 of 2194 strings)

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

* Translated using Weblate (Chinese (Simplified))

Currently translated at 99.7% (2188 of 2194 strings)

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

* Translated using Weblate (French)

Currently translated at 85.1% (1869 of 2194 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 100.0% (2194 of 2194 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 95.6% (2198 of 2299 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% (2194 of 2194 strings)

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

* Translated using Weblate (Russian)

Currently translated at 100.0% (2299 of 2299 strings)

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

Co-authored-by: Edward Smirnov <ed@microolap.com>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: aeomin <lin@aeomin.net>
Co-authored-by: Pierre JENICOT <pierre.jenicot@ac-lille.fr>
Co-authored-by: jesus.espino <jesus@mattermost.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Elisabeth Kulzer <elisabeth.kulzer@mattermost.com>
2021-04-06 11:28:55 +02:00
Eli Yukelzon
7573efe039 merge fix (#17337) 2021-04-06 11:27:09 +03:00
Haardik Dharma
343c51830f Fix initialism errors (PR-2) (#17032)
* Fix initialism errors

* Fix check-mocks test

* Revert mlog and filestore packages

* Update plugin_hooks_test.go

* Update opentracinglayer.go

* Regenerate mocks and check store layers

* Revert plugin's context changes

* Update context.go

* Update plugin_requests.go

* Update plugin_hooks_test.go

* Regenerate mocks

* Regenerate mocks and store layers

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-03 12:43:22 +05:30
Agniva De Sarker
db01f2a91b MM-34002: Improve AddUserToChannel (#17174)
* MM-34002: Improve AddUserToChannel

When we would add a user to a channel, we would
check whether the user is removed from that team or not.

During LDAP sync, this check is not required because the
team member would have just been created. Hence, we
pass a boolean flag to bypass the check.

And with that done, we can freely query the replica.

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

```release-note
NONE
```

* Refactor code

* Rename a struct field

* fix double negative
2021-04-02 14:33:23 +05:30
Agniva De Sarker
4f0cfbe329 MM-33913: Fix read-after-write issues with team member (#17173)
During LDAP sync, we would call AddTeamMember which had a read-after-write issue
where we would create a team member but then immediately after that
query the team member.

The same pattern was found in:
AddTeamMember
AddTeamMembers
AddTeamMemberByToken

To fix this, we just return the inserted team member from AddUserToTeam and use that
instead of query GetTeamMember again.

```release-note
NONE
```

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

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-02 13:20:58 +05:30
Doug Lauder
02196e04fa MM-27493 Shared channels (MVP) (#17301)
Remote Cluster Service
- provides ability for multiple Mattermost cluster instances to create a trusted connection with each other and exchange messages
- trusted connections are managed via slash commands (for now)
- facilitates features requiring inter-cluster communication, such as Shared Channels
Shared Channels Service
- provides ability to shared channels between one or more Mattermost cluster instances (using trusted connection)
- sharing/unsharing of channels is managed via slash commands (for now)
2021-04-01 13:44:56 -04:00
Ibrahim Serdar Acikgoz
ff980266ac app/server: make sure if metrics server goroutine executed (#17323) 2021-04-01 20:05:24 +03:00
Ibrahim Serdar Acikgoz
9897d4651a [MM-34557] commands/server_test: add skip (#17321)
* commands/server_test: disable plugins for test (was causing a data race)

* add skip app init

* skip tests

* add skip linter
2021-04-01 18:17:33 +03:00
Eli Yukelzon
480796a1df MM-33708 - Add MentionCountRoot column to ChannelMembers (#17099)
* added new column for root-only mentions

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-01 14:43:09 +03:00
Eli Yukelzon
3c21eef110 MM-33746 hotfix (#17320)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-01 13:56:39 +03:00
Agniva De Sarker
5215be51be MM-34487: Add dead queue (#17307)
* MM-34487: Add dead queue

Just a circular buffer to store dead messages for now.
Not controlling this via config flag because this does
not have any effect except taking some more memory
per connection

```release-note
NONE
```

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

* Wrap with config

* fix test
2021-04-01 15:31:19 +05:30
Ibrahim Serdar Acikgoz
e13d85d8c7 [MM-34179] app: move cluster registeration to server creation (#17306)
* app: move cluster registeration to server creation

* initserver via fakeapp

* reflect review comments
2021-04-01 11:29:56 +03:00
Agniva De Sarker
756f5fbff3 MM-34086: Fix flaky test StartServerTLSOverwriteCipher (#17303)
* MM-34086: Fix flaky test StartServerTLSOverwriteCipher

This suffered from the same race condition as
https://github.com/mattermost/mattermost-server/pull/17215.

We apply the same approach of using a memstore instead
of a file based config store.

It is likely that the test was also failing because of
the same race. Although I don't obviously see how, because
the race happens with mlog.Info. The test will fail only
if the config wasn't able to set properly. So although
not strictly related, it's somehow related.

If it fails again, we can look into it again. But this
atleast fixes the race.

While here, we also apply some cleanup of the code.

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

```release-note
NONE
```

* Remove race test
2021-04-01 00:33:49 +05:30
Allan Guwatudde
489eaa4605 [MM-32639] - Resend user invite emails (#17113)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-31 13:20:53 -04:00
Eli Yukelzon
ab5925c4de MM-33746 Add TotalMsgCountRoot and MsgCountRoot columns (#17150) 2021-03-31 16:51:02 +03:00
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