Граф коммитов

11365 Коммитов

Автор SHA1 Сообщение Дата
Harrison Healey
fe9e8a4493 MM-17426 Properly specify multiple Accept headers for post metadata (#11766)
* MM-17326 Properly specify multiple Accept headers for post metadata

* Add q= weight to text/html
2019-08-01 13:52:38 -04:00
Jesse Hallam
11472e417c MM-17411: fix err != nil check (#11736)
Address another classic case of `var err error` and then trying to assign a `*model.AppError`. We really need to switch to passing `error` everywhere.
2019-08-01 12:39:46 -03:00
Eli Yukelzon
89a79e2e9f MM-17224 - Bulk export fails due to missing user (#11738)
* don't fail on deleted users

* test

* logging

* more fine grained error checking
2019-08-01 09:19:37 -03:00
Jesse Hallam
de88adfc0b MM-16479: panic on io.Copy error in test (#11684)
* MM-16479: panic on io.Copy error in test

I'm unable to reproduce the original report on MM-16479, but in a bid to help track down a potential failure in the future, I've added a panic on err returned from `io.Copy` within the plugin, as this seems like the only path on which the hook could return successfully but fail to show the updated contents.

* assert number of copied bytes

* log n on io.Copy error too
2019-07-31 14:27:46 -03:00
Jesse Hallam
53cae67ede fix flaky TestDoOutgoingWebhookRequest/with_a_slow_response (#11712)
Avoid relying on `time.Sleep` to assert timeout behaviour.
2019-07-31 14:25:17 -03:00
Jesús Espino
ee007962f4 Restrict the creation of dms/gms to user that you can see (#11695)
* Restrict the creation of dms/gms to user that you can see

* Adding tests

* Adding tests for CreateGroupChannel api endpoint
2019-07-31 18:37:28 +02:00
Jesús Espino
0ec0616d89 Restricting team stats using the VIEW_MEMBERS restrictions (#11694)
* Restricting team stats using the VIEW_MEMBERS restrictions

* Adding tests

* fixing tests
2019-07-31 18:34:03 +02:00
Ali Farooq
51cdae12c1 MM-16935 - Capture docker logs (#11735)
* Capture docker logs

* Using docker-compose logs to capture current build's logs

* Tarring instead of zipping

* Fixed jenkins file
2019-07-31 09:44:32 -04:00
Sven Hüster
2d0dd170c9 Slack corporate import (#11704)
* changes for channel and post import for corp slack

* add fix for missing dms in import

* add suggestions from PR review

* Apply suggestions from code review

Co-Authored-By: George Goldberg <george@gberg.me>

* fix gofmt
2019-07-31 11:31:15 +01:00
Martin Kraft
ddc48c3ac1 MM-17383: Update query to include users who are not members of any gr… (#11730)
* MM-17383: Update query to include users who are not members of any groups.

* MM-17383: Fixes govet complaint.

* MM-17383: Sorts by username.

* MM-17383: Removes accidental staging.
2019-07-30 12:04:08 -04:00
Jesse Hallam
f44473e062 MM-17339: fix missing post thread (#11729)
* leverage testify for TestGetPostsForChannelAroundLastUnread

* introduce assertPostList helper

* unit test MM-17339

* fix MM-17339
2019-07-30 17:27:18 +08:00
Ali Farooq
e2ef5d7149 Log panic when exiting (if any) (#11726) 2019-07-30 09:37:07 +02:00
Jesús Espino
bce11b7949 Removing unnused store methods (#11725) 2019-07-30 09:35:28 +02:00
Ali Farooq
8ba6c7f68a MM-17311 - Flaky TestGroupStore/UpsertMember (#11717)
* MM-17311 - Flaky TestGroupStore/UpsertMember

* PR Feedback
2019-07-29 13:48:28 -04:00
Maria A Nunez
3187907b67 MM-16990 - Fix webhooks visible to users without viewing permissions (#11698)
* Filtered incoming webhooks for users wihtout PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS

* Filtered outgoing webhooks for users without PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS

* Refactored GetOutgoingByTeamByUser to its own method in app and store

* Fixed paging condition for outgoing webhooks in store

* Separated test cases into separate t.run in WebhookStore

* Improved unit test. PR Feedback

* Filtered outgoing webhooks by channel for users without PERMISSION_MANAGE_OTHERS

* Filtered getting full list of outgoing webhooks for users without PERMISSION_MANAGE_OTHERS

* Added missing signature for GetOutgoingWebhooksPage in app

* Expanded permissions in test to SYSTEM_USER_ROLE

* Filtered getting full list of incoming webhooks for users without PERMISSION_MANAGE_OTHERS

* Removed unnecessary sq.and operator
2019-07-29 12:32:26 -04:00
Maria A Nunez
8f4dab0162 Removed unnessary save in GetChannelsByScheme test (#11701) 2019-07-29 10:54:14 -04:00
Christopher Speller
20825a1702 Updating dependencies. (#11680) 2019-07-29 07:39:56 -07:00
Jesse Hallam
f226f672f3 MM-17235: fix flaky TestChannelStore tests (#11715)
Address more model.GetMillis() races.
2019-07-29 10:18:37 -04:00
Jesse Hallam
4beb1226c8 revert 0e534c8, rewriting plugin tests to use actual pugins (#11713)
Revert https://mattermost.atlassian.net/browse/MM-14559. The tests were refactored, but all the hooks were be run as:

    _, ret := hooks.MessageWillBePosted(nil, nil)

and the plugins were panicking, but then nothing was actually failing because this hook doesn't support returning a "proper" error. Good news is that the old tests are still passing, so nothing has regressed in the toolkit, but thinking we should revisit this holistically instead of trying to fix in place.
2019-07-29 10:07:00 -03:00
Jesús Espino
e067272e16 Cleaning the store from functions returning StoreResult (#11602)
* Cleaning the store from functions returning StoreResult

* Removing unnecesary StoreChannel type
2019-07-29 12:38:46 +02:00
Taufiq Rahman
c362f0e802 [MM-16174] Migrate Team.SaveMember to Sync by default #11125 (#11354)
* Migrate Team.SaveMember to Sync by default #11125

* Update migrate Team.SaveMember to Sync by default #11125

* Update migrate Team.SaveMember to Sync by default #11125

* fix shadow var #11125

* fix shadow vars #11125

* fix shadow vars #11125

* fix shadow vars #11125

* run gofmt

* Fixing tests

* Fix undefined var res

* Fixing shadow variable

* fixing tests

* Addressing PR comments

* Fixing build

* Fixing compilation after merge

* Addressing PR comments
2019-07-29 11:30:16 +02:00
Jesús Espino
a9fc3581ff Removing unnecesary StoreResult usages to simplify the store code (#11519)
* Removing unnecesary StoreResult usages to simplify the store code

* Fixing tests
2019-07-29 10:37:35 +02:00
Miguel de la Cruz
8858b15e7e [MM-17194] Add search channels for user in case the user doesn't have the list channels permission (#11706)
* [MM-17194] Add search channels for user in case the user doesn't have the list channels permission

* Add tests for the API layer and control the case of a user not being a team member

* Remove unnecessary empty line
2019-07-29 09:35:32 +02:00
Jesse Hallam
1fa505c833 MM-17053: avoid colliding with reserved team names (#11705)
There are a handful of “reserved” team names that will be rejected if found at the start of the team name – e.g. “api21251251” or “error1251251”. Turns out we just got really unlucky and a model.NewId invocation generated just such a collision. I've changed all such random generations to include a prefix.
2019-07-26 20:41:20 -03:00
Ali Farooq
f6480d1ac6 MM-16935 - Flaky test: Elastic Search IndexChannel Error (#11709) 2019-07-26 18:53:12 -04:00
Lev
52ac87ea32 MM-16997: Simplified TestUploadFiles (#11707)
* MM-16997: Simplified TestUploadFiles

Tickets:
https://mattermost.atlassian.net/browse/MM-16997
https://mattermost.atlassian.net/browse/MM-16760

- The tests now fully buffer the data vefore uploading it. The prior
  code was much more complex because it was intended to eventually
  mature into generic client code; not a priority, definitely not
  valuable for this test.
- Also improved error handling in TestHookFileWillBeUploaded for
  MM-16760

* PR feedback: typo
2019-07-26 09:54:04 -07:00
Jesús Espino
0a12fef33a Fix pagination bug on LDAP groups users listing (#11711)
* Fix pagination bug on LDAP groups users listing

* Fixing consistency in parameters names
2019-07-26 15:18:37 +02:00
Taufiq Rahman
7e092886dc [MM-16658] Migrate User.GetProfilesInChannel to Sync by default #11462 (#11685)
* Migrate User.GetProfilesInChannel to Sync by default #11462

* Refactor variable names #11462
2019-07-26 13:11:13 +02:00
Jesús Espino
447589a06e More robust guest members for users and tests for it (#11700)
* More robust guest members for users and tests for it

* Fixing shadow variables

* Fixing shadow variables
2019-07-26 10:34:01 +02:00
Gabe Jackson
b73b6b4c36 Improve bulk export of posts (#11702)
This change modifies some of the logic for processing posts during
bulk export in order to improve performance.
2019-07-25 12:20:49 -04:00
Lev
5c87009ca4 no ticket: Show go compile output for embedded unit test plugins (#11689)
Hmm, by the time I looked again the test is passing.
2019-07-23 21:22:15 -07:00
Jesús Espino
27976a6060 Fixing initial DMs/GMs load (#11691)
* Fixing initial DMs/GMs load

* Fixing ci
2019-07-23 20:29:25 +02:00
Tim Scheuermann
9e41a8e03a MM-12460 Fill the Theme field for team members on export (#11533)
* Fill the Theme field for team members on export

* Reverted renaming userId to userID

* Use the TeamId to get the team specific theme
2019-07-23 17:44:59 +01:00
Jesús Espino
be099215c5 Exposing enforce mfa in client config (#11686) 2019-07-23 15:02:21 +02:00
Jason Blais
8dcbab97b4 Add telemetry for new cluster settings (#11677)
Track if the default value is used for NetworkInterface, BindAddress and AdvertiseAddress.

Do not track the actual value, as this could expose sensitive data of the system.
2019-07-23 08:42:04 -04:00
Eli Young
f4ef9cab5b Close database connections last on shutdown (#11683)
The job workers and cluster discovery components require access to the
database during shutdown. To avoid issues, we leave the database open
until the last step of the shutdown process.
2019-07-23 08:41:11 +01:00
Jesús Espino
fe8a0f6485 Guest accounts feature (#11428)
* MM-14139: Creating permissions for invite/promote/demote guests (#10778)

* MM-14139: Creating permissions for invite/promote/demote guests

* Fixing tests

* Adding invite guest api endpoint (#10792)

* Adding invite guest api endpoint

* Adding i18n

* Adding some tests

* WIP

* Migrating Token.Extra info to bigger size (2048)

* Fixing tests

* Adding client function for invite guests

* Adding send guests invites tests

* Renaming file from guest to guest_invite

* Adding Promote/Demote users from/to guest endpoints (#10791)

* Adding Promote/Demote users from/to guest endpoints

* Adding i18n translations

* Adding the client functions

* Using getQueryBuilder function

* Addressing PR review comments

* Adding default channels to users on promte from guest (#10851)

* Adding default channels to users on promte from guest

* Addressing PR review comments

* Fixing merge problems

* Sending websockets events on promote/demote (#11403)

* Sending websockets events on promote/demote

* Fixing merge problems

* Fixing govet shadowing problem

* Fixing feature branch tests

* Avoiding leaking users data through websockets for guest accounts (#11489)

* Avoiding leaking users data through websockets for guest accounts

* Adding tests and fixing code error

* Fixing i18n

* Allow to enable/disable guests and other extra config settings (#11481)

* Allow to enable/disable guests and other extra config settings

* Fixing tests and moving license and config validation to api level

* Update api4/role_test.go

Co-Authored-By: George Goldberg <george@gberg.me>

* Update api4/role_test.go

Co-Authored-By: George Goldberg <george@gberg.me>

* Fixing typo

* fixing tests

* Managing correctly the guest channel leave behavior (#11578)

* MM-15134: Removing guests from teams or system on leave channels if needed

* WIP

* No deactivating the guest user when leave the last team

* Adding a couple of tests

* Fixing shadow variables

* Fixing tests

* fixing tests

* fixing shadow variables

* Adding guest counts for channel stats (#11646)

* Adding guest counts for channel stats

* Adding tests

* Fixing tests

* Fixing guest domain restrictions (#11660)

* Adding needed migration for the database

* Fixing migration
2019-07-22 22:13:39 +02:00
jfrerich
fdde7c8287 [MM-16871] Remove bots from "Daily Active Users" and "Monthly… (#11658)
* Add model.UserCountOptions to analyticsActiveCount method
Add new test for analyticsActiveCount method

* Add ability to delete entries from status store, by calling SQl
directly.  There is no method available to delete entries from the
status store interace

* Instead of cleaning up after a test by passing userIds, just delete all
records in the status table and start fresh

* Remove Comment
2019-07-19 13:30:59 -05:00
jfrerich
b2706507e6 [MM-16501] Delete user from Bot table when deleting user with… (#11425)
* Add bot store PermanentDelete() method to PermanentDeleteUser method

* Test the that bot is deleted from bots table after user is deleted from
users table.  Notes GetBots() method on bots store cannot be used to get
and compare bots from before and after the PermanentDeleteUser() call.
Had to directly query the Bots table.
2019-07-19 10:16:02 -05:00
Christopher Speller
1d419ff067 Bumping pre-packaged plugin versions. (#11651) 2019-07-19 07:33:58 -07:00
Taufiq Rahman
4b71ee6fe3 Migrate User.GetProfilesInChannelByStatus to Sync by default #11461 (#11623)
* Migrate User.GetProfilesInChannelByStatus to Sync by default #11461

* Refactor review changes #11461

* Refactor review changes #11461

* Refactor review changes #11461
2019-07-19 09:36:00 +02:00
Harrison Healey
2bbfb1026d MM-16825 Update NPS plugin to 1.0.3 (#11664) 2019-07-19 08:55:40 +02:00
Harrison Healey
f1d83eaf81 MM-17043 Downgrade OpenGraph logging to debug level (#11649) 2019-07-18 15:46:54 -04:00
Jesse Hallam
98ff5fab32 MM-16261: Synchronize plugins in HA (#11657)
* MM-16272 - Synchronize plugins across cluster (#11611)

* MM-16272 - Synchronize plugins across cluster

* Adding a test

* MM-16272 - Fixed tests

* MM-16272 - PR feedback

* MM-16270 - Plugin Sync (#11615)

* Initial implementation for plugin synch with file store. WIP

* Removed ListAll implementation. Used ListDirectory and change localstore to be consistent and return all items (files and folders) from directory

* Refactored plugin filestore operations out of main install/remove plugin

* Fixing error handling details

* Changes to use structured logging

* More logging fixes

* Wording and comments improvements

* Error handling and control flow improvements

* Changed managed flag check to use os.stat

* Added file store plugin dir and filename consts

* Replaced FileRead to use a the FileReader in PluginSync

* Minor styling and PR feedback changes

* Minor error handling improvements

* Added unit test for SyncPlugins. Changed SyncPlugins to use plugins environment to list available plugins

* PR Feedback improvements

* Minor err handling fix

* Removing FileStorePath from PluginEventData (#11644)

* Fix plugin path (#11654)

* tweak path, logging

Fix an issue not finding the plugins folder in S3. Tweak logging messages to add additional clarity.

* Removing FileExists check when Syncing plugins. Updated localstore to not return an error when directory does not exist

* PR Feedback

* Install prepackaged plugins locally only (#11656)

* s/uninstall/remove

* Updated ClusterMessage comment

* Updated PluginSync to test against s3 + local storage
2019-07-18 15:05:53 -03:00
Gabe Jackson
20f03f7656 Improve DB performance on getPostsAround() (#11662)
This change modifies the database query used by the getPostsAround()
method in order to improve the performance of loading posts when
scrolling through a channel.
2019-07-18 12:16:45 -04:00
Max Vovshin
5f61047d02 [16331] Migrated Channel.SaveMember to sync by default (#11158) (#11624)
* Added - golang version validation.

* Updated error message to include the minor version that is supported.

* Fixed issue with variable.

* Renamed variable.

* Added - golang version validation.

Added validation for major and minor versions of go.

* Fixed the way the validation is performed.

* Changed function declaration (define validate_go_version) to a target (validate_go_version).

* remove unneeded call to validate_go_version

* [16331] Migrated Channel.SaveMember to sync by default (#10613)

* Used require.Nil to check for err variable instaed of using panic with if statement.

* Used require.Nil to check for err variable instaed of using panic with if statement in user_store

* fixed errors about shadowing with err variable.

* Fixed issue with vet tool validation.

* Fixed go fmt tool validation.
2019-07-18 16:26:22 +02:00
krjn
4ada8aacd4 MM-16389 - complement for emoji_icon issue (#11650) 2019-07-18 14:54:01 +02:00
cpanato
3b9da417a9 add agent to build in the correct node 2019-07-18 11:27:53 +02:00
jfrerich
a35adb3ae1 Filter bots out of notifications for members not in channel (#11655) 2019-07-17 21:12:29 -04:00
Saturnino Abril
aef5ef4ed0 MM-16949 Fix posts returned from unread API when the two different list contains parent post and comments (#11617)
* fix posts returned from unread API when the list contains parent post/s

* add ExtendAll to PostList and update test per feedback

* revert unintentional change to the other test and fix comment

* update the existing postlist.Extend, filter unique values and update unit tests
2019-07-18 02:05:43 +08:00