Commit Graph

1364 Commits

Author SHA1 Message Date
Ben Sooraj
4b127cd877 Migrate tests from "store/storetest/reaction_store.go" to use testify (#12752)
* testReactionDelete

* testReactionSave

* testReactionGetForPost

* testReactionDeleteAllWithEmojiName

* testReactionStorePermanentDeleteBatch

* testReactionBulkGetForPosts

* `assert` to follow convention with first parameter as `t`

* using semantic assertions instead

* removing unnecessary empty lines
2019-10-21 16:19:47 +02:00
Harrison Healey
6ee681e50b Merge branch 'master' into mark-as-unread 2019-10-18 16:07:41 -04:00
Joshua Bezaleel Abednego
db97b49e7a store/storetest: migrate command_store.go to use testify (#12797)
* Modify the calls to t.Fatal to using require package

* Fixes according to suggestions
2019-10-17 10:45:40 -07:00
WonChul Heo
bbb7308124 [MM12767] - Migrate tests from "store/storetest/license_store.… (#12769) 2019-10-17 17:05:14 +02:00
aqche
54181e4015 Migrate tests from 'store/sqlstore/utils_test.go' to use testify (#12815) 2019-10-17 07:24:06 -07:00
Harrison Healey
e5dbd45f94 Merge branch 'master' into mark-as-unread 2019-10-17 09:44:32 -04:00
pqzx
1ad0cb646f Migrate tests from "store/storetest/session_store.go" to use t… (#12805) 2019-10-17 14:36:17 +02:00
Eli Yukelzon
66c66eef0d MM-19371 - Reply count disappears from pinned and flagged conv… (#12753) 2019-10-17 11:10:49 +03:00
Eli Yukelzon
4225977966 MM-19154 - Fix flaky test TestGroupStore/MySQL/GetGroups/Get_g… (#12705) 2019-10-16 12:55:36 +03:00
Jesse Hallam
5d45aa81e0 MM-16888: fix missing indexes (#12746)
* MM-16888: fix missing indexes

As part of https://mattermost.atlassian.net/browse/MM-16888, we discovered and fixed a number of column and index mismatches between the canonical (i.e. created from scratch) and migrated schemas (i.e migrated from 5.0 through 5.16).

Unfortunately, the migration to fix same was added to `UpgradeDatabaseToVersion514` but never cherry picked to the pending v5.14 release at the time. Customers who upgraded to v5.14 or v5.15 and then get this code as part of v5.16 will never run that migration. Copy it to the UpgradeDatabaseToVersion516 accordingly.

* avoid fixing ChannelMembers.SchemeGuest on MySQL

* synchronize .circleci/config.yml with scripts/mysql-migration-test.sh

* fix circleci invocation

* additional logging on diff

* update build/Jenkinsfile.pr too!
2019-10-15 15:47:09 -03:00
Harrison Healey
6a5b264624 Merge branch 'master' into mark-as-unread 2019-10-15 12:10:55 -04:00
Amine
d7d7216b0d Migrate tests from store/storetest/cluster_discovery_store.go to use testify (#12757) 2019-10-15 16:22:19 +02:00
Irzhy Ranaivoarivony
d97afa72cb MM-19352 - Migrated test in store/storetest/audit_store.go to… (#12739) 2019-10-15 09:10:40 -04:00
Nikhil Ranjan
c5dcd85bc8 Converting to structured logging the file store/sqlstore/upgrade.go (#12628)
* Converting to structured logging the file store/sqlstore/upgrade.go

* changes as per review
2019-10-14 12:55:50 +02:00
Harrison Healey
84714f5cff Merge branch 'master' into mark-as-unread 2019-10-11 16:09:00 -04:00
Witold Konior
38519e349f [MM-19356] Migrate tests from "store/storetest/system_store.go" (#12719)
* [MM-19356] Migrate tests from "store/storetest/system_store.go" to use testify

* retest
2019-10-11 15:45:10 +02:00
Eli Yukelzon
34b4bbcb46 MM-18623 - invalid reply-count displayed (#12364)
* fixed thread creator, fixed default behaviour of fetching posts
* handle reply-count in getPostThread code path
2019-10-10 17:14:44 +03:00
Harrison Healey
033a9a8cd5 Merge branch 'master' into mark-as-unread 2019-10-08 15:54:53 -04:00
Carlos Tadeu Panato Junior
ae3f112874 upgrade db to 5.16 (#12260)
* upgrade db to 5.16

* set current schema version
2019-10-08 09:32:51 +02:00
Harrison Healey
66da2bab2b MM-18463 Added update_badge notification when marking a channel as unread (#12499)
* MM-18463 Added update_badge notification when marking a channel as unread

* Address feedback
2019-10-07 09:58:39 -04:00
Harrison Healey
17d9cc224a Merge branch 'master' into mark-as-unread 2019-10-03 09:20:23 -04:00
Agniva De Sarker
20ff7032a6 Fixed some ineffective assignments (#12543) 2019-10-03 15:45:27 +03:00
Harrison Healey
047aa6a76e Merge branch 'master' into mark-as-unread 2019-09-30 16:39:24 -04:00
Jesús Espino
8cea561ba6 More robust team exists api endpoint (#12130)
* More robust team exists api endpoint

* Making the code more concise

* Better handling of errors on GetTeamByName
2019-09-30 21:39:21 +02:00
Martin Kraft
d82584a783 MM-18668: Fix for scan error selecting null SchemeGuest columns. (#12370) 2019-09-26 14:11:55 -04:00
Pavel Biryukov
af3ffeed1a Fix wrong error check (#12310) 2019-09-26 13:26:48 +02:00
Harrison Healey
67f57dd3e7 Merge branch 'master' into mark-as-unread 2019-09-25 09:06:45 -04:00
Jesús Espino
99f13ed0e6 Use seconds instead of nanoseconds for the store time layer metrics (#12321)
* Use nanoseconds instead of seconds for the api metrics

* Using seconds instead of nanoseconds in the store layer metrics
2019-09-24 20:00:19 +02:00
Marc Argent
d0a138a35e GH-12049 use structured logging (#12258) 2019-09-24 18:30:13 +02:00
Harrison Healey
e6f67c664c MM-17071 Add mention counting when marking a post as unread (#11966)
* Add different types for different mentions

* Remove redundant THREAD_ANY and THREAD_ROOT constants

* Make PostStore.Get return thread in order

* MM-17071 Add initial version of countMentionsFromPost

* MM-17071 Refactor comment mention counting

* MM-17071 Use mention counting when marking post as unread

* Fix shadowing in tests

* Remove repeated check of user count

* Refactor code using MentionType

* Update comments around -1 return value

* Move inner functions out of countMentionsFromPost

* Remove preconditions check as separate test case

* Update comments

* Add User.GetMentionKeys

* Revert "Make PostStore.Get return thread in order"

This reverts commit 22aa010cee.

* Fix tests

* Fix merge conflict

* Add store.MentionAllPosts
2019-09-19 10:10:10 -04:00
Harrison Healey
5f28ce9de0 Merge branch 'master' into mark-as-unread 2019-09-18 13:16:23 -04:00
Ben Schumacher
3323e7a619 [MM-17109] Bump model version to 5.16 (#12172)
* Bump model version to 5.16

* Make db schema version indipended of app version
2019-09-18 18:23:58 +02:00
Joram Wilander
3d4c941ba8 MM-18512 Use options struct for GetProfilesWithoutTeam and add filtering to API (#12200)
* Use options struct for GetProfilesWithoutTeam and add filtering

* Fix test
2019-09-17 20:13:17 +01:00
Eli Yukelzon
b3517eaf2f MM-17468 - Improving performance of fetching threads (#11980)
fetchThreads parameter support in the API
2019-09-17 14:37:10 +01:00
Martin Kraft
890a7c6985 MM-18522: Include edited posts in compliance export. (#12197)
* MM-18522: Export all post edits in compliance exports.

* MM-18522: Changes ordering of export query post results.
2019-09-13 18:18:06 -04:00
Nikhil Ranjan
d9fa46e0a2 Converting to structured logging the file store/sqlstore/post_… (#12087) 2019-09-12 21:02:14 -04:00
Jesús Espino
28cc7e7e36 Migrating roles and schemes to new Cache Layer (#11936)
* Migrating roles and schemes to new Cache Layer

* Adding missed license headers

* Updating cache tests

* Adding the cache layer to the testlib helper

* Fixing cyclic dependency

* fixing a bit of not-idiomatic error handling

* Another small fix arrount idiomatic error handling
2019-09-12 18:52:45 +02:00
Arjit Chaudhary
1076994773 Refactor "store/sqlstore/channel_member_history_store.go" to u… (#12059) 2019-09-11 07:33:47 -04:00
Claudio Costa
814c234443 [MM-18036] Sanitize sql LIKE terms on search endpoints (#12044)
* Sanitize sql LIKE terms on search endpoints

* Add search term sanitization in additional places
2019-09-11 10:56:12 +02:00
Harrison Healey
42e927cc3f Merge branch 'master' into mark-as-unread 2019-09-10 15:34:29 -04:00
jfrerich
1802c575e5 [MM-18119] Add methods for getting teams and count when query… (#12020)
* Add methods to handle include_total_count api parameter when permissions
for authenticated user is not sysadmin

* Add translations for app errors

* Add Mocks

* Add tests for new methods

* When running at the TeamStore testing level, the number of returned
teams is different than running tests individually.  Fix for now and
submit help wanted do proper teardown after each test

* correct value when running test at the top level

* Add helper function to delete previous teams in db

* Instead of checking against numbers of teams returned, check against the
actual teams returned.
When creating test teams, use unique DisplaName values so the return
array will be sorted consistantly.
When testing private and public team counts, add teams that should not
be counted.  Also create odd number of public/private teams for better
error protections.  Don't want 1 of each type
2019-09-10 11:50:27 -05:00
Nikhil Ranjan
9094aa7f97 Converting to structured logging the file store/sqlstore/supplier.go (#12089)
* Converting to structured logging the file store/sqlstore/supplier.go

* removed unused : from comments
2019-09-10 11:42:05 +02:00
Nikhil Ranjan
40b5db7637 Converting to structured logging the file store/sqlstore/session_store.go (#12088) 2019-09-10 10:39:55 +02:00
Nikhil Ranjan
f18895667d Converting to structured logging the file store/sqlstore/suppl… (#12090) 2019-09-10 09:40:55 +03:00
Carlos Tadeu Panato Junior
0ddc5f4a32 upgrade db to 5.15 (#11918) 2019-09-05 12:50:40 +02:00
Woolim Cho
b9a3c2e90e MM-10272: Add a count for pinned posts header icon (#11840) 2019-09-04 13:41:29 +02:00
Guillermo Vayá
3629f26bb9 [MM-17069]also unread the given post (#11932) 2019-09-02 10:00:38 +02:00
Claudio Costa
e1eb839636 Add integrity check command to CLI (#11599)
* Add integrity command

* Add structures and implementation for basic referential integrity check

* Use a channel to receive integrity check reports as they generates

* Setup unit testing

* Add confirm prompt to integrity command and make verbose output optional

* Add more integrity checks

* Use wrapper functions to simplify behaviour and tests

* Improve extensibility of IntegrityCheckResult

* Improve CheckIntegrity tests performance

* Use a config structure for relational integrity checks

* Add more relational integrity checks

* Add more checks and do some cleanup

* Add more relational integrity checks with proper tests

* Fix tests to use sync functions

* Add more info to integrity command help

* Add more relational integrity checks

* Add more relational integrity checks

* Add missing checks

* Show more information about missing records

* Fix to use new sync function

* Change integrity check functions to accept a SqlSupplier

* Fix code duplication

* Use squirrel for query building
2019-08-30 09:44:55 -03:00
Harrison Healey
704741ce3b Merge branch 'master' into mark-as-unread 2019-08-22 09:43:56 -04:00
Gervasio Marchand
11b0a20d7d MM-16821 - Add a KVCompareAndDelete to the plugin API (#11804)
* Implement KVCompareAndDelete and KVCompareAndDeleteJSON

* Add tests for KVCompareAndDelete

* Update minimum server version

* Handle nil value on CompareAndSet so that it deletes it

* Fix comments

* Tweaks from PR comments

* Go back to deleted, err
2019-08-21 23:25:38 -03:00