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

11951 Коммитов

Автор SHA1 Сообщение Дата
Eli Yukelzon
f672eb7291 corrected file permissions for localstore (#13369)
Automatic Merge
2019-12-11 09:42:00 -05:00
Agniva De Sarker
bc496a0d96 Add the old fmt and vet targets to legacy.mk (#13202)
* Add the old fmt and vet targets to legacy.mk

This is to ease the transition until a time
when everybody has moved to using golangci-lint.

* Just run golangci-lint for make vet
2019-12-11 17:13:43 +05:30
larkox
d8f5b2a4da [GH-13099] Migrate lastPostTimeCache cache from store/sqlstore/post_store.go to the new store/localcachelayer (#13134)
Automatic Merge
2019-12-11 06:42:00 -05:00
Jesse Hallam
bb1facb1f5 MM-20755: fix post actions in DMs/GMs (#13248)
* MM-20755: fix post actions in DMs/GMs

The fix for https://github.com/mattermost/mattermost-server/issues/12377 assumed that all channels have teams, but this is false for DMs and GMs.  Test for this and avoid failing on a missing team as such.

Fixes: https://mattermost.atlassian.net/browse/MM-20755

* tweak code for clarity
2019-12-10 12:57:54 -04:00
Ben Schumacher
354f20e7f0 Bump app version to 5.20 (#13230) 2019-12-10 13:17:06 +01:00
Jesús Espino
f55a81163e Adding mattermost-govet to the pipeline (#13257)
* Adding mattermost-govet to the pipeline

* Trying to fix circleCI config

* Trying to fix circleCI config

* Trying to fix circleCI config

* Trying to fix circleCI config

* Update Makefile

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* Update Makefile

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Adding legacy check-licenses task to legacy.mk

* Removing unnecesary GO111MODULE=off lines

* Adding jenkins mattermost-govet installation
2019-12-10 13:10:35 +01:00
Jason Frerich
876cf82bad [MM-14725] Inform System Admins when a user who managed bot ac… (#11669)
* Add notification, to sysadmins, when a user is disabled and the user
owns bots.

* If the user doesn't have any bots, there is no need to send a
notifcation to sysadmins

* Remove comment

* Update documention link

* Send as System

* Query teams for each sysadmin and add first response to hardcoded link.

* Remove fmt.print debug statements

* remove link with hard-coded team.  Will add this as future enhancement
Expose GetDisableBotSysadminMessage function so it can be tested
Add test new function for testing new notification feature

* Fix shadow error

* Swap sentences in the message when  System Console > Bot Accounts > Disable bot accounts when owner is deactivated: is set to false

* Another message correction

* Rename Custom Integrations to Integrations

* rename botsDisabled variable to disableBotsSetting

* - increase the number of bots and sysadmins queried to 1000.
- limit the number of bots printed in the post to 10, but mention the
  total bots owned by the user

* Enable translations for sysadmin messages

* - Rename function. The actual purpose for the function is to notify
  sysadmins that a user, that owned bots, was disabled.
- convert GetDisableBotSysadminMessage from a function to a method.
  This allows getting *a.Config().ServiceSettings.DisableBotsWhenOwnerIsDeactivated
  in the method and avoids having to pass the value as an input to a
  function

* fix "make i18n-extract" error.  Reorganize .json file

* Correct the upper range value to be the minimum of number of elements in the
userBots array, or the upper limit (10)

* replace t.fatal with require statements
fix golangci-lint errors

* Create separate message when user managed less than or fewer than 10 bots
Test cases for both message types

* fix i18n sorting

* Using pagination to get the bots and sysadmins instead of setting
arbitrary value for PerPage and only retrieving first page

* only use one translation ID for the message.
push all logic into the template so translators can view the logic
add disableBotsSetting and printAllBots variables to the translation
map

* Break the for loop once len(bots) < perPage value, instead of
breaking once there are no bots. This saves one additional call
2019-12-06 20:00:47 -06:00
Jesse Hallam
345b0c560a MM-20948: nocache for static plugin assets (#13322)
Serve static plugin assets with a `Cache-Control: no-cache, public` header. This avoids caching a 404 response for such an asset, preventing it from being loaded until expiry even if the file later becomes available.

This is currently preventing updates of plugins on community and would generally affect any customer with a cache in front of the Mattermost servers.

Fixes: https://mattermost.atlassian.net/browse/MM-20948
2019-12-05 23:57:30 -04:00
Carlos Tadeu Panato Junior
d3a1a37f93 upgrade DB to 5.18 (#13315) 2019-12-05 23:06:50 +01:00
Ali Farooq
186524bba4 Revert "MM-20105: Migrate channelByNameCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13189)" (#13329)
Automatic Merge
2019-12-05 16:15:07 -05:00
Jesús Espino
0d735042d9 Fixing flaky test around websocket counts in analytics API endpoint (#13314) 2019-12-05 22:06:15 +01:00
Shota Gvinepadze
9898f91f7e [MM-20309] production public key (#13244)
* Add production public key

* Fix unit tests
2019-12-05 23:41:52 +04:00
Ben Schumacher
5122b9e292 [MM-20723] Add golint for plugin package to golangci (#13090) 2019-12-05 20:31:53 +01:00
Carlos Tadeu Panato Junior
d12bf77f53 dont build master or release branches (#13310)
those branches are being built in the internal jenkins
2019-12-05 17:05:52 +01:00
Mario de Frutos Dieguez
8347f3e1fa Bulk import/export supports direct messages from a user to themselves (#13200)
* Test added to check support for import of messages sent to your own DM
channel

* Support for single member direct channel messages and posts

Now bulk import is able to export/import the self direct channel and
the posts inside

* Improve how the copy of channel members for DM and DM posts

* Improved the tests for the export self-channels
2019-12-05 22:58:38 +08:00
Farhan Munshi
8cafd11162 [MM-20620] Handle trailing slash when building marketplace api… (#13273) 2019-12-04 17:55:53 +01:00
Christopher Poile
6e6a44764c [MM-19892] Fix failing test TestImportBulkImport (#13003)
Automatic Merge
2019-12-04 11:31:52 -05:00
Claudio Costa
72f3bb10c7 [MM-20761] Fix and improve integrity check tool (#13246)
* Fix query and add tests

* Support NULL values and improve output
2019-12-04 16:56:08 +01:00
Igor Gomonov
dc610d201d GH-12781: Migrate tests to use testify (#13203) 2019-12-04 16:49:06 +01:00
Agniva De Sarker
5a4ac4b249 Fix typo for v5 module path (#13313)
The PR link uses the github repo path, not the module path.
2019-12-04 10:59:11 +01:00
Allen Lai
223db0c05c MM-20105: Migrate channelByNameCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13189)
* migrate

* add unit test

* change syntax

* delete comments

* remove includedeleted search method

* remove include search method in correct file

* change constant

* add Mock.On

* change to &channel

* fix type for Mock.on().return()

* remove inc counter

* suggestions takened

* get rid of unneeded concat

* go fmt

* import v5
2019-12-04 06:55:02 +01:00
Harrison Healey
4a23d4b282 MM-20681 Fix custom post types not marking channel unread when using Mark as Unread (#13247)
* MM-20681 Fix custom post types not marking channel unread when using Mark as Unread

* Fix inverted if statements
2019-12-03 14:51:50 -05:00
Agniva De Sarker
df95748e86 Remove references of GOPATH from circleCI config (#13263)
* Remove references of GOPATH from circleCI config

And normalize all paths to refer from $HOME as ~ rather than
an absolute path.

Updates #13129

* Changed to absolute paths for docker volume binding.

Volume binding does not work with relative paths.

* Trying with absolute paths for docker working dir
2019-12-03 23:34:40 +05:30
Doug Lauder
420c411595 MM-8607: Add ability to turn off non-critical services when under load; cluster support (#13267)
* MM-8607: Add cluster support for server busy status

MM-8607: Busy.Cluster should be non-exported

MM-8607: rename logging field seconds -> expires_sec

MM-8607: each node clears its own busy flag

MM-8607: ensure unit tests are not sensitive to test machine speed

* MM-8607: chg comment to force CI rebuild
2019-12-03 18:56:39 +01:00
Maria A Nunez
4ebc71ed38 MM-18089 - Custom setting type manifest documentation (#13306)
* Added custom type to manifest setting types documentation

* Update text

* Typo PR Feedback
2019-12-03 12:52:16 -05:00
Ibrahim Serdar Acikgoz
4859208744 [MM-19969] - When bulk import finds an already existing post, it should delete existing files (#13037) 2019-12-03 10:52:29 +01:00
Ben Schumacher
d0d6ce0a70 [MM-20353] Change KVSetWithOptions to accept a byte slice (#13213)
* Drop EncodeJSON from PluginKVSetOptions

* Add unit tests for KVSetWithOptions with nil values
2019-12-03 10:46:15 +01:00
cpanato
3543fcce6c fix docker image build for master 2019-12-02 19:46:19 +01:00
Ali Farooq
4e5004ddd2 MM-20642 - Failed to install marketplace plugin on older mattermost servers (#13237)
Automatic Merge
2019-12-02 13:42:54 -05:00
Abhisek Datta
b45e11b28c [MM-19880] Limit size of file inside Zip archive before JSON parsing for Slack Import (#12514)
* Limit size of files inside Zip archive before JSON parsing for Slack import

* Use specific log message when skipping file in Slack import zip due to size

* Updated max size for slack import
2019-12-02 18:55:34 +01:00
Carlos Tadeu Panato Junior
6bb2cae219 Update keys (#13281)
* update context and s3 buckets

* update jenkins
2019-12-02 17:46:57 +01:00
Harrison Healey
a0130b86d7 MM-20649 Fix incorrect mention count when marking a DM channel as unread (#13245)
* MM-20649 Fix incorrect mention count when marking a DM channel as unread

* Satisfy govet

* Update missed test
2019-12-02 09:30:08 -05:00
Eli Yukelzon
4e5369e759 MM-19957 - Deactivating a user should increment the Daily and… (#13232)
* corrected active count function
2019-12-02 15:48:36 +02:00
Sanele T. Mahlalela
81cff677b1 fixed localcache emoji layer test description (#13206) 2019-12-02 11:06:11 +01:00
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
İlker Göktuğ Öztürk
0adbfa8478 plugin: fix InstallPlugin() API by manually creating RPC code (#13041)
Flugin: fix InstallPlugin() API by manually creating RPC code

previous implementation of InstallPlugin()-#12232 's RPC funcs wasn't working because `io.Reader` isn't supported by the RPC code generation tool.

RPC does not support streaming data and RPC code generation tool does not handle this exception.

thus, RPC funcs are now implemented manually to stream `io.Reader` through a separate multiplexed connection.
2019-11-29 12:41:17 +01:00
Rodrigo Villablanca Vásquez
e03411795c Migrating team store cache to cache layer (#13075)
Automatic Merge
2019-11-29 05:56:50 -05:00
Luke Kingland
e2a2a1a5bc post_test: use testify (#12948)
Automatic Merge
2019-11-28 17:41:51 -05:00
larkox
d2e78e28a9 [GH-13105] Migrate channelPinnedPostCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13164)
* Migrate channelPinnedPostCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer

* Remove GetPinnedPostCountFromCache

* Rearrange test to avoid undeclared variable
2019-11-28 15:21:42 -05:00
Miguel de la Cruz
070ec77ee3 Fix the LDFLAGS references to use the version suffix (#13242) 2019-11-28 18:05:32 +01:00
Claudio Costa
eeec08c071 [MM-19979] Stop sending new_user websocket event to guests (#13191)
* Stop sending new_user websocket event to guests

* Remove debug msg

* Revert go.mod/go.sum

* Fix linting issues
2019-11-28 14:24:04 +00:00
Miguel de la Cruz
2259b7f2a8 [MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
Martin Kraft
14bcd1f0a1 MM-18357: Adds pagination to team search. (#12910)
* MM-18357: Adds pagination to team search.

* MM-18357: Adds new client method for paginated requests.

* MM-18357: Adds feedback about non-supported pagination-permissions combo.

* MM-18357: Removes unnecessary conversion.

* MM-18357: Removes paginate parameter and uses nil on page and perpage instead.
2019-11-28 08:11:02 -05:00
catalintomai
955f8c4e8e MM-19956: Add edit and delete post message export tests. (#13156)
* MM-19956: Add edit and delete post message export tests.
2019-11-27 21:05:53 -08:00
Doug Lauder
5abbe50258 MM-8607 Add ability to turn off non-critical services when under load (#13212)
* MM-8607: add ability to turn off non-critical services under load

* server busy invalid param unit tests

* MM-8607: rename server busy endpoints

* MM-8607: handle case where App not initialized

* MM-8607: additional unit test cases per feedback.

* MM-8607: use decorator to check isbusy when adding endpoint route

* MM-8607: rename endpoints, use struct for json

* Update api4/system.go

Fix misspelled log output

Co-Authored-By: Saturnino Abril <saturnino.abril@gmail.com>

* MM-8607: fix i18n order; max seconds for server busy expiry
2019-11-27 20:41:09 -05:00
Christopher Speller
3cb3d874b8 MM-19980 Allowing user delete command to delete bot accounts. (#13155)
Automatic Merge
2019-11-27 15:36:51 -05:00
Jesse Hallam
98bc2b1077 MM-19551: Add IsDefaultMarketplace to client config (#13183)
This exposes the necessary data to the webapp to know when to send more
detailed telemetry events.
2019-11-27 16:33:37 -04:00
Christopher Speller
0907530528 MM-20608 Updating x/crypto to support ACMEv2 (#13201)
* Updating x/crypto to support ACMEv2

* Revert test code.
2019-11-27 09:56:31 -08:00
Allen Lai
fdec1ef1f5 MM-20100: Migrate channelGuestCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13135)
* init

* migrate

* add test

* fix channel store

* ...

* missing ')'

* change function interface

* fix build

* fix format

* Update store/localcachelayer/layer.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* Update store/localcachelayer/channel_guest_layer_test.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* im so confused why my builds are failing

* fix build

* format

* fix format

* add license header

* resolve some conflicts

* add test

* fix constant names

* fix more constants

* fix bugs

* delete unused constants

* Update store/localcachelayer/channel_layer.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* typo

* another typo

* get guest

* change test

* go fmt format

* change test

* remove getcountcache

* delete method from interface

* delete method

* update test

* rerun GoLang CI
2019-11-27 09:14:40 -05:00
Martin Kraft
31ac88ef69 MM-20305: Adds ability to choose whether deleted teams are included in the count query. (#13181) 2019-11-27 07:50:15 -05:00