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

12099 Коммитов

Автор SHA1 Сообщение Дата
Mario de Frutos Dieguez
682a1d5d15 Avoid panic when push messages are empty or nil (#13751) 2020-01-29 10:08:27 +01:00
Elisabeth Kulzer
3049378506 Add 5.20 method to release branches for adding GOBIN. (#13785) 2020-01-28 19:59:47 +01:00
Ben Schumacher
cb49d560ab Allow plugins to specify a ReleaseNotesURL via manifest (#13677) 2020-01-28 19:33:21 +01:00
Jesús Espino
5f888bd4fc Making private app/cluster_handlers.go methods (#13760) 2020-01-28 12:06:21 +01:00
Jesús Espino
ae6f15b76f Making private import methos in the app layer (#13758)
* Making private import methos in the app layer

* Making one more method private
2020-01-28 10:58:33 +01:00
Jesús Espino
a76643116f Making private opengraph methods in the app layer (#13759) 2020-01-28 10:56:45 +01:00
Agniva De Sarker
11d15107b0 MM-21922: Add metrics for http verb (#13679)
* MM-21922: Add metrics for http verb

* Use multiple params

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-28 08:52:00 +05:30
Jesse Hallam
815e6b5956 .gitignore prepackaged_plugins and report.xml (#13765) 2020-01-27 12:46:26 -04:00
Farhan Munshi
afa35ac575 [MM-21946] [MM-21945] Ensure deleted groups are not returned from the groups API (#13747)
* MM-21946 Ensure deleted groups are not returned from the groups API

* MM-21946 Only append to query at the end

* MM-21946 Add DeleteAt check to the top of the GetGroups function and clean up the formatting a bit

* MM-21946 Move the From statement into the next block
2020-01-27 11:45:14 -05:00
Jesse Hallam
9726a917cb MM-21915: improve tar gz path traversal (#13675)
Automatic Merge
2020-01-27 11:33:11 -05:00
Jesús Espino
c3ad342c5e Fix GetMembers store methods order, which wasn't working properly in postgres (#13754) 2020-01-27 15:49:51 +01:00
Shota Gvinepadze
1e9556cc28 [MM-21572] Disable InstallFromUrl if EnableUploads is false (#13636)
* Disable InstallFromUrl if EnableUploads is false

* Break into 3 seperate lines

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-27 17:12:16 +04:00
Agniva De Sarker
f0934361a1 export GOBIN (#13752)
* export GOBIN

* Add comment
2020-01-27 13:34:35 +05:30
Ali Farooq
30061b2285 MM-20865 - Demo Plugin: Enabling and disabling demo plugin generates "connection is shutdown" error (#13604)
Automatic Merge
2020-01-24 09:49:49 -05:00
Doug Lauder
28ec291910 MM-19250 - new endpoint to retrieve command by id (#13598)
* MM-19250 add endpoint to retrieve command by id

* endpoint
* client
* unit tests

* MM-19250 update comment; remove redundant unit test

* MM-19250 rename GetCommand to GetCommandById

* MM-19250 don't filter on autocomplete flag

* MM-19250: require team_id when using GetCommandById

* team_id added to endpoint query string for GET
* unit test to check for mismatch teamid param and command teamid

* Revert "MM-19250: require team_id when using GetCommandById"

This reverts commit ed78e2796426f75bc23d0f16064be95fa37305fd.

* MM-19250 don't leak existence of id when user doesn't have perms

* return 404 not_found when id not found
* return 404 not_found when id exists but user missing perms to view team
* return 404 not_found when id exists but user missing perms to manage commands

* MM-19250 fix typos in comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-24 09:32:56 -05:00
Jesús Espino
5133fa18f1 Compare config without environment variables to send config updates (#13746) 2020-01-24 08:57:46 +01:00
Agniva De Sarker
21034c3513 MM-21019 - Fix race in (*Environment).SetPluginState() (#13610)
* MM-21019 - Fix race in (*Environment).SetPluginState()

- We change from passing pointers to registeredPlugin to passing
the struct by value.
- We also add a mutex to the supervisor struct to protect
from racy data access.

* move the immutability comment to the godoc of the Active method

* Changing mut to lock

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-24 09:00:35 +05:30
Marco Kundt
3892db4613 Fix small typo (#13739) 2020-01-23 18:06:57 -05:00
Mario de Frutos Dieguez
0581ff7cb8 User Management > User role change not reflected in the UI without a refresh (#13683) 2020-01-23 19:30:13 +01:00
Allen Lai
90c0479c2f [MM-20804] Add "Unarchive Channel" option to the channel info screen - Additional fixes (#13614)
Automatic Merge
2020-01-23 12:49:48 -05:00
Miguel de la Cruz
eb17f8436f Modifies the interface to add search index metrics and initialises metrics first so it can be used from elasticsearch (#13663) 2020-01-23 17:10:36 +01:00
Shota Gvinepadze
71ceb7f18f [MM-18121] Fix config set panic (#13350)
* Fix config set panic

* Add test

* Fix golint issues

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-23 11:20:36 -04:00
Elisabeth Kulzer
5eabfaac67 Add mm server bin directory (#13738)
* Add server bin directory needed for build process.
2020-01-23 12:34:29 +01:00
Ben Schumacher
58fb80e377 Remove imports from golint blacklist (#13662)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-22 19:42:02 +01:00
Ali Farooq
afd54413f7 MM-21769 - Validate plugin bundle and signature files when pac… (#13629)
* MM-21769 - Validate plugin bundle and signature files when packaging MM

* Renamed public key, using gpg exit code to verify success

* Update Makefile

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>

* Pulling platform specific prepackaged plugins

* Verify platform specific plugin binary exist when building each ARCH

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-01-22 13:39:02 -05:00
Jesús Espino
06fb1458ca Use always strings for cache keys (#13631)
* Use always strings for cache keys

* fixing tests

* Addressing PR review comments

* Adding the base to FormatInt

* Fix typo
2020-01-22 15:59:59 +01:00
Agniva De Sarker
d881b68a38 Set the GOBIN to install go-junit-report in the correct location (#13684)
* Set the GOBIN to install go-junit-report in the correct location

* Add missing \
2020-01-22 20:09:10 +05:30
Agniva De Sarker
adeb7ec8ff Allow GOBIN to be overriden with environment variables (#13671) 2020-01-22 17:46:41 +05:30
Miguel de la Cruz
97969a2904 Avoid taking into account guest accounts flag (#13643) 2020-01-21 17:29:54 +01:00
Ben Schumacher
d496e6a6a6 Bump app version to 5.22 (#13651) 2020-01-21 16:51:21 +01:00
Doug Lauder
173c4abb0d MM-21071 (#13564)
* replace endpoint `POST server_busy/clear` with the more RESTful idiomatic `DELETE server_busy` to clear the busy flag
2020-01-21 16:48:50 +01:00
Hossein Ahmadian-Yazdi
c4ce55f0b7 [MM-21373] Don't send verification (#13637)
* Don't send welcome email if verificaiton is off

* update code to send email but not include verification link

* Update code to not send welcome email if email notifications is off

* update failure clause
2020-01-21 19:44:14 +05:30
Agniva De Sarker
5123fe0292 Remove more instances of GOPATH from Makefile and CI (#13450)
Automatic Merge
2020-01-21 07:49:49 -05:00
Ben Schumacher
f78ba00017 Disable unused linter (#13661) 2020-01-21 13:06:15 +01:00
Ben Schumacher
ca140117d8 Bump GolangCI-Lint to v1.23.0 (#13628) 2020-01-21 09:46:11 +01:00
Eli Yukelzon
04e6911a6b GH-10438 - Rewrite existing plugin API tests to exclusively te… (#13302) 2020-01-21 10:41:28 +02:00
Maria A Nunez
ebfd332161 MM-21374 - Fixed extracting icon for prepackaged and local plugins (#13633)
* Merge upstream

* Added extracting iconData for prepackaged and local plugins

* Fixed tests

* Removed report.xml

Co-authored-by: Jason Paul Deland <9366595+jaydeland@users.noreply.github.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-20 10:34:18 -05:00
Vladimir Lebedev
50e965510a MM-19462 - Migrate tests from "web/oauth_test.go" to use testify (#13525)
* Migrate tests from "web/oauth_test.go" to use testify

* make test cleaner
2020-01-20 15:30:13 +01:00
Jesús Espino
8861d0cb33 MM-20345: Fixing etag problem not reloading all users when needed (#13640)
* MM-20345: Fixing etag problem not reloading all users when needed

* Fixing tests
2020-01-20 15:24:14 +01:00
Martin Kraft
50e9aa01c3 MM-21157: Triggers role sync when a syncable is linked, unlinked, or updated. (#13432)
* MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records.

* MM-20644: Adds SchemeAdmin to mapping of the GroupSyncable struct fields.

* MM-2064: Adds test to ensure SchemeAdmin field value is mapped.

* MM-20644: Adds missing index creation for fresh DBs.

* MM-20644: Duplicates UpdateMembersRole across Team and Channel stores. Adds tests.

* MM-20644: Fixes some old method name references.

* MM-20644: Moves variable declaration; removes Println statement.

* MM-21157: Triggers role sync when a syncable is linked, unlinked, or updated.

* MM-20644: Use a SQL query instead of two to update Team and Channel members.

* MM-20644: Fixes tests; updates query.

* MM-21157: Removes second invocation of function because of refactor that performs it all in a single query.

* MM-21157: Switches a few queries to Squirrel.

* MM-21157: SQL-formats some strings.

* MM-21157: Select with list.

* MM-21157: Converts some more sql to squirrel.

* MM-21157: Fix incorrect conflict resolutions.

* MM-21157: Fix incorrect conflict resolutions.

* MM-21157: Adds missing mocks.

* MM-21157: Clears cache upon syncing roles.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-20 09:10:25 -05:00
Andy Librian
3865bc501e golint fix (#13613) 2020-01-20 12:32:20 +01:00
Bolarinwa Balogun
2186af4d13 Convert store/storetest/post_store.go t.Fatal to assert/require (#13608) 2020-01-18 20:53:42 +01:00
Jesse Hallam
6d79484e55 MM-21645: COALESCE(Bots.LastIconUpdate, 0) (#13638)
Handle a potentially `NULL` Bots.LastIconUpdate and `COALESCE` back to `0`. This column has no default, and while v5.20 should never write it as `NULL`, any pre-v5.20 server writing to the new schema will. As a result, this change ensures backwards compatibility.

Fixes: https://mattermost.atlassian.net/browse/MM-21645
Fixes: https://mattermost.atlassian.net/browse/MM-21585
2020-01-17 17:16:18 -04:00
Shobhit Gupta
7d99d8fba7 Add IsValid method to *Manifest struct (#13609) 2020-01-17 21:08:55 +01:00
Scott Bishel
b71a6b9f8d MM-21725 change to singular (#13634) 2020-01-17 19:22:41 +05:30
Ben Schumacher
3491c3abb2 Respect HomepageURL in manifest for local plugins (#13595)
* Respect HomepageURL in manifest for local plugins

* Add documentation for updating the plugin signatures
2020-01-17 09:09:58 +01:00
Someone
566f28be0a GH-12702 v2: Add new command response parameter: "skip_slack_p… (#13420)
Add new command response parameter: "skip_slack_parsing". Skips Slack magic if set to "true". (#12702)
2020-01-17 08:34:11 +01:00
Jesse Hallam
4314a0427f MM-21328: Fix KVCompareAndSet when new==old (#13612)
`KVCompareAndSet(key, sameValue, sameValue)` can fail spuriously on MySQL if the underlying `UPDATE` requires no actual changes. As per the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/mysql-affected-rows.html), we can't rely on rows affected in this case:

> For UPDATE statements, the affected-rows value by default is the number of rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to mysql_real_connect() when connecting to mysqld, the affected-rows value is the number of rows “found”; that is, matched by the WHERE clause.

It's not tenable to change `CLIENT_FOUND_ROWS` for the all connection, so handle this case in the code instead by running a `SELECT` after the fact. Note that `KVCompareAndSet` has no guarantee of atomicity in this case, but neither would `CompareAndSwap` on which this is method was inspired.

Finally, note that no changes are required for Postgres, which has sane semantics as the default.

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

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-16 15:29:10 -04:00
Maria A Nunez
c21ea5bc06 MM-19445 - Added version information to plugin diagnostics data (#13408)
* MM-19609 - Add new prepackage configuration settings (#13062)

* Add signatures to the prepackaged plugins (#13138)

* MM-19612 - Support querying local plugin marketplace when upst… (#13250)

* MM-19612 - Support querying local plugin marketplace when upstream unavailable or disabled

* Update translations file

* Fixed comment

* Updated to check EnableRemoteMarketplace setting and LocalOnly to get marketplace plugins

* Fixed unit tests

* Tests cleanup code

* Removed unused error message

* Updated tests

* MM-19614- Updated Marketplace Service error id (#13388)

* Added version information to plugin diagnostics data

* [MM-19610] Consume prepackaged plugins (#13005)

* consume prepackaged plugins into memory

* missing i18n

* remove spurious .gitignore changes

* return on failure to install prepackged plugins

* cleanup

* s/plugins/availablePlugins

* whitespace

* don't return extractDir when not needed

* s/plug/plugin

* error on icon, cleanup

* update armored version of testplugin signature

* honour AutomaticPrepackagedPlugins

* document getPrepackagedPlugin

* MM-19613 - Include prepackaged plugins in marketplace results (#13433)

* Added prepackaged plugins to marketplace results

* PR Feedback

* PR Feedback

* Update error where definition

* Removing unnecessary var declaration

* Updated comments

* MM-21263 - Use EnableRemoteMarketplace in marketplace install… (#13438)

* MM-21263 - Use EnableRemoteMarketplace in marketplace install endpoint

* Call updateConfig before calling NewServer in TestHelper

* Added translations

* PR feedback

* Translations

* Feedback

* s/helpers.go/download.go

* Converging env.PrepackagedPlugins

* Initial PR feedback

* Ordered imports properly

* Updated DownloadURL to return slice of bytes

* Fixed method typo

* Fixed logging

* Added read lock for prepackaged plugins list

* PR Feedback

* Added condition to only install prepackaged plugin if it was previously enabled

* Linting

* Updated to check plugin state in config

* Flatten out version number to its own entries. Added webex

* Updated tests

Co-authored-by: Ali Farooq <ali.farooq0@pm.me>
Co-authored-by: Shota Gvinepadze <wineson@gmail.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-01-16 08:46:36 -05:00
Martin Kraft
3d5f36cc4a MM-12773: Return error if ChannelMemberHistory record creation fails. (#13517)
* MM-12773: Fail if creating ChannelMemberHistory record fails.

* MM-12773: Guard against attempting to create duplicate channel member history record.
2020-01-16 17:13:32 +05:30