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

12329 Коммитов

Автор SHA1 Сообщение Дата
Doug Lauder
d390942581 MM-24217 ensure updating Mfa secret and status invalidates cache (#14334) 2020-04-22 09:09:13 -04:00
Martin Kraft
70e9647e85 MM-23646: Improve group sync performance. (#14171)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-21 15:55:30 -04:00
Agniva De Sarker
d9713792ba MM-23800: remove goroutineID and stack printing (#14268)
* MM-23800: remove goroutineID and stack printing

Each hub has a goroutineID which is calculated with a known hack.
The FAQ clearly explains why goroutines don't have an id:
https://golang.org/doc/faq#no_goroutine_id.

We only added that because sometimes the hub would be deadlocked and
having the goroutineID would be useful when getting the stack trace.
This is also problematic in stress tests because the hubs would
frequently get overloaded and the logs would unnecessarily have stack traces.

But that was in the past, and we have done extensive testing with
load tests and fuzz testing to smooth any rough edges remaining.
Including adding additional metrics for hub buffer size.

Monitoring the metrics is a better way to approach this problem.
Therefore, we remove these kludges from the code.

* Also remove deadlock checking code

There is no need for that anymore since
we are getting rid of the stack printing anyways.

Let's do a wholesale refactor and clean up the codebase.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-22 00:20:44 +05:30
Mario de Frutos Dieguez
9783294e97 Include dejavu in docker compose (#14329)
* Include dejavu in docker compose
2020-04-21 20:48:04 +02:00
Attila Molnar
f77ad4992b Fix assertExpectedWebsocketEvent ignoring the passed event (#14330) 2020-04-21 11:11:25 +02:00
George Goldberg
6cabc40e62 MM-23568: Add rudder to server diagnostics. (#14151)
* MM-23568: Add rudder to server diagnostics.

* Add unit test.

* Go mod tidy.

* CSP Header fix.

* Fix review comments.

* Update web/handlers.go

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>

* Partially address review comments.

* fix tests.

* Finish implementing review suggestions and then fixing tests.

* Fix CSP Header tests.

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-04-21 09:23:00 +01:00
Doug Lauder
26310720be MM-23724 add RestoreTeam endpoint (#14297)
* MM-23724 add RestoreTeam endpoint
* assert added to unit test
2020-04-20 22:40:22 -04:00
Doug Lauder
98c6401f54 MM-23722 add endpoint for modify team privacy (#14287)
* MM-23722 add Rest API for updating team privacy
* unit tests for UpdateTeamPrivacy
2020-04-20 21:09:40 -04:00
Jesús Espino
0cb8d96be2 Removing accidentally included debug log (#14310)
* Removing accidentally included debug log

* Regenerating the store layers
2020-04-20 14:37:11 +02:00
Carlos Tadeu Panato Junior
0d0ab51876 license: dropping PhoneNumber field from the license (#14307)
Per request of the bix team and checking the code this field is not used
in any place and also is one information that is not needed at all.
2020-04-20 14:20:35 +02:00
Mario de Frutos Dieguez
cff7de9e68 [MM-24065] Guest users should be able to search by channel (#14302)
* Remove unnecessary check for PERMISSION_LIST_TEAM_CHANNELS

In the autocompleteChannelsForTeamForSearch method we're checking for
the PERMISSION_LIST_TEAM_CHANNELS permission in order to avoid filtering
channels in the autocomplete search but this check is not necessary.

Now we're going directly to the database to search for those channels
in this specific method and we're filtering by channel membership and
team so there is no chance that we are going to filter undesired
channels to the user.

[Here](https://github.com/mattermost/mattermost-server/blob/v5.22.0/store/sqlstore/channel_store.go#L2014)
is the query where you can see the filtering we're making
2020-04-20 11:21:51 +02:00
Carlos Tadeu Panato Junior
176db1e189 dockerfile: set 5.22.0 version (#14309) 2020-04-18 11:00:13 +02:00
Jesse Hallam
4582823f87 fix /test command (#14169)
Automatic Merge
2020-04-18 00:08:57 -07:00
Farhan Munshi
e88ba85d60 [MM-23017] Add check for groups to SendNotifications (#14039)
* MM-23017 Check group mentions as part of notification logic

* Add nil groups to existing test cases

* MM-23017 Add tests for insertGroupMention and addGroupMention

* MM-23017 Add tests for getExplicitMentions that have groups

* Add tests for group store GetMemberUsersNotInChannel

* MM-23017 Add tests for AllowGroupMentions

* MM-23017 Fix error message name

* MM-23017 Swap Checks to Name

* MM-23017 Code review fixes

* Rename var and fix allowGroupMentions test

* MM-23017 Use GetMemberUsersInTeam inside of insertGroupMentions

* MM-23017 use group mentions permission

* Actually call GetMemberUsersInTeam

* Remove unnecessary new line

* Uncomment filter allow reference

* MM-23017 Fix group channel notifications

* Update store layer

* MM-23017 Improve test coverage for group channels

* Trigger CI

* Trigger CI
2020-04-17 19:22:54 -04:00
Jesse Hallam
29fae242e1 Revert "Dependency updates. (#14033)" (#14304)
This reverts commit f14c79f170.
2020-04-17 14:26:29 -03:00
Eli Yukelzon
be7ee97dd3 MM-24094 EnableOpenTracing config setting missing from teleme… (#14298) 2020-04-16 20:17:46 +03:00
Juho Nurminen
e763e308a4 Update Dependency-Check suppressions (#14294)
Automatic Merge
2020-04-16 09:38:57 -07:00
Flavia Bastos
d4132e783c Document sqlTeamStore analytics methods (#14300) 2020-04-16 17:57:33 +02:00
Jesús Espino
7ea637be10 MM-20934: Fixing int overflow in 32 bits on MaxImageSize check (#14280)
* MM-20934: Fixing int overflow in 32 bits on MaxImageSize check

* Adding comments explaining the casting and the bug fixed there

* Apply suggestions from code review

Co-Authored-By: Juho Nurminen <juhonurm@gmail.com>

* Fixing store layers

Co-authored-by: Juho Nurminen <juhonurm@gmail.com>
2020-04-16 15:23:27 +02:00
Doug Lauder
cd63c1153f MM-24096 add telemetry for audit log config (#14282)
* MM-24096 add telemetry for audit log config

* added audit config telemetry to unit test
2020-04-14 22:30:27 -04:00
Farhan Munshi
2a9f465bf2 Fix broken master build by updating store (#14291)
* Fix broken master build by updating store

* Run store-mocks
2020-04-14 16:24:30 -04:00
Mario de Frutos Dieguez
aafea55976 MM-23131 Include HTTP status code in the metrics (#14240)
* ResponseWriter wrapper to get status code

For our metrics, we need the status code returned by a request
so this wrapper includes a new method StatusCode() that includes
the desired code

* Shadow the responsewriter variable in the handlers

In order to avoid confusion to people deciding what variable to use.
I've also changed the tests to reflect this change and added a new
one that checks the Flush method works
2020-04-14 14:15:00 +02:00
Miguel de la Cruz
53c1c0d4b4 Add check-store-layers check to the CI and include their updates (#14264)
* Add check-store-layers check to the CI and include their updates

* Add check-store-layers as a dependency for the test tasks

* Remove changes to the store to avoid conflicts with https://github.com/mattermost/mattermost-server/pull/14261

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-13 22:58:03 +02:00
Ibrahim Serdar Acikgoz
eb5b04c86a app/diagnostics: add telemetry for smtp_server_timeout (#14283)
Automatic Merge
2020-04-13 12:08:57 -07:00
catalintomai
b90f4f46e2 MM-23015: Enable or disable group mentions (#14010)
* MM-23015: Enable or disable group mentions + show them in suggestion list


Co-authored-by: Catalin Tomai <catalin.tomai@mattermost.com>
2020-04-13 11:37:29 -07:00
Agniva De Sarker
0bfb063c78 MM-24095: Add IdleTimeout to telemetry (#14279)
Automatic Merge
2020-04-13 11:08:57 -07:00
Mario de Frutos Dieguez
9b6bb2f98d Add some missing methods in time and opentracing layers (#14261) 2020-04-12 11:54:55 +02:00
Martin Kraft
df5cb41a64 MM-23399: Fix for old team schemes that have a blank guest role. (#14267) 2020-04-10 13:58:40 -04:00
Martin Kraft
a9ea3587bb MM-23244: Validate that AuthData and AuthService fields are mutually inclusive. (#14175)
* MM-23244: Validate that either both or neither AuthData and AuthService fields are set.

* MM-23244: Readability improvement.

* MM-23244: Adds translation. Tests for error id.

* MM-23244: Fix test.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-09 18:51:27 -04:00
Harrison Healey
bfb380630c Fix community signup link (#14262) 2020-04-09 09:49:18 -04:00
Mario de Frutos Dieguez
698b4b6934 [MM-23882] Include database server version in telemetry (#14258)
* Add database server version to telemetry

Also added a new query in the store to retrieve the database version

* Add test for the GetDbVersion function

* More drivers in the tests

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-09 11:08:15 +02:00
Jesús Espino
f6f025aeaa Adding guest accounts count telemetry (#14257)
* Adding guest accounts count telemetry

* Adding missed methods to the opentracing an timer layer
2020-04-09 11:05:43 +02:00
Eli Yukelzon
819f57037b fixed app-layer generator, re-enabled struct2interface in make… (#14260)
* fixed app-layer generator, re-enabled struct2interface in makefile
2020-04-09 11:08:39 +03:00
Agniva De Sarker
1f036b7588 Jenkins: Make mysql and postgres tests run in parallel (#14026)
* Jenkins: Make mysql and postgres tests run in parallel

* Trying again

* Start docker containers individually for each stage

This is because the parallel block does not allow
a common step to be specified.

* Giving a random name to each docker-compose

* Fixing order of the param

* Giving unique project names for tests

* Setting the right datasource and drivername

* Trying to use different copies of the src directory for test the databas3

* moving workspace copy to the beginning of postgres tests

* Fixing some missed out patches

* Added missing LDAP population command

* Upload all test results

And set allowEmptyResults to false.

* Pruning remaining docker networks

* Remove unneeded settings

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2020-04-08 23:22:58 +05:30
Agniva De Sarker
583daeb132 MM-23547: remove redundant JSON parsing in push notifications (#14181)
Automatic Merge
2020-04-08 08:38:57 -07:00
Jesse Hallam
b8eb69281b MM-23666: rewrite TestHTTPClient (#14236)
* MM-23666: rewrite TestHTTPClient

The existing `TestHTTPClient` actually tries to reach google.com, making it brittle to network hiccups (as unlikely as that might be). Rewrite the test to rely on a local server instead.

I found the existing implementation of `TestHTTPClient` extremely hard to understand, so I've rewritten it more explicitly, expanded coverage somewhat. In doing so, I found myself somewhat surprised by the current behaviour. If `allowHost` returns `true`, we ignore `allowIP` altogether. If `allowHost` returns `false`, we check with `allowIP`. There's a lack of symmetry here that the current filter names don't make clear. Perhaps `allowHost` should be renamed `skipIPCheckForHost`?

Fixes: https://mattermost.atlassian.net/browse/MM-23666

* more compact assertions
2020-04-08 09:40:42 -03:00
Ian Whitlock
8084620911 MM-23824 Clean up orphaned plugin process at test completion (#14235)
* Clean up orphaned plugin process at test completion

* Add supervisor shutdown to second test for consistency
2020-04-08 09:35:42 -03:00
George Goldberg
f14c79f170 Dependency updates. (#14033)
* Update dependencies.

* Fix tests.
2020-04-08 10:51:04 +01:00
Agniva De Sarker
ac4153df03 Bump minimum Go version required (#14250)
After the auto-vendoring change, minimum Go version
required is 1.14.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-08 14:28:55 +05:30
Doug Lauder
6a27ed4a1d MM-22785 audit server CLI (#14144)
Add auditing to server CLI.

Also:
- simplify auditing in API layer
- reduce number of AddMeta calls
- have models serialize themselves
- more consistent field naming
2020-04-08 00:52:30 -04:00
Doug Lauder
e2d1af17de MM-23489 Fix poor Unicode handling in display names (#14214)
Filter blacklisted Unicode characters from:

user: first name, last name, nickname, bot description, username
team: name, display name, description, company name
channel: name, display name
2020-04-07 16:56:07 -04:00
Carlos Tadeu Panato Junior
84859e7159 db: prepare db upgrade to 5.23 (#14249) 2020-04-07 17:01:01 +02:00
Agniva De Sarker
4210ae60ab MM-22056: Fix flaky test TestUploadFiles (#14234)
Automatic Merge
2020-04-07 07:09:04 -07:00
Carlos Tadeu Panato Junior
22a00104bd update dockerfile to use the latest release available (#14232)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-07 15:25:15 +02:00
Ben Schumacher
8e858d4dc3 Bump app version to 5.24 (#14220) 2020-04-07 15:22:54 +02:00
Eli Yukelzon
92380d83fc OpenAPI Mattermost Go Vet integration (#14216)
* integrating govet
* added api spec check to CI
2020-04-07 16:18:08 +03:00
Martin Kraft
f92d3fa518 MM-23876: Fix for patching channel moderations with a null team schem… (#14239)
* MM-23876: Fix for patching channel moderations with a null team scheme channel guest role.

* MM-23876: Tests the moderations response.
2020-04-07 17:35:03 +05:30
Elisabeth Kulzer
27a0ff4d52 Revert "Updating to use a different network cidr for the mm-test network (#14223)" (#14247)
This reverts commit d1d1e3d27a.
2020-04-07 12:57:24 +02:00
Carlos Tadeu Panato Junior
ff505457a2 db: upgrade db to 5.22 (#14224)
* db: upgrade db to 5.22
2020-04-07 11:44:08 +02:00
Agniva De Sarker
6f6793e579 MM-22782: Write fuzz testing for websockets (#14203)
* MM-22782: Write fuzz testing for websockets

* Moved to fuzz function

* incorporate review comments

* Remove some more comments
2020-04-07 14:41:55 +05:30