Commit Graph

1073 Commits

Author SHA1 Message Date
Jesse Hallam
136d8ca5c4 Various unit test related improvements (#9865)
* api4: improved error handling

* system_store: more logs

* integrate go-junit-report into test-te/test-ee

* add CI_MINIO_HOST and CI_INBUCKET_HOST instead of CI_HOST

* comment re: minio configuration issue

* fix TestStartServerPortUnavailable to pass even when root can bind to :21

* skip TestFindManifest_FolderPermission while running as root
2018-11-28 09:05:39 -05:00
George Goldberg
9afb1586cd MM-12648: Properly unescape OpenGraph metadata containing HTML entities. (#9891) 2018-11-28 10:58:12 +00:00
Harrison Healey
4294758793 MM-13208 Rename DisablePostMetadata setting to EnablePostMetadata and turn off by default (#9894) 2018-11-27 16:13:02 -05:00
Shobhit Gupta
514c1f1617 [MM-12452] Stop inserting hashed plugin keys (#9817)
* Stop inserting hashed plugin keys

* Address comments

* Remove else statement

* Address comments

* Add comment

* Update as per comments

* Refactor as per comments

* Update plugin_key_value_store.go

minor comment tweaks

* fail on non StatusNotFound for original key query

* idiomatic error handling, and do not clean up if insert fails
2018-11-27 21:50:31 +01:00
Harrison Healey
385a0048bf MM-13015 Remove metadata field from post when metadata is disabled (#9882) 2018-11-26 10:48:58 -05:00
Harrison Healey
ba627c0f92 Skip getting the post again when getting file metadata for a post (#9879) 2018-11-26 10:47:01 +00:00
Jesús Espino
be8be3a6dc Moving app level migrations to its own file (#9871) 2018-11-23 09:39:33 -08:00
Harrison Healey
71dba81e91 MM-13015 Add safety valve setting to disable post metadata (#9877)
* MM-13015 Add safety valve setting to disable post metadata

* Remove setting from client config since it's no longer needed
2018-11-23 11:59:34 -05:00
Saturnino Abril
c494f6f898 clean up unused HTML templates (#9830) 2018-11-24 00:55:56 +08:00
Harrison Healey
d018554ef3 MM-11434 Only call PreparePostForClient once when creating a post (#9868) (#9876)
* MM-11434 Only call PreparePostForClient once when creating a post

* Have PreparePostForClient provide new metadata when a post already has it and update tests
2018-11-23 10:20:02 -05:00
Harrison Healey
eff68da254 MM-11434 Revert "Parallelize PreparePostListForClient" 2018-11-22 13:14:55 -05:00
Harrison Healey
c9f3d03b6d Merge branch 'master' into post-metadata 2018-11-22 13:11:55 -05:00
Harrison Healey
5f65356a3f Address issues 2018-11-22 13:10:36 -05:00
Harrison Healey
5388afd37e Remove comments about deprecating FileIds and HasReactions (#9869) 2018-11-22 13:09:27 -05:00
George Goldberg
877e1b7f9a MM-12957: Fix moving a channel with no members. (#9841) 2018-11-22 11:19:47 +00:00
Jesse Hallam
f8ffd68060 Webhub race condition (#9863)
* fix webconn close semantics

Avoid race conditions in WebConn on shutdown by closing channels to guarantee all readers are notified. Wrap this with sync.Once to avoid closing the channel more than once.

* web_hub_test.go

* webhub: fix race condition on shutdown

Ensure that if the webhub shuts down in the process of sending, the caller unblocks given that the webhub will no longer consume incoming events.

* panic if app shutdown takes >30 seconds

* simplify WebConn::Pump channel semantics too
2018-11-22 10:53:44 +01:00
Carlos Tadeu Panato Junior
cae7798d76 add CreateDirectChannel plugin api (#9848) 2018-11-21 11:36:02 +01:00
Jesse Hallam
a78913178c Ensure unittest isolation (#9819)
* api4: fix TestGetUsersNotInTeam assertions

This test was relying on data from a previous test run. With the data cleared before each test, the assertions much match reality.

* *testlib: always InitSystemAdmin

Some tests implicitly relied on the basic user having system
administrator privileges because it was the first user created as such.
Eliminate `InitSystemAdmin` and explicitly create the system admin user
instead to avoid this ambiguity going forward.

* *testlib: drop all tables before each test

* api4: split up TestChannelDelete to avoid duplicate InitBasic

* api4: teardown in TestResetPassword, for when this test comes back

* invalidate cache on DropAllTables

This is necessary since the test store persists across tests.

* disable parallel tests

While tests within a package must be explicitly parallelized using `t.Parallel()`, tests across packages are run in parallel by default.  This causes problems given that the tests all currently share the same database instance.

Unfortunately, this also means that running the tests is much slower, but we can return to this later.
2018-11-20 20:16:25 -05:00
Carlos Tadeu Panato Junior
2555a5d45d Add RemoveTeamIcon plugin api (#9847) 2018-11-20 15:43:42 +01:00
Jesse Hallam
c46d8ec892 MM-12974: guard app plugins with mutex (#9818)
* guard app plugins with mutex

Shutting down the app could race with a goroutine that uses the plugins environment, since we shut down the plugins first before cleaning up goroutines.

* fix go vet issues
2018-11-20 08:52:51 -05:00
Hanzei
0a73690537 Remove *model.ChannelList from plugin API return parameter (#9844)
* Remove *model.ChannelList from plugin API return parametern

* Fix panic

* Add tests

* Changes as requested

* Fix panic in GetPublicChannelsForTeam()
2018-11-20 08:50:34 -05:00
Harrison Healey
8dc865b917 Merge branch 'master' into post-metadata 2018-11-19 16:51:56 -05:00
Joram Wilander
8cfca681b0 MM-12843 Add interactive dialogs (#9816)
* Add interactive dialogs

* Fix unit test

* Updates per feedback

* Fix typo

* Updates per feedback, add icon_url and error returns

* Updates per feedback

* Update per feedback
2018-11-19 15:27:17 -05:00
Harrison Healey
23c8950312 MM-11434 Performance improvements for post metadata (#9849)
* Remove unused error return value from PreparePostForClient

* Remove unused error return value from PreparePostListForClient

* MM-11434 Parallelize PreparePostListForClient

* MM-11434 Skip looking reactions and files on post whenever possible

* Add note about the use of deprecated fields
2018-11-19 13:26:40 -05:00
Sandeep Sukhani
7a6f957638 [MM-11861] Design & implement a better way for plugins to update their own configuration (#9712)
* [MM-11861] Design & implement a better way for plugins to update their own configuration

Added GetPluginConfig and SavePluginConfig plugin APIs.
Added test cases for testing new APIs.

* Fixed gofmt error

* Minor changes requested in PR
2018-11-19 12:27:15 -05:00
Michael Kochell
a50e8ac5b9 [MM-9938] Add support for multiple responses from a slash command (#9836)
* slash command response now supports multiple posts

* change wording of Posts to ExtraResponses
2018-11-19 08:00:50 -08:00
Wasim Thabraze
246ff89391 MM-12463 : Added capability to bulk export custom emojis (#9790) 2018-11-19 14:43:31 +00:00
Hanzei
2104c6878c [MM-12476] Consistent paging arguments limit/offset vs page/perPage for plugin API (#9838)
* Change GetTeamMembers() and GetPublicChannelsForTeam() arguments to page, perPage for plugin API

* Add test for GetPublicChannelsForTeam()

* Add test for GetTeamMembers()

* Changes as requested

* Change return from GetPublicChannelsForTeam() to []*model.Channel
2018-11-19 08:43:49 -05:00
Carlos Tadeu Panato Junior
bffac3f09f add SetTeamIcon plugin api (#9840) 2018-11-16 10:52:07 -05:00
Harrison Healey
7aef759fd8 Merge branch 'master' into post-metadata 2018-11-16 09:34:35 -05:00
Carlos Tadeu Panato Junior
7a8d7e53cc Add GetTeamIcon plugin api method (#9837) 2018-11-16 08:17:42 -05:00
Carlos Tadeu Panato Junior
b29f1cb844 Add SetProfileImage for plugin API (#9831) 2018-11-15 21:23:03 +01:00
George Goldberg
f0351f23f1 MM-12818: Delete FileInfos when deleting the post they belong to. (#9828) 2018-11-14 13:01:44 -05:00
Harrison Healey
2113ad0205 MM-13021 Fix warning logged when getting metadata for post without emojis (#9832) 2018-11-14 22:24:50 +05:30
Harrison Healey
d07def5169 Merge branch 'master' into post-metadata 2018-11-14 09:58:56 -05:00
Tsilavina Razafinirina
4aca95fff9 [MM-8404] Channel notification setting for disabling channel mentions (#9777)
* Channel notification setting for disabling channel mentions

* Updates unit tests (#MM-8404)

* Adds constants (#MM-8404)

* Refactors if statement and adds unit test (#MM-8404)

* Moves ignore_channel_mentions_notify_prop constant to channel model (#MM8484)
2018-11-13 19:25:57 -05:00
Harshil Sharma
0c5f60f89b #146 Terms of Service Phase 2 (#9731)
* #132 added UserTermsOfService model

* #132 added UserTermsOfService model

* #132 added logic to save user TOS data in a new table

* #132 Added logic to save and delete user TOS. Updated user TOS action logic

* #132 updated store mocks

* #132 added tests

* #132 removed cache from UserTermsOfService SQL store

* #132 fixed styling and license check

* #132 added message translations in en.json

* #132 fixed save user TOS logic to work second time as well

* #132 removed User.AcceptedTermsOfService colum and migrated accepted TOS data into new table

* #132 fixed formatting

* #132 fixed formatting

* #146 added field 'mandatory' to terms of service

* #146 updated tests

* #146 added getLatestTermsOfService API

* #146 Added tests

* #146 fixed styling

* #146 removed code for managing mandatory/optional TOS

* #146 Added TOS re-acceptance period config

* #146 fixed styling

* #146 removed some code left for debugging

* #146 added TOS re-acceptance period in config

* #146 fixed a json name from service_terms to terms_of_service

* #146 Minor refactoring and added TOS re-acceptance period to diagnistics

* Fixed style

* Updated upgraded script to keep app backward compatible
2018-11-08 15:48:14 -05:00
Hanzei
e67d89b9a8 Add plugin methods to plugin API (#9744) 2018-11-08 10:17:07 -08:00
Harrison Healey
fab63f8ba2 MM-12829 Check message attachments for emojis for post metadata (#9797) 2018-11-08 10:47:35 -05:00
Christian Claus
93e581d642 Add plugin API for UploadFile method (#9684)
* Add plugin API for UploadFile method

* Add minimum server version documentation to plugin API UploadFile function

* Reorganize some imports
2018-11-07 21:24:54 +01:00
Christian Claus
6d4421d18a Add GetTeamsUnreadForUser to plugin api (#9659)
* Add GetTeamsUnreadForUser to plugin api

* Remove teamIdToExclude from plugin method GetTeamsUnreadForUser

* Add minimum server version to plugin API doc of GetTeamsUnreadForUser
2018-11-07 20:23:02 +01:00
Christopher Speller
ecade2f1ec MM-12849 Moving all non request scoped items to Server struct (#9806)
* Moving goroutine pool

* Auto refactor

* Moving plugins.

* Auto refactor

* Moving fields to server

* Auto refactor

* Removing siteurl duplication.

* Moving reset of app fields

* Auto refactor

* Formatting

* Moving niling of Server to after last use

* Fixing unit tests.
2018-11-07 10:20:07 -08:00
Christopher Speller
418a0ec10e Fixing formatting. (#9801) 2018-11-06 16:28:55 +08:00
Vaibhav Thakkar
f6b1ccbcb1 Added GETEmojilist plugin api (#9750)
* Add GetEmojiList plugin api

* Fixed bug in getemojilist causing build test failure

* Fix linting error

* Add requested changes

* Fix all conflicts
2018-11-05 08:50:08 -05:00
Shobhit Gupta
bce7a7c73d [MM-12462] Include favorite channels in bulk export (#9692)
* Include favorite channels in bulk export

* Remove duplicate method
2018-11-05 13:18:00 +00:00
Saturnino Abril
90f279c7d5 [MM-12805] Remove ephemeral post after leaving a channel (#9772)
* remove ephemeral post after leaving a channel

* remove unnecessary debugging line
2018-11-05 17:39:46 +08:00
Harrison Healey
ba173414d9 MM-12826 Include list of reactions in post metadata instead of just counts (#9749) 2018-11-01 15:41:43 -04:00
Harrison Healey
2190c37359 MM-12036 Add image dimensions for other fields in message attachments (#9748) 2018-11-01 15:41:37 -04:00
Harrison Healey
18684dd6de MM-11868/MM-12010/MM-12011/MM-12036 Improve post metadata structure (#9693)
* MM-11868/MM-12010/MM-12011/MM-12036 Include dimensions for opengraph and message attachment images in post metadata

* Remove duplicate check from getFirstLinkAndImages

* Add tests for getImagesInMessageAttachments

* Rename PostMetadata.FileInfos to PostMetadata.Files

* Rename Metadata.ImageDimensions to Metadata.Images
2018-11-01 15:41:29 -04:00
Harrison Healey
3929cb0141 Replace App.HTTPClient calls after merge (#9387)
* Replace App.HTTPClient calls after merge

* Add missing import
2018-11-01 15:25:23 -04:00