Commit Graph

11789 Commits

Author SHA1 Message Date
Amy Blais
3a1deeaac5 Update en.json (#12684) 2019-11-04 13:47:23 +01:00
Adarsh K Kumar
cacdda702e MM-19663 | Migrate brand_test and cluster_test to testify (#12935)
* MM-19663 | Migrate brand_test and cluster_test to testify

* Use require.Fail instead of require.FailNow

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>
2019-11-03 17:13:22 +02:00
Ben Schumacher
a2adf7b3f5 Run unused against codebase (#12968)
* Remove unused methods

* Fix missed issues
2019-11-01 23:08:01 +01:00
Joshua Bezaleel Abednego
63a28700f5 [MM-12623] Create CLI command "config reset" (#10296) 2019-11-01 19:29:02 +01:00
Nikhil Ranjan
3687a0b6c1 Migrate tests from store/storetest/status_store.go to use test… (#12873) 2019-11-01 12:52:18 +01:00
Ben Schumacher
0b24c336b3 Fix golangci-lint target (#12985) 2019-10-31 15:53:40 -05:00
Christopher Poile
0697f5206c [MM-16437] Plugin crashes the server when calling WriteHeader with an invalid http code (#11276)
* [MM-16437] add a check so that we don't write an invalid header

* better solution

* * passing in the logger; logging the error; fixed a spelling mistake

* trigger jenkins
2019-10-31 13:27:49 -04:00
catalintomai
7c658a98f0 MM-18060: Include deleted posts in compliance export. (#12957) 2019-10-31 09:31:18 -07:00
jfrerich
f3716caba9 [MM-18331] When patching a bot send websocket notification (#12373)
* When patching a bot, perform these two additional steps:

1. Update the user.UpdateAt value for the user/bot.

2. send the websocket event so all clients know a user update has
occured. This will tell clients to update the displayname

* Add check for UpdateAt.  Check that createdBot.UpdateAt is not equal
to patchedBot.UpdateAt

* re-add unintentional empty line delete in previous commit

* Don't create a fake updateAt time.  Let the Update() method handle the
change. User the returned updateUser for sending updated user event
2019-10-31 11:25:19 -05:00
Claudio Costa
422f377c96 [MM-19473] Fix data race on user login (#12870)
* Avoid writes to App.Session outside the app layer

* Fix merge

* Remove unneeded else condition
2019-10-31 12:50:43 +01:00
Luke Kingland
6f6eb13a47 license, openGraph tests: convert to testify (#12919) 2019-10-31 12:19:19 +01:00
Luke Kingland
8c3dcadbd7 oauth_test: use testify (#12949)
* oauth_test: use testify

* oauth_test: use assert in most cases, correct param order
2019-10-31 10:47:51 +01:00
Shota Gvinepadze
b208bbc43e [MM-18830] Unhelpful error message when adding bot to a channel before adding to team (#12844)
* Fix error message

* Rename User to Username

* Add '@' to the username
2019-10-31 12:49:50 +04:00
Luke Kingland
df0bb8aaa0 emoji_test: update to use testify (#12932)
* emoji_test: update to use testify

* emoji_test: use testify builtin Len check, and add missing err check
2019-10-31 12:44:27 +04:00
Ali Farooq
e4ed763e2a MM-19310 - Wrong validation message when Bot name ends in a . (#12905)
* MM-19310 - Wrong validation message when Bot name ends in a .

* Reverting back old behaviour
2019-10-30 17:00:43 -04:00
Nikhil Ranjan
a221c52acb Migrate tests from store/storetest/oauth_store.go to use testify (#12875) 2019-10-30 19:37:36 +01:00
Romain FOYARD
4111ffdb4d Include extra metadata when clicking an interactive button (#12697)
* Include user_name, team_domain and channel_name when clicking an interactive button

* Fixed api4's TestPostActionCookies test

* Moved team database request to improve concurrency.
Renamed TeamDomain to TeamName.

* Further optimizations to database requests

* Removed useless goroutine when fetching channel
2019-10-30 10:36:14 -07:00
George Goldberg
1b95ee9834 MM-19553: Generate valid passwords on bulk import. (#12871)
This changes the bulk import so when it needs to generate a password
because no password or auth data was supplied, it now takes into account
the configured minimum length, as well as assuming all other distinct
character types are configured to be required. It should now generate
valid passwords regardless of the password policy configuration in the
Mattermost configuration file.
2019-10-30 16:57:51 +00:00
Luciano Magro Mores
f9a7a16a78 Convert api4/webhook_test.go t.Fatal calls into require/assert calls (#12904) 2019-10-30 21:08:40 +08:00
Ben Schumacher
bc2b8b85fb Fix golangci-lint target for non GOPATH installations (#12934)
* Fix golangci-lint target for non GOPATH installations

* Link to https://github.com/golangci/golangci-lint#install
2019-10-30 12:48:51 +01:00
Paulo Bittencourt
7d0d7c304e MM-17888 Check plugin Helpers minimum server version comments (#12663) 2019-10-30 08:34:29 +01:00
Clément Collin
7cc1f19453 [MM-18898] Stringify plugin.Log* parameters (#12700)
- Add stringutils with method that "stringify" object slices
  - "stringify" means convert each object to its string representation
- Move plugin.Log* implementations to client_rpc, use stringify method before calling server method
- Exclude Log* methods from generated RPC methods
- No signature change for plugin.Log* API
- Add test in plugin_api_test to use plugin.Log* methods with RPC
2019-10-30 04:17:04 +01:00
catalintomai
5dbccd0f07 [MM-18360] Add audit logging for SAML user login (#12831)
* Add audit logging for SAML user login

* add statement for login sucess

* Update web/saml.go

Co-Authored-By: Martin Kraft <martin@upspin.org>
2019-10-29 10:54:43 -07:00
Alexander Morozov
9b9923ea42 Replace time.After with time.NewTimer (#12945)
time.After might leave stray timers if other channels in select triggered early

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2019-10-29 18:41:54 +01:00
Carlos Tadeu Panato Junior
a3257690d6 Update TestHandleCommandResponsePost test (#12879)
* Update TestHandleCommandResponsePost test
2019-10-29 18:39:54 +01:00
Carlos Tadeu Panato Junior
b3c0b5dd57 remove redis (#12918) 2019-10-29 15:05:54 +00:00
Akshay Chhajed
91f944f64d Migrate tests for store/storetest/channel_store.go (#12892)
* Migrate tests for store/storetest/channel_store.go

* Corrected variable declaration

* corrected nilf to nil

* Reordered parameters to Equal and EqualValues
Corrected few tests to use Len, NotNil to improve readability

* Removed third parameter from require.Nil()

* Corrected failing tests
2019-10-29 07:43:23 -07:00
Ben Schumacher
38c0bde7f8 Run ineffassign against codebase (#12925) 2019-10-29 15:04:28 +01:00
Ali Farooq
4cc2973483 MM-18827 - Can not use api/v4/websocket with trailing slash (#12931) 2019-10-29 18:44:32 +08:00
Ben Schumacher
7a665aacdd Run gosimple against codebase (#12928) 2019-10-29 07:45:09 +01:00
Nikhil Ranjan
d7649fbf31 Migrate tests from store/storetest/terms_of_service_store.go to use testify (#12874) 2019-10-28 20:02:28 -04:00
Nikhil Ranjan
7bcb835f37 Convert store/storetest/preference_store.go t.Fatal calls into assert/require calls (#12800)
* Convert store/storetest/preference_store.go t.Fatal calls into assert/require calls

* fix test
2019-10-28 17:23:55 -04:00
Ben Schumacher
fdcda20fe4 Cleanup dead code (#12929)
* Cleanup dead code

* Remove unneeded translation string
2019-10-28 19:12:50 +01:00
Ben Schumacher
71d5f7dc64 Remove unused struct fields (#12924) 2019-10-28 18:04:50 +01:00
Luke Kingland
aaf0bf1cdd command_help_test, cors_test: use testify (#12941)
* command_help_test, cors_test: use testify

* cors_test: remove extraneous lines

* command_help_test: remove extraneous lines

* command_help_test: set checks to nonterminal
2019-10-28 09:52:51 -06:00
413x
ef5a5d574f GH-12630 Migrate tests from model/file_info_test.go to use testify (#12647)
* Rewrite tests on testify for model/file_info_test.go
2019-10-28 16:44:20 +01:00
Ben Schumacher
d6f8ea293b Remove unused variables (#12926) 2019-10-28 11:41:41 -04:00
Eli Yukelzon
0736433d47 fix npm ci step (#12937) 2019-10-28 09:51:18 -04:00
Ben Schumacher
e61340c54e Run gofmt -s against codebase (#12943) 2019-10-28 06:08:08 -07:00
Ben Schumacher
8a72ed2833 Fix unnecessary type conversions (#12927) 2019-10-28 10:57:21 +01:00
Agus Mistiawan
3701a393e5 Migrate tests from "api4/apitestlib.go" to use testify (#12817)
* migrate tests to use testify

* check resp error

* require empty auth

* fix based on comment

* change to require

* change all assert to require

* remove line
2019-10-27 12:54:19 +01:00
Igor Zibarev
4d962aaade Migrate tests from "api4/job_test.go" to use testify (#12897)
Fixes #12887
2019-10-27 11:47:15 +01:00
chahat arora
cf6496bb8f Migrate tests from app/command_test.go to use testify (#12659)
* Migrate tests from app/command_test.go to use testify

* minor fix

* minor fix

* minor fix
2019-10-27 11:42:21 +01:00
Luke Kingland
78c2780bc7 preference_test: use testify (#12933) 2019-10-26 07:38:07 -07:00
Agniva De Sarker
3be92856b5 MM-19172: Add golangci-lint to the CI pipeline (#12909)
To start off with, we are using the new-from-rev=HEAD~ option which just checks the current
commit. This allows us to quickly integrate golangci-lint and not spend time in fixing all the
outstanding issues.

Things pending:
- Slowly fix the existing issues. To test them, just uncomment the "new-from-rev: HEAD~" line
from .golangci.yml and have at it.
- There are a number of unused functions and methods which are only invoked from enterprise code.
We are ignoring them for now because removing them will stop enterprise build from working.

The correct solution here is to use a build tag to separate TE and EE code. As a long term goal,
we would want to use that build tag throughout the EE codebase and remove the TE_PACKAGES and
EE_PACKAGES variables in the Makefile and just use the build tag. That makes things a lot cleaner
and avoids the need to spawn a "go list" every time to get the correct list of packages.
2019-10-26 09:12:07 +02:00
Ben Schumacher
37e0424977 Include request_id in HTTP request logs (#12880) 2019-10-25 20:02:18 +02:00
Guillermo Vayá
f58e2ffd0f [MM-19344] add option to render latex (#12907) 2019-10-25 13:58:48 -04:00
Abu Hanifa
c0186cef1a Conv emoji to testify (#12900)
* convert fatal to requrie

Signed-off-by: hanif <abuhanifa@pathao.com>

* finish convert

Signed-off-by: hanif <abuhanifa@pathao.com>

* change require.Errof to require.Failf

Signed-off-by: hanif <abuhanifa@pathao.com>

* simplify conditions

Signed-off-by: hanif <abuhanifa@pathao.com>
2019-10-25 13:49:33 -04:00
Jesús Espino
187e4ac765 Unbinding the permission INVITE_GUEST from INVITE_USER (#12908) 2019-10-25 18:10:34 +02:00
Adrian
a622ba412e Use locale-agnostic Firefox download link (#12251)
This link redirects to the most suitable language for the user based on their browser's `Accept-Language` header.
2019-10-25 11:19:56 +02:00