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

207 Коммитов

Автор SHA1 Сообщение Дата
Mattermod
af3853b4bf Update latest version to 7.0.1 (#20542) 2022-06-24 17:18:05 +03:00
Agniva De Sarker
18c8a2bb53 MM-25554: Remove hardcoded english as the search config (#20472)
We use the default_text_search_config param from the DB
and pass that as the search config instead of hardcoding
it to english.

The docs do say that if no param is passed, by default
it will automatically fall back to default_text_search_config.
But I have seen different query plans being created
when the parameter is not passed versus when it is passed.
I am not sure why this is happening, but to be safe,
I have taken the search config during startup and stored
it in the SqlStore struct.

For reference, this is what happens without a search config
passed:

```
[bigdb] # explain analyze  SELECT *, (SELECT COUNT(*) FROM Posts WHERE Posts.RootId = (CASE WHEN q2.RootId = '' THEN q2.Id ELSE q2.RootId END) AND Posts.DeleteAt = 0) as ReplyCount FROM Posts q2 WHERE q2.DeleteAt = 0 AND q2.Type NOT LIKE 'system_%' AND to_tsvector(Message) @@  to_tsquery('sapiente') AND ChannelId IN (SELECT Id FROM Channels, ChannelMembers WHERE Id = ChannelId AND Channels.DeleteAt = 0 AND ChannelMembe
                                                                                                                                                                                                                                                                                                                               rs.UserId = 'tc3p1yqw67d8idcp3g98awexqe' AND (TeamId = '8ywxyw9ocp8smxrmjzrkqhrdwe' OR TeamId = '') AND Id IN ('h1x9asxr7idjpqfmg8q67us49h')) ORDER BY q2.CreateAt DESC LIMIT 100;
                                                                                                  QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=8200.93..8720.23 rows=9 width=382) (actual time=177.277..177.948 rows=100 loops=1)
   ->  Result  (cost=8200.93..8720.23 rows=9 width=382) (actual time=177.274..177.939 rows=100 loops=1)
         ->  Sort  (cost=8200.93..8200.95 rows=9 width=374) (actual time=177.245..177.271 rows=100 loops=1)
               Sort Key: q2.createat DESC
               Sort Method: top-N heapsort  Memory: 161kB
               ->  Nested Loop Semi Join  (cost=71.53..8200.79 rows=9 width=374) (actual time=5.910..176.815 rows=532 loops=1)
                     ->  Bitmap Heap Scan on posts q2  (cost=70.56..8183.64 rows=9 width=374) (actual time=5.815..176.457 rows=532 loops=1)
                           Recheck Cond: ((channelid)::text = 'h1x9asxr7idjpqfmg8q67us49h'::text)
                           Filter: (((type)::text !~~ 'system_%'::text) AND (deleteat = 0) AND (to_tsvector((message)::text) @@ to_tsquery('sapiente'::text)))
                           Rows Removed by Filter: 5244
                           Heap Blocks: exact=944
                           ->  Bitmap Index Scan on idx_posts_channel_id_update_at  (cost=0.00..70.56 rows=1866 width=0) (actual time=1.883..1.883 rows=5776 loops=1)
                                 Index Cond: ((channelid)::text = 'h1x9asxr7idjpqfmg8q67us49h'::text)
                     ->  Materialize  (cost=0.98..17.04 rows=1 width=27) (actual time=0.000..0.000 rows=1 loops=532)
                           ->  Nested Loop  (cost=0.98..17.03 rows=1 width=27) (actual time=0.080..0.080 rows=1 loops=1)
                                 ->  Index Scan using channels_pkey on channels  (cost=0.42..8.45 rows=1 width=27) (actual time=0.041..0.042 rows=1 loops=1)
                                       Index Cond: ((id)::text = 'h1x9asxr7idjpqfmg8q67us49h'::text)
                                       Filter: ((deleteat = 0) AND (((teamid)::text = '8ywxyw9ocp8smxrmjzrkqhrdwe'::text) OR ((teamid)::text = ''::text)))
                                 ->  Index Only Scan using idx_channelmembers_user_id_channel_id_last_viewed_at on channelmembers  (cost=0.56..8.58 rows=1 width=27) (actual time=0.034..0.034 rows=1 loops=1)
                                       Index Cond: ((userid = 'tc3p1yqw67d8idcp3g98awexqe'::text) AND (channelid = 'h1x9asxr7idjpqfmg8q67us49h'::text))
                                       Heap Fetches: 1
         SubPlan 1
           ->  Aggregate  (cost=57.68..57.69 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=100)
                 ->  Index Only Scan using idx_posts_root_id_delete_at on posts  (cost=0.56..54.44 rows=1294 width=0) (actual time=0.005..0.005 rows=3 loops=100)
                       Index Cond: ((rootid = (CASE WHEN ((q2.rootid)::text = ''::text) THEN q2.id ELSE q2.rootid END)::text) AND (deleteat = 0))
                       Heap Fetches: 0
 Planning Time: 2.178 ms
 Execution Time: 178.155 ms
```

We can see it using a top-N heapsort.

And this is what happens when an explicit search config
is passed:

```
[bigdb] # explain analyze  SELECT *, (SELECT COUNT(*) FROM Posts WHERE Posts.RootId = (CASE WHEN q2.RootId = '' THEN q2.Id ELSE q2.RootId END) AND Posts.DeleteAt = 0) as ReplyCount FROM Posts q2 WHERE q2.DeleteAt = 0 AND q2.Type NOT LIKE 'system_%' AND to_tsvector('pg_catalog.english', Message) @@  to_tsquery('pg_catalog.english', 'sapiente') AND ChannelId IN (SELECT Id FROM Channels, ChannelMembers WHERE Id = ChannelId AND Channels.DeleteAt = 0 AND ChannelMembers.UserId = 'tc3p1yqw67d8idcp3g98awexqe' AND (TeamId = '8ywxyw9ocp8smxrmjzrkqhrdwe' OR TeamId = '') AND Id IN ('h1x9asxr7idjpqfmg8q67us49h')) ORDER BY q2.CreateAt DESC LIMIT 100;
                                                                                            QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=1.54..10679.04 rows=100 width=382) (actual time=0.237..31.405 rows=100 loops=1)
   ->  Nested Loop Semi Join  (cost=1.54..17512.64 rows=164 width=382) (actual time=0.236..31.387 rows=100 loops=1)
         ->  Index Scan Backward using idx_posts_channel_id_delete_at_create_at on posts q2  (cost=0.56..8032.81 rows=164 width=374) (actual time=0.121..30.124 rows=100 loops=1)
               Index Cond: (((channelid)::text = 'h1x9asxr7idjpqfmg8q67us49h'::text) AND (deleteat = 0))
               Filter: (((type)::text !~~ 'system_%'::text) AND (to_tsvector('english'::regconfig, (message)::text) @@ '''sapient'''::tsquery))
               Rows Removed by Filter: 1088
         ->  Materialize  (cost=0.98..17.04 rows=1 width=27) (actual time=0.001..0.001 rows=1 loops=100)
               ->  Nested Loop  (cost=0.98..17.03 rows=1 width=27) (actual time=0.074..0.075 rows=1 loops=1)
                     ->  Index Scan using channels_pkey on channels  (cost=0.42..8.45 rows=1 width=27) (actual time=0.032..0.032 rows=1 loops=1)
                           Index Cond: ((id)::text = 'h1x9asxr7idjpqfmg8q67us49h'::text)
                           Filter: ((deleteat = 0) AND (((teamid)::text = '8ywxyw9ocp8smxrmjzrkqhrdwe'::text) OR ((teamid)::text = ''::text)))
                     ->  Index Only Scan using idx_channelmembers_user_id_channel_id_last_viewed_at on channelmembers  (cost=0.56..8.58 rows=1 width=27) (actual time=0.041..0.041 rows=1 loops=1)
                           Index Cond: ((userid = 'tc3p1yqw67d8idcp3g98awexqe'::text) AND (channelid = 'h1x9asxr7idjpqfmg8q67us49h'::text))
                           Heap Fetches: 1
         SubPlan 1
           ->  Aggregate  (cost=57.68..57.69 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=100)
                 ->  Index Only Scan using idx_posts_root_id_delete_at on posts  (cost=0.56..54.44 rows=1294 width=0) (actual time=0.009..0.009 rows=3 loops=100)
                       Index Cond: ((rootid = (CASE WHEN ((q2.rootid)::text = ''::text) THEN q2.id ELSE q2.rootid END)::text) AND (deleteat = 0))
                       Heap Fetches: 0
 Planning Time: 0.401 ms
 Execution Time: 31.466 ms
```

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

```release-note
NONE
```
2022-06-17 19:52:56 +05:30
Mattermod
3bd5690f4b Update latest version to 7.0.0 (#20469) 2022-06-14 17:34:52 +03:00
Mattermod
2a85fd6a81 Update latest version to 6.7.1 (#20464) 2022-06-14 14:07:16 +03:00
Mustafa Kara
c03eb778c8 Reflect alpine image change to fix build pipelines (#20449)
Signed-off-by: Mustafa Kara <mustafa.kara@mattermost.com>
2022-06-13 17:58:25 +03:00
Mattermod
91ffe24c14 Update latest version to 6.7.0 (#20219)
Automatic Merge
2022-05-18 17:39:55 +03:00
Agniva De Sarker
2c155cdc95 Makefile: Added setup-go-work to build step as well (#20193)
Without this, the go.work file would not get
generated in a fresh build.

```release-note
NONE
```
2022-05-12 14:08:39 +05:30
Claudio Costa
aee68c7ae4 [MM-44056] Make Calls plugin's state on Cloud controllable by feature flag (#20161)
* Make Calls plugin's state on Cloud controllable by feature flag

* Prepackage Calls v0.4.9 (#20148)

* Update app/plugin.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

* Update app/plugin_install.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

* Bump Calls version to latest

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-10 19:29:48 +02:00
Martin Kraft
d47a466a27 Bumps ES minor version. (#20117) 2022-05-10 08:31:44 -04:00
Agniva De Sarker
8358f92786 Update Dockerfile to 1.18.1 (#20138) 2022-05-05 12:59:52 +05:30
Mattermod
5cf721fdc0 Update latest version to 6.6.1 (#20090)
Automatic Merge
2022-04-28 18:57:06 +03:00
Mattermod
a98975b00f Update latest version to 6.6.0 (#19990)
Automatic Merge
2022-04-14 18:27:05 +03:00
Ossi Väänänen
67d57fc400 Pin the FROM in dockerfiles (#19526)
This prevents supply chain attacks where the latest image is replaced with a malicious version.

Pinning done by using https://github.com/Jille/dockpin
2022-03-31 15:22:20 +03:00
Mattermod
17ea088eb4 Update latest version to 6.4.1 (#19680)
Co-authored-by: Mmbot <mmbot@mattermost>
2022-03-03 13:44:19 +02:00
Agniva De Sarker
3f52bd197a GraphQL (part 2): Model changes and resolvers (#19486)
This PR adds the necessary resolvers to support
the graphQL front-end. Some additional methods
need to be added to the model structs to support
this. Comments have been made to clarify their purpose.

There is a slight duplication of code in the api layer.
But eventually that's going to go away when we move
away from the REST API entirely.

The schema is in api4/schema.graphqls and gets compiled
into the binary as an asset.

The GraphiQL editor url is at GET /api/v5/graphql.

Everything is behind the feature flag MM_FEATUREFLAGS_GRAPHQL.

```release-note
NONE
```
2022-02-11 12:37:05 +05:30
Josh Soref
294bd44971 [GH-19267] Spelling comments (#19268)
* spelling: comments

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-20 10:07:27 +05:30
Carlos Tadeu Panato Junior
36008ae412 fix mmctl download script when using as stand alone script (#19143) 2021-12-16 11:31:57 +01:00
Carlos Tadeu Panato Junior
c317254954 build: add mmctl to arm64 packages (#19090)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-03 15:37:37 +01:00
Carlos Tadeu Panato Junior
2865ad9221 Revert "DOPS-602: Change how mmctl gets packaged and locally fetched. (#18335)" (#18930)
This reverts commit 5ede63badc.
2021-11-03 14:54:34 +01:00
Elisabeth Kulzer
5ede63badc DOPS-602: Change how mmctl gets packaged and locally fetched. (#18335)
* DOPS-602: Change how mmctl gets packaged and locally fetched.
2021-11-02 14:45:02 +01:00
James Addison
8c4e6a85b3 Add .gitlab-ci.yml-compatible continuous integration configuration (#17844)
* Add .gitlab-ci.collabora.yml continuous integration configuration

* Relocate custom GitLab CI/CD configuration file to 'contrib' directory

* Fixup: .gitlab-ci.collabora.yml -> .gitlab-ci.yml

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-29 13:16:45 +02:00
Carlos Tadeu Panato Junior
fc712f5fdf default mm package to release 6.0.0 (#18667) 2021-10-18 13:48:55 +02:00
Carlos Tadeu Panato Junior
d074c3d20d fix package name typo (#18665) 2021-10-13 16:01:32 +08:00
Carlos Tadeu Panato Junior
e95e0e95a8 build: add targets for linux/darwin arm64 and include those in the package (#18491)
* build: add targets for linux/darwin arm64 and include those in the package

* update based on feedback

* store arm64 targets
2021-10-12 11:12:32 +02:00
Carlos Tadeu Panato Junior
5120097a02 build: set 600 permission to config.json when packagin the app (#18490) 2021-10-01 09:40:11 -05:00
Carlos Tadeu Panato Junior
f27f7bfe79 Update base container image from alpine 3.12 to 3.14 (#18450)
* update default mm package to 5.39.0

* update base container image from alpine 3.12 to 3.14
2021-09-23 17:36:05 +02:00
Claudio Costa
9534f9fb62 Update schemas to include new indexes (#18313)
* Update schemas to include new indexes

* Increase local usability of gitlab scripts. (#18314)

* Increase local usability of gitlab scripts.

* Fix loading/saving SQL dumps

* Add logging to schema tests.

* Fix adding logs dir.

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

Co-authored-by: Elisabeth Kulzer <elikul@elikul.de>
2021-09-01 09:00:49 +02:00
Joram Wilander
e9935e44bd Bump go.mod and docker go version to 1.16 (#18280)
* Bump go.mod go version to 1.16

* Bump docker build go version to 1.16.7
2021-08-27 08:08:03 -04:00
Mattermod
ddaa07e35f Update latest version to 5.38.1 (#18243)
Automatic Merge
2021-08-23 11:45:03 +02:00
Ben Cooke
ce081357e8 [MM-36445] Changing elastic search docker version (#18117)
* changing elastic docker version for testing

* fixing elastic issue

* temp dockerfile

* test

* removing command

* fixing dockerfile

* adding 7.0.0

* using elasticsearch 7

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
2021-08-18 11:26:05 -04:00
Devin Binnie
0dbaa48741 Change inbucket default port from 10080 to 9001 (#18145) 2021-08-18 09:31:25 -04:00
Martin Kraft
4db27ceda9 Switch to mysql/mysql-server docker image for ARM64 support. (#18137) 2021-08-16 09:23:21 -04:00
Carlos Tadeu Panato Junior
2982cc6f4e update mm server builder to use go 1.16.7 (#18107) 2021-08-10 18:53:35 +02:00
Mattermod
61e4e4d3fc Update latest version to 5.37.1 (#18058)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-08-04 17:47:07 +02:00
Elisabeth Kulzer
04ef406bd6 Increase mysql version of gitlab docker-compose. (#17982)
Automatic Merge
2021-07-22 14:05:02 +02:00
Agniva De Sarker
4968657651 MM-37034: Bump the MySQL min version to 5.7 (#17919)
* MM-37034: Bump the MySQL min version to 5.7

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

```release-note
Minimum required MySQL version is now 5.7
```

* fix shadow warnings

```release-note
NONE
```

* Bumped to 5.7.12

```release-note
NONE
```

* update comment

```release-note
NONE
```

* refactor

```release-note
NONE
```

* fix lint error

```release-note
NONE
```

* fix2

```release-note
NONE
```

* add tests

```release-note
NONE
```

* simplify

```release-note
NONE
```
2021-07-21 16:38:39 +02:00
Carlos Tadeu Panato Junior
959834aefa update mattermost server build to use go 1.16.6 (#17969)
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-07-21 11:19:28 +02:00
Emil Velikov
a78a7c7b54 Split package target into per platform (#17692)
Currently the `package` make target handles all three platforms -
Windows, OSX and Linux. While doing it in surprisingly serial mode.

Split it up in 3, so that things are a bit faster and people can package
only what they need.

v2: Rebase (platform was removed)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

Co-authored-by: Emil Velikov <emil.velikov@collabora.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-07-19 14:35:21 +02:00
Mattermod
4ad0193d0a Bump version (#17932)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-07-15 18:17:48 +02:00
Carlos Tadeu Panato Junior
eaa76e9529 go: upgrade builder image to use go1.16 (#17897)
* go: upgrade builder image to use go1.16
2021-07-14 13:39:19 +02:00
Elisabeth Kulzer
0765f27483 Enable e2e testing with docker-compose on GitLab (#17765)
* Make testing with docker-compose work on GitLab.

* Comment heavy jobs.

* Make testing with docker-compose work on GitLab.

* Comment heavy jobs.

* Fix images

* Addressing review.
2021-06-23 15:31:57 +02:00
Mattermod
71ef1c5386 Bump version (#17819)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-06-22 13:08:49 +02:00
Mattermod
d093e102a4 Bump version (#17790)
Automatic Merge
2021-06-16 16:10:22 +02:00
Mattermod
45550d4d2a Bump version (#17716)
Automatic Merge
2021-06-04 11:40:22 +02:00
Ibrahim Serdar Acikgoz
0e42613aef cmd: remove platform binary (#17712) 2021-06-04 10:32:50 +03:00
Claudio Costa
3681cd3688 [MM-32390] Config logic refactor (#17578)
* Replace config generator

* Cleanup

* Some renaming and docs additions to add clarity

* Cleanup logging related methods

* Cleanup emitter

* Fix TestDefaultsGenerator

* Move feature flags synchronization logic out of config package

* Remove unnecessary util functions

* Simplify load/set logic

* Refine semantics and add some test to cover them

* Remove unnecessary deep copies

* Improve logic further

* Fix license header

* Review file store tests

* Fix test

* Fix test

* Avoid additional write during initialization

* More consistent naming

* Update app/feature_flags.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Move FF synchronizer to its own package

* Remove unidiomatic use of sync.Once

* Add some comments

* Rename function

* More comment

Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2021-05-19 13:30:26 +02:00
Carlos Tadeu Panato Junior
fc75b72bba ci: upgrade inbucket (#17560) 2021-05-12 12:45:03 +02:00
Carlos Tadeu Panato Junior
c90c371fd4 build/package: remove dist/mattermost directory (#17601) 2021-05-11 12:23:25 +02:00
Carlos Tadeu Panato Junior
0cbfc58276 ci: update inbucket to use mattermost/inbucket:release-1.2.0 (#17559) 2021-05-03 15:24:51 +02:00
Jesús Espino
d2ed053b6b Add doc extraction dependencies (#17403)
Automatic Merge
2021-04-19 18:06:05 +02:00