Commit Graph

10509 Commits

Author SHA1 Message Date
Jesús Espino
ba0a9b4d50 MM-12368: Fixing webhook create incomming (#9905) 2018-11-29 11:49:45 +01:00
Christopher Speller
da265fbaf7 Moving app from singular to being created for every request (#9889)
* Moving app from singular to being created for every request.

* Automatic refactor

* Adding license header

* Feedback fixes
2018-11-28 10:56:21 -08:00
Carlos Tadeu Panato Junior
1bcf08aa4b Refactor Get/Create Direct Channel into one function (#9867)
* refactor GetDirectChannel and CreateDirectChannel in one function

* remove CreateDirectChannel plugin api and update GetDirectChannel and GetGroupChannel plugin api

* update tests
2018-11-28 18:01:49 +01:00
George Goldberg
09eae76c00 Use constants for NotifyProps keys. (#9901)
We have constants for (most) of the notify props keys. We should use
them consistently, instead of sometimes and other times having strings
scattered around the place.
2018-11-28 11:11:41 -05:00
Harrison Healey
1607d18e55 MM-12009 Resolve relative links in posts as the web app does (#9896) 2018-11-28 11:01:35 -05:00
George Goldberg
9730b46bca MM-13190: Fix NotifyProps in Bulk Import. (#9900)
If some, but not all, notify props are specified for a user in the bulk
import data, and that is a newly created user, we must explicitly
initialise all the other notify props to their default values to avoid
breaking client assumptions.
2018-11-28 15:28:51 +00:00
Jesús Espino
415036ee8d Improving create-outgoing webhook command (#9899) 2018-11-28 15:55:16 +01:00
Joram Wilander
3904c01f46 MM-12881 Add license sku fields (#9883)
* Add license sku fields

* Add diagnostics

* Gofmt fixes
2018-11-28 09:49:43 -05:00
Christopher Speller
2e4373f91c Properly reuturning result from store function so failure is caught. (#9890) 2018-11-28 06:43:22 -08:00
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
c24c518a14 MM-13185: Fix Message Export config special case. (#9898)
It should only apply when setting through the System Console, to avoid
messing up externally managed config files.
2018-11-28 14:01:29 +00: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
Carlos Tadeu Panato Junior
79f1c1d44c Add preparatory upgrade code for 5.7.0 (#9881) 2018-11-26 14:58:12 +01:00
Carlos Tadeu Panato Junior
7253b2c59c upgrade db to 5.6.0 (#9880) 2018-11-26 14:05:04 +01:00
Harshit Patni
7663de06bb [MM - 12370] Add cli command "webhook delete" (#9804)
* [MM - 12370] Add cli command "webhook delete"

* Replace spaces with tabs

* Call cli command to delete hooks in tests

* Capture webhook object from create webhook to get webhook id

* Print error message when webhook not deleted

* Remove redundant error message and if condition in webhook delete test

* Fix build
2018-11-26 12:32:11 +01: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
Harshil Sharma
60393f1cad #132 Added some comments for API client (#9872)
* #132 Added some comments for API client

* #132 fixed godoc formatting

* #138 fixed go formatting
2018-11-26 10:43:56 +00:00
Jesús Espino
be8be3a6dc Moving app level migrations to its own file (#9871) 2018-11-23 09:39:33 -08:00
Hanzei
21cbdb6de6 Add helper methods for SubmitDialog structs (#9864)
* Add To/From JSON methods for SubmitDialog structs

* Fix method ordering
2018-11-23 12:29:32 -05: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
d76069cdbd Revert accidental changes to caching layer 2018-11-22 13:37:56 -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
Elias Nahum
d263353e85 Typo (#9857) 2018-11-22 15:28:56 +01:00
George Goldberg
877e1b7f9a MM-12957: Fix moving a channel with no members. (#9841) 2018-11-22 11:19:47 +00:00
Hanzei
ffd92d5d48 GH-9846: Migrate to idiomatic error handling in model/client4.go (#9851)
* Migrate to idiomatic error handling in model/client4.go

* Changes as requested

* Add documentation for some methods
2018-11-22 10:03:52 +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
Yusuke Nemoto
1271908182 Block to override post_type if already set (#9859) 2018-11-21 21:10:59 -05: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