summaryrefslogtreecommitdiffstats
path: root/store/storetest
Commit message (Collapse)AuthorAgeFilesLines
* MM-11886: materialize channel search (#9349)Jesse Hallam2018-09-134-607/+826
| | | | | | | | | | | | | | | | | | | | | | | | * materialize PublicChannels table Introduce triggers for each supported database that automatically maintain a subset of the Channels table corresponding to only public channels. This improves corresponding queries that no longer need to filter out 99% DM channels. This initial commit modifies the channel store directly for easier code reviewing, but the next wraps an experimental version around it to enable a kill switch in case there are unforeseen performance regressions. This addresses [MM-11886](https://mattermost.atlassian.net/browse/MM-11886) and [MM-11945](https://mattermost.atlassian.net/browse/MM-11945). * extract the experimental public channels materialization Wrap the original channel store with an experimental version that leverages the materialized public channels, but can be disabled to fallback to the original implementation. This addresses MM-11947. * s/ExperimentalPublicChannelsMaterialization/EnablePublicChannelsMaterialization/ * simplify error handling * move experimental config listener until after store is initialized
* MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337)Jesús Espino2018-09-112-0/+103
|
* Merge release-5.3Carlos Tadeu Panato Junior2018-09-101-2/+2
|\
| * Speed up search results post selection. (#9380)Christopher Speller2018-09-101-2/+2
| |
* | Merge remote-tracking branch 'upstream/release-5.3' into ↵cpanato2018-09-041-0/+6
|\| | | | | | | release-5.3-daily-merge-20180904
| * MM-11728: Avoid Archived channels editions throught Patch (#9335)Jesús Espino2018-09-031-0/+6
| |
* | add megacheck as makefile target (#9288)Daniel Schalla2018-09-038-33/+33
|/ | | | | | | | | | | | | | | | | | | | | | | | | Fix code issues in channel_test.go Fix Channel Test Issues detected by Megacheck Fix API Emoji Test Issues detected by Megacheck Fixed API Issues Reported by Megacheck Fixed App issues reported by megacheck Remaining fixes removed test added by mistake from old HEAD gofmt Store Fixes simplified returns Fix test for multi member channel delete revert to delete unused function
* MM-11572: Force correct order on messages generated in the bulk (#9244)Jesús Espino2018-08-241-0/+16
|
* MM-11348: Add telemetry for advanced permissions. (#9249)George Goldberg2018-08-232-0/+78
|
* avoid t.Fatal() in tests (#9189)Jesse Hallam2018-08-095-64/+24
| | | | | | I've been burned a few times by tests that simply fatal, requiring me to run another build to learn more about what the mismatch was. Avoid this. This is part of a long running goal of mine to make testing "better".
* MM-11384: Add system install date information to the client config (#9218)Jesús Espino2018-08-0830-38/+54
| | | | | | | | * MM-11384: Add system install date information to the client config * Fixing translation text * Fixes from Peer Review
* MM-11521/MM-11522 Fix being able to create users with invalid emails through ↵Harrison Healey2018-08-0110-156/+168
| | | | | | | | | | | | | | API (#9199) * MM-11522 Fix being able to create users with invalid emails through API * Ensure store tests are using valid emails * Add missing license header * Remove invalid test case * Fix TestUpdateOAuthUserAttrs
* Pr 9039 (#9187)Martin Kraft2018-07-303-94/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-11065: Allow to search and get archived channels from the API * Fixing more tests * Add some unit tests * Add includeDeleted parameter to session permissions check function * More test fixing * Adding archive channels list in channels search * Add restriction for archived channel edition * Reverting permissions checks modification * Changed the query parameter to include_deleted * Enable search archive channels as true by default * Adding tests for verify search on deleted channels * Allowing to override archive channels during the imports * Fixed test * Search in archive channels from the API must be explicitly requested * Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam * Back to ViewArchivedChannels config * Fixing tests * Reverting GetChannelByName parameter * Add include deleted parameter on GetChannel functions in plugins api * Fixing tests
* added the custom icon and username for the outgoing webhook and its response ↵Pradeep Murugesan2018-07-251-0/+7
| | | | | | | | | | | | (#9141) * 8272 added the username and icon as part of the model and persisted the same * 8272 added the custome icon and name when set to the web hook response * 8272 changed the infinte loop to timeout after 5 seconds * 8272 fixed review comments
* Ignore | characters in postgres channel search (#9019)Joram Wilander2018-06-301-0/+13
|
* add MaxLifetimeconns to server (#9004)Jerry Kurian2018-06-281-9/+11
| | | | | | | | | | | | | | | | | | | | | Update e.json string names and remove console log reorder variables update db.setConnMaxLifetime to take in *settings.MaxLifetimeConns Add MaxLifetimeConns to test Update variable names like MaxLifetimeConns to ConnMaxLifetimeMilliseconds Update time passed to SetConnMaxLifetime Revert "Update time passed to SetConnMaxLifetime" This reverts commit dc1c1b6d5a6404d4ee11c65d4756c19f9316794f. update en.json Update supplier_test.go and docker.go ConnMaxLifetimeMilliseconds to 3600000
* Lock bulk importing to master database node (#9012)Joram Wilander2018-06-274-0/+32
|
* Add Purpose as a searchable field (#8067)Chris Duarte2018-06-261-0/+42
| | | | | | | | | | * Add Purpose as a searchable field * Add New Index and Remove old for Channels * Include Purpose in FullTextSearch Clause * Move removeIndex for Channels into upgrade.go
* Implementation of File Exists Function; Delete FileInfos upon Permanent User ↵Daniel Schalla2018-06-252-0/+97
| | | | | | | Delete (#8958) Check if file was deleted on FS Warning message if file couldnt be removed
* MM-10570: Make permissions reset command clear custom role assignments. (#8976)George Goldberg2018-06-256-1/+204
|
* MM-10233: Add scheme importing to bulk importer. (#8928)George Goldberg2018-06-2131-31/+129
|
* MM-10412: Adds deleteBy prop to posts. (#8896)Martin Kraft2018-06-012-9/+17
|
* MM-10757: Default roles from scheme should be keyed by name not ID. (#8894)George Goldberg2018-06-012-12/+44
| | | | | | * MM-10757: Default roles from scheme should be keyed by name not ID. * Update permissions import/export.
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-241-0/+18
|\
| * MM-10649: soften Channels.ExtraUpdateAt deprecation (#8843)Jesse Hallam2018-05-231-0/+18
| | | | | | | | | | | | | | | | The previous complete removal of this field resulted in an incompatibility with 4.x servers that could not handle the now null column field. Instead, ensure this field is at least always set to 0, with a plan to remove it altogether in a future release.
* | Fix tests.George Goldberg2018-05-183-0/+4
| |
* | MM-10264: Adds CLI command to import and export permissions. (#8787)Martin Kraft2018-05-173-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-10264: Adds CLI command to import and export permissions. * MM-10264: Changes Scheme Name to DisplayName and adds Name slug field. * MM-10264: Changes display name max size. * MM-10264: Another merge fix. * MM-10264: Changes for more Schemes methods checking for migration. * MM-10264: More updates for Schemes migration checking.
* | MM-10235: Make permissions reset CLI shcemes-aware. (#8773)George Goldberg2018-05-178-0/+207
| | | | | | | | | | | | * MM-10235: Make permissions reset CLI shcemes-aware. * Add i18n strings.
* | MM-10615: Reset teams/channels to default scheme on delete scheme. (#8811)George Goldberg2018-05-171-2/+12
| |
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-151-33/+0
|\|
| * MM-9739: deprecate the now unused Channels.ExtraUpdateAt (#8762)Jesse Hallam2018-05-141-33/+0
| |
* | MM-9728: Online migration for advanced permissions phase 2 (#8744)George Goldberg2018-05-144-0/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9728: Online migration for advanced permissions phase 2 * Add unit tests for new store functions. * Move migration specific code to own file. * Add migration state function test. * Style fixes. * Add i18n strings. * Fix mocks. * Add TestMain to migrations package tests. * Fix typo. * Fix review comments. * Fix up the "Check if migration is done" check to actually work.
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-1130-76/+38
|\|
| * MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID ↵Christopher Speller2018-05-1030-76/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | without losing their account (#8756) * Adding LoginIdAttribute * Modifying LDAP to use loginIDAttribute. * Adding IDAttribute migration and AD objectGUID support. * Removing unused idea. * Fix typo.
* | MM-10140: API Implementation for Schemes related Endpoints (#8615)George Goldberg2018-05-036-3/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement basic scheme CRUD endpoints. * Get All Schemes (Paged) Endpoint and store plumbing. * Add get teams/channels for schemes. * Fix unit tests. * Review fixes. * More review fixes.
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-021-153/+95
|\|
| * Revert "MM-9770: rewrite getParentsPosts to improve performance (#8467)" ↵Derrick Anderson2018-04-301-153/+95
| | | | | | | | | | (#8659) (#8694) This reverts commit 4b675b347b5241def7807fab5e01ce9b98531815.
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-011-6/+5
|\|
| * Structured logging (#8673)Christopher Speller2018-04-271-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implementing structured logging * Changes to en.json to allow refactor to run. * Fixing global logger * Structured logger initalization. * Add caller. * Do some log redirection. * Auto refactor * Cleaning up l4g reference and removing dependancy. * Removing junk. * Copyright headers. * Fixing tests * Revert "Changes to en.json to allow refactor to run." This reverts commit fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable.
* | MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)George Goldberg2018-04-2013-0/+830
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Scheme model and stub store. * Port ChannelStore to be Scheme aware. * Make almost all the API/APP layer work with ChannelSchemes. Only thing still hacky is UpdateChannelMemberRoles(). * Add basic SchemeStore implementation. * Migrate UpdateChannelMemberRoles properly and fix tests. * Update store tests and mocks so they work. * Include creating default roles in Scheme create store function. * Implement role deletion and start scheme deletion. * Only use non-deleted roles for authorization. * Add GetByScheme method to Team store. * Add GetChannelsByScheme. * Update store mocks. * Implement scheme deletion in the store. * Rename is valid function. * Add offset and limit to queries to fetch teams and channels by scheme. * Fix queries. * Implement scheme awareness in Team store and add a migration. * Tidy up ChannelStore mapping functions and add exhaustive unit tests. * Add all missing i18n. * Proper tests for TeamStore internal functions and fix them. * Make additional TeamMember fields nullable. * Make new ChannelMember fields nullable. * Create new nullable columns without defaults. * Make new fields in large tables nullalble. * Fix empty list of TeamMembers. * Deduplicate SQL queries. * Fix spelling. * Fix review comment. * More review fixes. * More review fixes.
* MM-10121: CLI command to reset permissions system to default state. (#8637)George Goldberg2018-04-187-15/+170
| | | | | | * MM-10121: CLI command to reset permissions system to default state. * Review comment.
* Fixing misspell errors (#8544)Jesús Espino2018-03-291-2/+2
|
* Add unit test coverage for SqlStatusStore.GetAllFromTeam (#8520)Jesse Hallam2018-03-281-0/+90
| | | | I added this as part of a separate PR that was deferred for now, but figured the unit test coverage would still be useful.
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Martin Kraft2018-03-272-0/+21
|\
| * Relax 4k post message limit (#8478)Jesse Hallam2018-03-262-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9661: rename POST_MESSAGE_MAX_RUNES to \0_v1 * MM-9661: s/4000/POST_MESSAGE_MAX_RUNES_V1/ in tests * MM-9661: introduce POST_MESSAGE_MAX_RUNES_V2 * MM-9661: migrate Postgres Posts.Message column to TEXT from VARCHAR(4000) This is safe to do in a production instance since the underyling type is not changing. We explicitly don't do this automatically for MySQL, but also don't need to since the ORM would have already created a TEXT column for MySQL in that case. * MM-9661: emit MaxPostSize in client config This value remains unconfigurable at this time, but exposes the current limit to the client. The limit remains at 4k in this commit. * MM-9661: introduce and use SqlPostStore.GetMaxPostSize Enforce a byte limitation in the database, and use 1/4 of that value as the rune count limitation (assuming a worst case UTF-8 representation). * move maxPostSizeCached, lastPostsCache and lastPostTimeCache out of the global context and onto the SqlPostStore * address feedback from code review: * ensure sqlstore unit tests are actually being run * move global caches into SqlPostStore * leverage sync.Once to address a race condition * modify upgrade semantics to match new db semantics gorp's behaviour on creating columns with a maximum length on Postgres differs from MySQL: * Postgres * gorp uses TEXT for string columns without a maximum length * gorp uses VARCHAR(N) for string columns with a maximum length of N * MySQL * gorp uses TEXT for string columns with a maximum length >= 256 * gorp uses VARCHAR(N) for string columns with a maximum length of N * gorp defaults to a maximum length of 255, implying VARCHAR(255) So the Message column has been TEXT on MySQL but VARCHAR(4000) on Postgres. With the new, longer limits of 65535, and without changes to gorp, the expected behaviour is TEXT on MySQL and VARCHAR(65535) on Postgres. This commit makes the upgrade semantics match the new database semantics. Ideally, we'd revisit the gorp behaviour at a later time. * allow TestMaxPostSize test cases to actually run in parallel * default maxPostSizeCached to POST_MESSAGE_MAX_RUNES_V1 in case the once initializer panics * fix casting error * MM-9661: skip the schema migration for Postgres It turns out resizing VARCHAR requires a rewrite in some versions of Postgres, but migrating VARCHAR to TEXT does not. Given the increasing complexity, let's defer the migration to the enduser instead.
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-191-95/+153
|\|
| * MM-9770: rewrite getParentsPosts to improve performance (#8467)Jesse Hallam2018-03-161-95/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rename variables in testPostStoreGetPostsWithDetails This helps to clarify the structure of the posts under test. * clarify and expand existing testPostStoreGetPostsWithDetails assertions * expand testPostStoreGetPostsWithDetails assertions This verifies that replies to posts in the window, themselves not in the window (because of a non-zero offset) are still fetched. They were previously missing. * MM-9770: rewrite getParentsPosts to improve performance See discussion on ~developers-performance, but the basic idea here is to force the database to use the `PRIMARY` index when fetching posts instead of trying to filter down by channel and doing a scan.
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-03-139-96/+407
|\|
| * MM-8839: Adds ChannelType to compliance-related model. (#8424)Martin Kraft2018-03-091-0/+2
| |
| * Remove query to update channel extra_update_at field on user ↵Joram Wilander2018-03-093-75/+10
| | | | | | | | activation/deactivation (#8415)