Commit Graph

162 Commits

Author SHA1 Message Date
Phillip Ahereza
d290534297 Migrate tests from "cmd/mattermost/commands/roles_test.go" to… (#12421)
* migrated tests in roles_test.go to use testify

* format file

* format file and edit some test statements

* change some require statements to assert

* remove extra t.Fatal

* test error on response

* use require.NotEmpty
2019-10-08 09:39:44 -05:00
Ogundele Olumide
f21b7618a4 MM-19015 Migrate tests from "cmd/mattermost/commands/config_te… (#12627)
- change t.fatal to require package of the testify toolkit
2019-10-08 00:09:39 -06:00
Ogundele Olumide
fa166f13bf chore: migrate test to testify (#12507)
- replace calls to t.fatal with require assertion of testify toolkit
2019-10-04 07:43:29 -07:00
Agniva De Sarker
20ff7032a6 Fixed some ineffective assignments (#12543) 2019-10-03 15:45:27 +03:00
Aliaksandr Kantsevoi
f010346945 Migrate tests from "cmd/mattermost/commands/team_test.go" to use test… (#12509)
* Migrate tests from "cmd/mattermost/commands/team_test.go" to use testify #12410

* #12410: Simplify if checks

Migrate tests from "cmd/mattermost/commands/team_test.go" to use testify #12410
2019-10-03 16:38:41 +08:00
Ogundele Olumide
714a5c3c29 chore: convert calls to t.fatal to testify (#12506)
- use require testfify assertions to replace calls to t.fatal
2019-10-03 10:09:29 +02:00
Aliaksandr Kantsevoi
80633ef475 Migrate tests from "cmd/mattermost/commands/webhook_test.go" to use t… (#12510) 2019-10-02 11:03:37 +02:00
Jesse Hallam
beef13ae46 MM-18721: disable SIGPIPE handling (#12394)
We recently added support for handling SIGPIPE cleanly, in order to safely shutdown plugins in the event that the STDOUT/STDERR had been closed unexpectedly. Unfortunately, this signal is also emitted when writing to a closed socket connection: an event that occurs frequently for a webserver. Normally, if no signal handler is registered for same, the Go subsystem distinguishes the file descriptor and ignores those from the network. But once a handler is registered, all SIGPIPEs are passed through: and sadly there is no way to distinguish the original file descriptor.

We don't strictly need the SIGPIPE handling for development any longer since `make stop-server` no longer shuts down the logrus process which explained the majority of hanging plugin processes. It remains suboptimal that a signal can terminate the server and leave plugin processes hanging, but the current symptoms are worse.
2019-09-30 15:44:56 -03:00
Jesse Hallam
993947c70a MM-18741: clarify error message (#12357)
Clarify the error message that is emitted by the server when failing to parse the configuration.

Fixes: MM-18741
2019-09-26 23:47:13 -03:00
Shota Gvinepadze
32bc585446 [MM-18121] Fix config set panic (#12083)
* Fix config set panic

* Change error message

* Add a test case

* Update error string
2019-09-20 17:48:19 +04:00
Nikhil Ranjan
3a3676eb12 Converting to structured logging the file cmd/mattermost/commands/utils.go (#12091) 2019-09-17 12:54:43 -07:00
Paulo Bittencourt
5b79fc4110 [MM-17889] Implement validation of plugin API version comments (#11941) 2019-09-17 08:03:28 +02:00
Jesús Espino
5cf578f486 Migrating to our ldap fork (#12149) 2019-09-12 21:11:05 +02:00
scott lee davis
98f7bdcb43 MM-14827 don't kill STDOUT for the server process (#10828) 2019-09-06 19:08:39 +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
Carlos Tadeu Panato Junior
f02f83a7df update sampledata users passwords (#11769)
* update sampledata users passwords

* update makefile
2019-08-02 19:42:25 +02:00
scott lee davis
2fa63b10ec MM 7971 dockerhost -> localhost && docker -> docker-compose (#10872)
* replace dockerhost with localhost

* remove uneeded setup-max build step (no more dockerhost)

* changes as recommended by @cpanato

* make clean-docker with docker-compose

* added ports to docker-compose.yml (needed for osx).   ignore error for ldapadd (when already exists)

* add clean-old-docker to legacy.mk

* docker-compose stop instead of down for `make stop-docker`
2019-08-02 11:53:00 -03:00
Jesús Espino
e4582905ea Time Layer for measure the Store methods calls time (#11609)
* Time Layer for measure the Store methods calls time

* Fixing build

* Fixing a formating problem

* Fixing tests

* generating store mocks

* Fixing build

* Updating generated timer layer

* Updating timer layer to the last store interface

* Updating timer layer

* Generating time layer
2019-08-01 22:10:58 +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
Joshua Bezaleel Abednego
c49f755a14 Create CLI command "team modify" to modify team's privacy setting. (#10898) 2019-07-17 11:49:12 +02:00
Rajat Varyani
c1f3c83d38 Config migrate SAML keys and certificates (#11596) 2019-07-14 09:19:51 +02:00
Claudio Costa
70fd0e0d6f Fix mixup between stdout and stderr in CLI (#11529) 2019-07-10 14:36:49 +02:00
Taufiq Rahman
9ce5b28c63 [MM-16667] Migrate User.GetByUsername to Sync by default #11453 (#11520)
* Migrate User.GetByUsername to Sync by default #11453

* fix app errors #11453

* fix app errors #11453

* fix cmd error #11453

* fix shadow var #11453

* fix shadow user var #11453

* fix test error

* fix test error #11453
2019-07-10 10:46:03 +02:00
Mounica Paladugu
ff89b2c8e1 [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default (#11100)
* [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default

* Fixing comments
2019-07-09 12:21:18 -04:00
Marc Argent
e209a7acb4 GH-11466 Migrate User.UpdatePassword to Sync by default (#11495)
* GH-11466 Migrate User.UpdatePassword to Sync by default

* GH-11466 format fix
2019-07-09 04:50:01 -07:00
Jesús Espino
da6cb83f9b Allow to export global relay to zip (#11492)
* Allow to export global relay to zip

* Addressing review comments
2019-07-08 11:06:59 +02:00
Claudio Costa
c95d295dce Update CLI channel list and search commands to show if a channel is private (#11480) 2019-07-02 16:27:00 -04:00
George Goldberg
0d8377cc59 MM-16439: Print config ordered by key alphabetically for easy diff. (#11349)
* MM-16439: Print config ordered by key alphabetically for easy diff.

* Clarify comment.
2019-06-21 17:38:26 +01:00
Rodrigo Villablanca Vásquez
59e7bf1c23 Migrates Channel.GetByName to sync by default (#11187)
* Channel.GetByName and Channel.GetByNameIncludedDeleted sync by default

* Suggested changes

* Fix some vars shadowing

* Rename of vars inside goroutine

* Shadow variable corrected
2019-06-20 15:21:36 +02:00
piperRyan
2ce36c2eb1 Migrates "Channel.GetAll" to Sync by default (#11281) 2019-06-19 10:40:05 +01:00
Rodrigo Villablanca Vásquez
d1569c48d2 Migrates Channel.PermanentDeleteMembersByChannel to sync by default (#11238) 2019-06-18 09:33:42 -07:00
Jesús Espino
693017a317 Migrate Bots store to sync by default (#11182)
* Migrate Bots store to sync by default

* Fixing tests

* Fixing govet

* Fixing tests
2019-06-14 08:20:49 -07:00
Jesús Espino
76bab4f0c2 Migrating User Store VerifyEmail, GetByAuth and GetByEmail functions to sync by default (#10941) 2019-06-12 19:30:50 +02:00
Bolarinwa Balogun
88202a76d9 [MM-16159] Migrate "Team.GetByName" to Sync by default (#11107)
* [MM-16159] Migrate "Team.GetByName" to Sync by default

* Refactor to correct mistakes and remove irrelevant code
2019-06-11 09:35:17 -04:00
Jesse Hallam
719412c1a0 MM-15956: consistent params for config migrate (#11024)
This changes the syntax of the config migrate command from:

    mattermost config migrate --from <from config> --to <to config>

to:

    mattermost config migrate <from config> <to config>

making it more consistent with our other CLI commands.
2019-05-31 17:04:59 -04:00
Jesse Hallam
ca15690685 MM-15371: allow config show --json (#10918)
* MM-15371: allow config show --json

Mattermost Cloud will (temporarily?) rely on `mattermost config show` to dump the configuration for an active cluster installation. This adds support for a `--json` flag to dump the config in a format more suitable for programmatic consumption.

* indent config show --json

* ignore coverage lines too
2019-05-28 22:18:17 -05:00
Martin Kraft
b7fcddb0fc MM-15784: Prevents non-private channels from being group-constrained … (#10950)
* MM-15784: Prevents non-private channels from being group-constrained via CLI.

* MM-15786: Fixes tests.
2019-05-28 10:55:54 -04:00
Daniel Schalla
d269891476 [MM-15490] Rework default password requirements (#10844)
* Rework default password requirements

* Update API Test Lib Default User PW

* Remove unused function; Disable password reqs in dev mode

* Disable strict password requirements for unit tests

* Update unit tests
2019-05-21 11:03:36 -07:00
Martin Kraft
8d8a4d8614 MM-15485: In-channel system behaviour for at-mentions and slash commands for group-constrained channels. (#10855)
* MM-15108: Prevent non-group-members from being added to group-constrained channels.

* MM-15485: Updates ephemeral message when non-group member is invited to group-constrained channel.

* MM-15485: Prevent group-permitted members from being removed from group-constrained channels. Show custom ephemeral when attempting /kick or /remove.
2019-05-17 12:43:19 +01:00
Pradeep Murugesan
5d1ee9373f made the Restore and Delete store method to be sync (#10835) 2019-05-16 12:31:50 +02:00
Martin Kraft
1b78f9debc MM-14897: Changes to be able to add and remove groups from channels. (#10794)
* MM-15162: Changes for LDAP groups removals phase.

* MM-14897: Changes to be able to add and remove groups from channels.

* Update model/client4.go

* MM-14897: PR-requested change to string interpolation.
2019-05-15 12:03:47 -04:00
Siyuan Liu
2130e9f0b1 [GH-10800] convert bot account to user account (#10803)
* [10800] convert bot account to user account

* check password validity first

* review comments
2019-05-15 13:23:12 +01:00
Martin Kraft
480fffd3cc MM-15162: Changes for LDAP groups removals. (#10701)
* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Adds missing translation blocking enterprise build.

* MM-15162: Update to group commands.
2019-05-10 11:47:21 -04:00
Miguel de la Cruz
2c0068a288 [MM-15164] Add group commands (#10812) 2019-05-10 15:53:01 +01:00
Puneeth Reddy
6ce3cc6921 MM-15290: Migrate commandStore.GetByTrigger to sync by default (#10741)
* MM-15290: migrate command.GetByTrigger to sync by default

* Fix build

* MM-15290: fix go vet issue
2019-05-07 20:44:30 +02:00
Puneeth Reddy
2d3fb4f426 MM-15288: Migrate CommandStore.Get to sync by default (#10739)
* MM-15288: Migrate Command.Get to sync by default

* addressing review comments, updating status code of err returned by Get Method
2019-05-06 18:12:41 +02:00
Siyuan Liu
fc15eda37f [MM-14719] convert users to bots through cmd (#10672)
* [MM-14719] convert users to bots through cmd

* address review comments, add / fix unit tests

* change command from "modify" to "convert"; review comments

* code review comments, clean up
2019-05-06 07:59:51 -07:00
Jesús Espino
584ec68755 MM-15021: Adding new builtin system schema for Guests (#10601)
* MM-15021: Adding new builtin system schema for Guests

* Fixing tests

* Setting properly the permissions

* Adding guests to sampledata

* Restrict more roles updates in the app layer for guests

* Adding comment to explain that permissions migration must go at the end

* Setting the default guest role for custom scheme during migration

* Fixing import and export

* Creating scheme guest roles on migration

* Fixing tests

* Fixing tests

* Fixing tests
2019-04-30 20:36:21 +02:00
Puneeth Reddy
171058eb3d MM-15289 Migrate command.GetByTeam to sync by default (#10740) 2019-04-29 10:20:51 +02:00
Puneeth Reddy
9f9620b4c8 MM-15186: Migrate "WebHook.GetOutgoingByTeam" to Sync by defa (#10707) 2019-04-26 21:20:36 +02:00