Commit Graph

12262 Commits

Author SHA1 Message Date
catalintomai
59e92e9ae1 MM-4887: Remove back to MM button for Zapier-MM OAuth integration setup (#13890)
* MM-4887: Remove back to MM button got Zapier OAuth setup

* MM-4887: remove Zapier dependency

Co-authored-by: Catalin Tomai <catalin.tomai@mattermost.com>
2020-03-30 11:19:15 -07:00
Jesse Hallam
f149ada16a MM-23261 plugin stderr debug logs (#14166)
* explicitly assert panic as error log

* Revert "[MM-18150] plugin panic trace should not be lost (#13559)"

This reverts commit 5d928b4f94, while leaving the unit tests intact
and now asserting debug logs instead.

* missing license header
2020-03-30 15:00:45 -03:00
Jesús Espino
383e45b13d Adding correctness in the ReplyCount generation (#14047)
* Adding correctness in the ReplyCount generation

* Applying suggestion from reflog

* More reliable reply count generation

* Some tests fixed

* Adding i18n translation

* Fixing reply count on save behavior

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-30 19:30:30 +02:00
Miguel de la Cruz
4fe25b1cdd [MM-21551] Add search tests structure to test the search engines (#14031)
* WIP

* Adding bleve to go modules

* WIP

* Adding missing files from searchengine implementation

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* User and channel indexing and searches implemented

* Make bleve tests run with in-memory indexes

* Implement post index and deletion tests

* Initial commits for the search layer

* Removing unnecesary indexing

* WIP

* WIP

* More fixes for tests

* Adding the search layer

* Finishing the migration of searchers to the layer

* Removing unnecesary code

* Allowing multiple engines active at the same time

* WIP

* Add simple post search

* Print information when using bleve

* Adding some debugging to understand better how the searches are working

* Making more dynamic config of search engines

* Add post search basics

* Adding the Purge API endpoint

* Fixing bleve config updates

* Adding missed file

* Regenerating search engine mocks

* Adding missed v5 to modules imports

* fixing i18n

* Fixing some test around search engine

* Removing all bleve traces

* Cleaning up the vendors directory and go.mod/go.sum files

* Regenerating timer layer

* Adding properly the license

* Fixing govet shadow error

* Fixing some tests

* Fixing TestSearchPostsFromUser

* Fixing another test

* Fixing more tests

* Fixing more tests

* Removing SearchEngine redundant text from searchengine module code

* Fixing some reindexing problems in members updates

* Fixing tests

* Addressing PR comments

* Reverting go.mod and go.sum

* Addressing PR comments

* Fixing tests compilation

* Fixing govet

* Adding search engine stop method

* Being more explicit on where we use includeDeleted

* Adding GetSqlSupplier test helper method

* Mocking elasticsearch start function

* Fixing tests

* Search tests

* Fix tests

* Fix mod

* Fixing searchEngine for test helpers with store mocks

* Remove loglines

* Fix i18n strings

* Migrate search posts tests

* Fix linter

* Do not run search tests if -short flag is enabled

* Migrate back store tests that didn't belong to the searchlayer

* Fix scopelint issues

Co-authored-by: Jesús Espino <jespinog@gmail.com>
2020-03-30 19:17:40 +02:00
Agniva De Sarker
2b1b001bcc MM-23503: Fix race in websocket_client writer (#14160)
* MM-23503: Fix race in websocket_client writer

We create a separate writer goroutine where all the writes happen.

* Fixing the case of double close

* Incorporate review comments

* Use CAS

* Fix incorrect comment

* Check if client is closed in pingHandler too

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-30 21:09:52 +05:30
Hossein Ahmadian-Yazdi
bd2c1f4522 [MM-21517] Team Member Manage User Modal not display correct roles (#14043)
* join on the users table and order by username

* don't inclue users who have been deleted

* Address PR comments

* update tests

* fix linting

* fix linting

* include ExcludeDeletedUsers flag

* fix gofmt

* fix nil teamMembersGetOptions

* fix gofmt error

* Add Unit Tests

* fix gofmt bugs

* partially address comments

* fix incorrect import

* Address Comments and fix golint errors

* store mocks

* address PR comments about tests and styling

* Update model/team_member.go

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

* Address PR comments

* update client function name

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-03-30 10:48:03 -04:00
Agniva De Sarker
7ce68e89d7 MM-22044: Fix panic on web_conn send hello (#13799)
* MM-22044: Fix panic on web_conn send hello

(*Hub).Start is the central place for sending all web connection
related traffic. However, there was this one call to (*WebConn).Hello
which tried to send a message to a webconn separately.

This was a rare case, but it did occur under stress conditions generated
from a load test.

When the websocket send SEND_QUEUE_SIZE would get filled up and we would
attempt to make a broadcast, the non-blocking send would close the Send
channel of the web connection. During that time, if a web connection
would try to perform a broadcast, it would try to send to a closed channel
and cause a panic.

The solution is to bring back the sending of hello into the same goroutine
inside (*Hub).Start so that all state is centralised and we avoid
sending to a closed channel by sending the hello message inside the registering
code itself.

* Adding non-blocking send

* Simplify things

* Remove test

* Bring sendHello back

* Improve code further

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-30 18:12:40 +05:30
Juho Nurminen
f29d8ad098 Checkout webapp over HTTPS for CircleCI (#14172) 2020-03-30 11:01:35 +03:00
Agniva De Sarker
b754fdb3e1 MM-23460: Reuse a single HTTP client across all push notifications (#14122)
Before this, for every single request we would create a new http.Client
from scratch. This was costly because every new client has internal
TCP connections which it reuses.

Therefore, originally, beyond a throughput of 800-1200 rps with a
concurrency of 50, beyond which it would run out of file descriptors.

Now it can support upto 8000-10000 rps.
An improvement by a factor of 10.

Throughput numbers:
BenchmarkPushNotification
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 11445.091601 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9190.761518 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 8334.394764 reqs/s
BenchmarkPushNotification-8   	     219	   5999304 ns/op	 3369224 B/op	   42127 allocs/op
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9590.399780 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9347.137463 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9053.784250 reqs/s
BenchmarkPushNotification-8   	     223	   5522636 ns/op	 3368470 B/op	   42034 allocs/op
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 10250.783365 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9123.292899 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9173.553180 reqs/s

This is the aggregate count using benchstat.
The number is for a single run of sending 50 requests.

name                time/op
PushNotification-8  5.61ms ± 7%

name                alloc/op
PushNotification-8  3.36MB ± 1%

name                allocs/op
PushNotification-8   42.0k ± 1%

Tested on a machine with ulimit -n = 4096.
2020-03-28 09:33:38 +05:30
Agniva De Sarker
47e493ea82 MM-23567: Remove goroutines from session_store.go (#13955)
* Remove goroutines from session_store.go

There isn't much benefit of running these 2 queries concurrently
versus just serially. These queries are not in the hot path anyways.
Maybe just simpler to keep it serial.

* Incorporate review comments
2020-03-27 22:37:20 +05:30
Jesús Espino
9a531fa0fb Removing some unneded FakeApp instance (#14139) 2020-03-27 14:52:57 +01:00
Jesús Espino
cfe65a33a5 Team/Channel members bulk save/update/delete (#14053)
* Members Save Multiple

* Multiple Channel Members implemented

* Working version with member multi save and multi update

* Adding tests to the save multiple team members store methods

* Tests passing for SaveMember

* Adding remove members tests

* Working on channel store tests

* More work on testing properly SaveMember and SaveMultipleMembers on channels

* More work on testing properly SaveMember and SaveMultipleMembers on teams

* Adding tests for update multiple members for team

* Adding tests for update multiple members for channel

* Fixing some tets

* Fixing tests

* Fixing tests

* Fixing i18n

* Addressing govet problems

* Addressing govet problems

* Addressing govet problems

* Addressing govet problems

* Addressing PR comments (and removing TODO)

* Addressing PR comments

* Fixed broken test

* Removing unnecesary i18n translation string
2020-03-27 13:29:17 +01:00
Jesús Espino
d2848cc167 Fixing race condition on status serialization (#14147)
* More atomic serialization process for status

* Improving the granularity of tests on api4/status_test.go
2020-03-27 11:40:52 +01:00
Martin Kraft
d92cfc851a MM-23606: Fix role cache invalidation. (#14156)
* MM-23606: Fix role cache invalidation.

* MM-23606: Adds cache invalidation to delete scheme method.

* MM-23606: Clear the roles permissions cache when the CLI resets permissions system.

* MM-23606: Removes comment and duplicate cache clear.
2020-03-26 14:17:40 -04:00
Juho Nurminen
d1ab17fa7c Update depcheck alert messages (#14163)
Automatic Merge
2020-03-26 07:13:25 -07:00
Someone
b12670c583 [GH-13968] Add "skip_slack_parsing" to PostActionIntegration… (#13976) 2020-03-26 14:27:55 +01:00
Agniva De Sarker
8812de2bf0 MM-23254: Add nil checks to WebSocketEventFromJson (#14050)
Automatic Merge
2020-03-25 21:43:25 -07:00
Miguel de la Cruz
11debb55a6 [MM-23510] Avoid race condition searching post's channel by channel id instead of post id (#14154) 2020-03-25 23:50:11 +01:00
Ths2-9Y-LqJt6
c4701394d3 MM-7881 non-case sensitive username notifications off by default (#13851)
Automatic Merge
2020-03-25 09:43:25 -07:00
Elisabeth Kulzer
0340eb466f IS-364: Bump golang build image. (#14134)
* IS-364: Bump Golang CI.

* Fix test failure

* Fix readme

* Update build/README.md

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-03-25 12:36:06 +01:00
Alejandro García Montoro
aa47b4633f MM-23508: Fix plugin API's GetPostsForChannel (#14125)
Add a test checking the basic behaviour of the function
2020-03-25 10:24:42 +01:00
Juho Nurminen
190631b6e1 Suppress CVE-2020-10675 (#14132)
Automatic Merge
2020-03-25 01:43:25 -07:00
Agniva De Sarker
bf3c2c0ce6 MM-23369: Allow mysql to choose a better index (#14119)
* MM-23369: Allow mysql to choose a better index

When the ORDER BY clause contains a column which is in the WHERE
clause and also part of an index, mysql tries to use that specific
index to avoid sorting. This is inspite of the fact that
there may be other indices which are better for scanning the table
and then doing a sort.

Essentially, mysql becomes dumb and scans a lot of rows to avoid
sorting. Whereas, it could have scanned a lot less rows and do the
sorting in no time.

To fix this, we use the other columns in the ORDER BY clause as well
which are part of the index. This causes no change in the results
because the other columns are an EQUAL condition check, but this
lets mysql use the right index. Because now mysql sees that it has
to order by other columns too, so it better use the other index
to scan and then do the sorting.

This does not affect tables of smaller size because the LIMIT of
rows is always 1. And mysql will stop sorting the moment it gets
the first row. So sorting is not the overhead at all.
Therefore, this seems like an optimal fix.

References:
https://dev.mysql.com/doc/refman/5.7/en/table-scan-avoidance.html
https://code.openark.org/blog/mysql/7-ways-to-convince-mysql-to-use-the-right-index
https://dev.mysql.com/doc/refman/5.7/en/limit-optimization.html

* Added a comment to clarify things in code

* Incorporating review comments
2020-03-25 12:39:04 +05:30
Agniva De Sarker
32b7f477bf MM-23211: Fix user not being notified in out of channel mentions (#14097)
Automatic Merge
2020-03-24 13:43:25 -07:00
Elisabeth Kulzer
6c6a64c103 Revert "IS-364: Bump Golang CI. (#14123)" (#14133)
This reverts commit 81d6ae2207.
2020-03-24 14:01:49 +01:00
Elisabeth Kulzer
81d6ae2207 IS-364: Bump Golang CI. (#14123)
IS-364: Bump Golang CI.
2020-03-24 08:45:26 +01:00
Juho Nurminen
28a7993ac9 MM-22889: Integrate Dependency-Check to CircleCI (#14023)
* Add basic dependency-check job

* Include summary in alert

* Link to NVD

* Move the alert script to a separate file
2020-03-24 09:19:41 +02:00
Martin Kraft
4d99aa22ba MM-22212 & MM-22208: Read from the higher-scoped scheme if the permission is non-moderated. (#13813)
* MM-22212: Read non-moderated permissions from higher-scoped scheme.

* MM-2212: Corrects test count in comment.

* MM-22212: Adds godoc comment.

* MM-2212: Switches to the channel roles check in a few more places.

* MM-22212: Refactors and fixes.

* MM-22212: Reverts change, no longer required.

* MM-22212: Removes translation.

* MM-22212: Un-comments merged new permission.

* MM-22212: Un-comments merged new permission.

* MM-22212: Performance tweak.

* MM-22212: Fixes some fmting.

* MM-22212: Add unit test for newly-added store methods.

* MM-22212: Renames app method.

* MM-22212: Re-uses existing function to find string in slice.

* MM-22212: Keeps 'higher-scoped' terminology for consistency.

* MM-22212: Refactors based on PR feedback.

* MM-22212: Fix for some bad merging.

* MM-22212: Renamed some things.

* MM-22212: Use an 'else' instead of a 'continue' for readability.

* MM-22212: Caches (*SqlRoleStore).ChannelRolesUnderTeamRole.

* MM-22212: Adds mock to new cache store.

* MM-22212: Adds missing open tracing app layer methods.

* MM-22212: Adds migration to add moderated permissions to channel_admin if present on channel_user.

* MM-22212: Migrates team schemes. Removes unused AppError.

* MM-22212: Fix for for if.

* MM-22212: Fixes iterator.

* MM-22212: Updates open tracing generated methods.

* MM-22212: Fix mocks.

* MM-22212: Change migration key name.

* MM-22212: Switched to data structure from other branch.

* MM-22212: Fixes tests after adding 'use_channel_mentions' to the channel_admin role.

* MM-22212: Adds tracking of channel moderation.

* Revert "MM-22212: Adds tracking of channel moderation."

This reverts commit 23689efa22.

* MM-22212: Switch some functions to methods and vice versa.

* MM-22212: Fix for refactor bug not notifiying websocket about changed role.

* MM-22212: Adds test for public/private 'manage_members' handling.

* MM-22122 Fix manage channel members edge case for public and private channels (#14049)

* MM-22212: Adds moderated permission to team_admin.

* MM-22212: Updates migration.

* MM-22212: Revert unnecessary update to default roles.

* Add channel scheme updated event when channel scheme is deleted or created (#14057)

* MM-22212: Adds newline.

* MM-22212: Migration fix.

* MM-22212: Fix for migration.

* MM-22212: Test fix.

Co-authored-by: Farhan Munshi <3207297+fm2munsh@users.noreply.github.com>
2020-03-23 13:44:20 -04:00
Allen Lai
ace46443b3 MM-21343: Recognize multi-line slash commands without requiring trailing space after trigger word (#13646)
* change how we are parsing the args.command

* change comment

* atttempt to write unit test

* remove quotes

* use unicode.IsSpace

* MM-21343 fix panic

* use table

* test cases

* bad request, add test for missing '/'

* mispelled err

* Update app/command.go

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

* Update app/command.go

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

* use a map

* use subtest and add test case of empty command

* go fmt

* do not use t.fatal

* Update app/command.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* fix missing unicode import

Co-authored-by: wiggin77 <wiggin77@warpmail.net>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2020-03-23 14:38:21 -03:00
Sven Hüster
37ac6654f6 add support for exporting and importing props (#14034)
* add support for exporting and importing props

* merge master

* add export test for post props

* add check if postData exists

* add import tests for post props

* fix ci bot issues

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* fix gofmt errors

* remove test comment and add name instead

* remove uneccessary changes

Co-authored-by: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2020-03-23 09:21:05 -04:00
Jesse Hallam
b718618fbc Minor model/config.go coverage improvements (#14094)
* add TestConfigEnableDeveloper

* remove dead code
2020-03-20 16:34:12 -03:00
Farhan Munshi
911e636ec3 [MM-22368] Log Channel Moderation events (#14042)
* MM-22368 Log Channel Moderation events

* Modify wording

* Use structured fields

* Update app/channel.go
2020-03-19 19:31:18 +05:30
Mario de Frutos Dieguez
010dac2195 Improve the error message when hub is almost full (#14021)
Improve the error message when hub is almost full
2020-03-19 12:57:58 +01:00
Miguel de la Cruz
1c06d25d9d [MM-22167] Add mmctl to the User-Agent parser (#13894) 2020-03-19 11:18:17 +01:00
Agniva De Sarker
3e2175f897 MM-23276: Refactor push notifications (Part 1) (#14059)
Automatic Merge
2020-03-18 09:58:59 -07:00
Doug Lauder
16b535314d MM-23222 mirror audit logs to file (#14062)
* MM-23222 add file target (with rotation) to audit

* MM-23222 mirror syslog audits to local filesystem

    * provides config options for file name, max size, max age

    * rotates files based on max size and max age; delete as needed based on max backups

* include cluster id in log records

* sort meta data fields
2020-03-17 16:12:56 -04:00
Devin Binnie
1cde88f147 Setting to enable new experimental channel sidebar (#14036)
* Merge upstream

* [MM-20881] Server changes for new experimental channel sidebar setting (#13434)

* Remove report.xml

Co-authored-by: Jason Deland <jaydeland@gmail.com>
Co-authored-by: Devin Binnie <devin@Devins-MacBook-Pro.local>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-17 12:01:59 -04:00
Agniva De Sarker
d0d6125541 MM-2276: Fix flaky TestPlugin in cmd/mattermost/commands (#14064)
There was a race in (*App).SyncPlugins where if the same plugin
existed in availablePlugins and pluginSignaturePathMap, then
we would try to add/remove at the same time.

This would lead to a possible removal / addition of a plugin directory
or even unable to remove a directory because it was already in use.

We fix this by first finishing the removal of availablePlugins
before syncing it with the file store.
2020-03-17 21:26:59 +05:30
Martin Kraft
dd0b0a3d67 MM-22153: Adds tracking of channel moderation. (#14095)
* MM-22153: Adds tracking of channel moderation.

* MM-22153: Fixes test setup.

* MM-22153: Split role constants into scope and type.
2020-03-17 11:09:37 -04:00
Ibrahim Serdar Acikgoz
4823b3861a [MM-22791] Prevent account creation if new user does not have allowed domain for the team (#14012)
* app/user: prevent user creation for restricted domains for a team

* app/user_test: add error message checks to CreateUserWithInviteId
2020-03-17 17:23:59 +03:00
Agniva De Sarker
42081a1441 Remove unncessary recover() calls (#14066)
* Remove unncessary recover() calls

A recover which is not called inside a defer will always return nil.
So there's no use of calling it.

And even if we did call it inside a defer, recovering and immediately
panicking does not make sense either. So we just remove it.

* Fixed another instance
2020-03-17 11:04:39 +00:00
Patryk Pomykalski
9369d65441 Optimize reactions table (#13406)
* Optimize reactions table

Change reactions primary key to (PostId, UserId, EmojiName) so fetching
reactions for post will use primary key lookup instead of table scan.

* fix db version

* review fixes

* update database schema in scripts/
2020-03-17 10:53:31 +01:00
Gabriel Sagula
a1719e9fcf MM-22707: improved image upload tests and logging (#14018)
* improved image upload tests and error logging message

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* removed unecessary logging message

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* fixed null ptr issue

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* rolled back pointer to the client

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* added hexdump of the previewer file

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* fixed tests that use the renamed files

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* addressed reviewer notes

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

* addressed reviewer concerns

Signed-off-by: Gabriel Linden Sagula <gsagula@gmail.com>

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-17 10:20:29 +05:30
Agniva De Sarker
1c498996a4 MM-23221: Fix getAllTeams handler returning null (#14045)
Automatic Merge
2020-03-16 10:28:59 -07:00
Agniva De Sarker
f42d3c83f3 MM-22710: Bump golangci to 1.23.6 (#13948)
* MM-22710: Bump golangci to 1.23.6

This is to prepare the codebase for 1.14 shift.

1.23.6 has some fixes which is necessary for a codebase using Go 1.14.

* Remove golangci service

The service is getting shut down.
https://medium.com/golangci/golangci-com-is-closing-d1fc1bd30e0e

* Remove unneeded comment

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-16 22:46:32 +05:30
Agniva De Sarker
a9415aff6f MM-22560: Fix crash during slack import (#14054)
* MM-22560: Fix crash during slack import

We were not checking for existence of the users map value
before accessing the Id field. We fix it by checking for
nil pointer first.

Also, we check the length of the Members slice to prevent range
panics.

And finally, while we are here, we move to a switch-case
to make the code a little more idiomatic.

* Adding warn logs when user not found

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-16 21:52:06 +05:30
Jesús Espino
63ed67e42e Improving mfa tests coverage and format (#13978)
* Improving mfa tests coverage and format

* Adding assertions for the specific error types

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-16 13:17:44 +01:00
Claudio Costa
1e53fe85ad [MM-21378] Add mutex to model.Post to guard against race conditions on Post.Props (#13884)
* Add mutex to model.Post to guard against race conditions on Post.Props

* Rename mutex

* Add GetProp() method to Post

* Fix more tests

* Fix flaky test

Benchmarks:

BenchmarkPostPropsGet_indirect
BenchmarkPostPropsGet_indirect-2     	85026746	        13.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_indirect-4     	90273747	        13.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_indirect-8     	88324293	        13.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_indirect-16    	91427720	        13.1 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_direct
BenchmarkPostPropsGet_direct-2       	1000000000	         0.242 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_direct-4       	1000000000	         0.241 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_direct-8       	1000000000	         0.240 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsGet_direct-16      	1000000000	         0.241 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsAdd_indirect
BenchmarkPostPropsAdd_indirect-2     	 5602224	       203 ns/op	     336 B/op	       2 allocs/op
BenchmarkPostPropsAdd_indirect-4     	 5959496	       206 ns/op	     336 B/op	       2 allocs/op
BenchmarkPostPropsAdd_indirect-8     	 5833999	       205 ns/op	     336 B/op	       2 allocs/op
BenchmarkPostPropsAdd_indirect-16    	 5802493	       225 ns/op	     336 B/op	       2 allocs/op
BenchmarkPostPropsAdd_direct
BenchmarkPostPropsAdd_direct-2       	100000000	        11.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsAdd_direct-4       	100000000	        11.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsAdd_direct-8       	100000000	        11.6 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsAdd_direct-16      	99840794	        11.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsDel_indirect
BenchmarkPostPropsDel_indirect-2     	18824002	        61.9 ns/op	      48 B/op	       1 allocs/op
BenchmarkPostPropsDel_indirect-4     	19470736	        63.8 ns/op	      48 B/op	       1 allocs/op
BenchmarkPostPropsDel_indirect-8     	17640460	        65.3 ns/op	      48 B/op	       1 allocs/op
BenchmarkPostPropsDel_indirect-16    	18692962	        65.4 ns/op	      48 B/op	       1 allocs/op
BenchmarkPostPropsDel_direct
BenchmarkPostPropsDel_direct-2       	516257440	         2.34 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsDel_direct-4       	514865216	         2.43 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsDel_direct-8       	511330477	         2.37 ns/op	       0 B/op	       0 allocs/op
BenchmarkPostPropsDel_direct-16      	499504010	         2.38 ns/op	       0 B/op	       0 allocs/op
2020-03-13 21:12:20 +01:00
Ben Schumacher
9e580361c2 Enable codecov comments (#14022)
* Enable codecov comments

* Drop unneeed comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 18:35:31 +01:00
Jesús Espino
c66e182b08 Adding the new search engine abstraction (#13304)
* WIP

* Adding bleve to go modules

* WIP

* Adding missing files from searchengine implementation

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* User and channel indexing and searches implemented

* Make bleve tests run with in-memory indexes

* Implement post index and deletion tests

* Initial commits for the search layer

* Removing unnecesary indexing

* WIP

* WIP

* More fixes for tests

* Adding the search layer

* Finishing the migration of searchers to the layer

* Removing unnecesary code

* Allowing multiple engines active at the same time

* WIP

* Add simple post search

* Print information when using bleve

* Adding some debugging to understand better how the searches are working

* Making more dynamic config of search engines

* Add post search basics

* Adding the Purge API endpoint

* Fixing bleve config updates

* Adding missed file

* Regenerating search engine mocks

* Adding missed v5 to modules imports

* fixing i18n

* Fixing some test around search engine

* Removing all bleve traces

* Cleaning up the vendors directory and go.mod/go.sum files

* Regenerating timer layer

* Adding properly the license

* Fixing govet shadow error

* Fixing some tests

* Fixing TestSearchPostsFromUser

* Fixing another test

* Fixing more tests

* Fixing more tests

* Removing SearchEngine redundant text from searchengine module code

* Fixing some reindexing problems in members updates

* Fixing tests

* Addressing PR comments

* Reverting go.mod and go.sum

* Addressing PR comments

* Fixing tests compilation

* Fixing govet

* Adding search engine stop method

* Being more explicit on where we use includeDeleted

* Adding GetSqlSupplier test helper method

* Mocking elasticsearch start function

* Fixing tests

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 15:33:18 +01:00