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

2183 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
ff9e765eaa Include binary parameters in default data source (#19570)
This is to make the default more consistent with
what we have in our cloud production. It should
help in surfacing bugs more quickly.

```release-note
NONE
```
2022-02-18 19:51:57 +05:30
mkraft
7fa6b321ae Custom groups (#18839)
* WIP

* adding initial creategroup endpoint

* fetching by group source

* fixing startup error

* updating create endpoint to take an array of user_ids, this will allow us to create the group with one request

* adding delete group endpoint and appropriate test

* adding source param for getGroups

* adding add members and delete members endpoints

* locking down crud endpoints to only be allowed for custom groups

* user search stuff

* allowing remoteid be null by changing field to pointer

* code cleanup and store level tests

* adding new tests and removing unused endpoint

* resolving conflicts

* Adds authz check for group.

* Adds authz checks to groups APIs.

* Updated create group authz tests.

* Updates delete group tests.

* Tests create group.

* Adds some tests and validations.

* adding new parameter so I can get users not in a group

* Fixed all lint warnings.

* Fix type.

* fixing search users not in group

* Fixes some lint errors.

* Moves entry in JSON array.

* Fixed SQL query.

* Fixes permission migration test.

* Fixes migration test.

* Fixes some group store tests.

* Fix test.

* Fix test.

* Revert lint change.

* Migrated CreateWithUserIds to sqlx.

* Adds tests for GetMember; migrates implementation to sqlx.

* Tests GetNonMemberUsersPage and hanles wrong group id.

* Fixes test.

* Switches GetMaster to GetMasterX.

* Switches GetReplica to GetReplicaX.

* Fixes logic.

* Fixes shadow declaration.

* Adds include_member_count to get group API endpoint.

* Adds filter_has_member param to getGroups.

* Fixes.

* Removes array of group sources.

* fixing error

* Testing reverting CreateWithUserIds back to gorp.

* Added websocket event for CreateGroupWithUserIds.

* Changed a few response status codes. Switched to correct permission.

* Added member count to ws payload for group when updating or creating.

* Adds feature flag checks for custom groups.

* Added middleware function to require license. Added config to disable custom groups.

* Change for function signature change of executePossiblyEmptyQuery.

* Lint fixes.

* Adds telemetry none comment.

* Adds translations.

* Migrated to sqlx.

* Temp. removal of translation.

* Fixed typo.

* Added an intermediary model to query with a field that is now ignored by sqlx on read queries.

* Re-used existing store struct.

* Inludes member count.

* Fix for merge error.'

* Require license for group endpoints.

* Updates translations.

* Fix shadow declaration.

* Renames permissions. Switches to new method to retrieve remoteid.

* Added WS events for upsert and delete member(s).

* Added new store error type ErrUniqueConstraint.

* Added EnableCustonGroups to the client config.

* Sanitized some user records.

* Added parameter to include_total_count for listing groups.

* Added translations.

* adding deleteAt field to getByUsers query

* Revert sanitize.

* Added uniqueness constraint error to UpdateGroup.

* Removed the FutureFeatures flag so that the feature is not enabled on old Enterprise licenses.

* Renamed function.

* Updates authz check for user search related to groups.

* Removed debug statement.

* Removed unused app method.

* Added telemetry for enable_custom_groups.

* Returns early from nil license.

* Updates test.

* Returned early to avoid nesting in (*SqlGroupStore).checkUserExist. Switched to reading from replica in (*SqlGroupStore).GetMember. Handled JSON marshal error in (*Client4).UpsertGroupMembers

* Switched to SanitizeProfile.

* Switched to model.NewInt.

* Switched from status NotImplemented to Forbidden for missing license.

* Removed deactivated users from 'exists' set.

* Revert gotool update.

* Ignored lint error that I think is invalid.

* Added the approprate access tag for disabling custom groups.

* Revert change to response status.

* Fixed refactor mistake.

* Limited the group member WS events to individual users.

* Removed WS event of deleted groups.

* Updated license check for searchUsers endpoint.

* Switched from license feature to license sku.

* Update app/group.go

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* Update app/group.go

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* Remove linter ignore comment.

* Added function to create sku-specific license.

* Fixed typo. Removed comment.

* Fixed for wrong type.

* Added missing param to client. Removed unnecessary props setting. Added test for retrieving groups by source.

* Updated some tests now that we're validating group membership not created for deactivated user.

* Fix for groups endpoint returning all group types by default.

* Changes constant names. Adds migration for all users to manage custom group members.

* Removes requirement for manage_system permission to filter user search by group.

* Added migration mock.

* Removes default permissions from custom_group_user role.

* Fixes migration.

* Fixes emoji migration test.

* fixing issue with member counts

* fixing search issue for deleted members

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.fritz.box>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2022-02-17 12:34:39 -05:00
Nathaniel Allred
459f54ac9d Use case onboarding (#19446)
* Add use case onboarding feature flag
* Add endpoints and storage for whether first admin completed setup
* Add migration for FirstAdminSetupComplete

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2022-02-15 17:46:03 -06:00
Harrison Healey
dde7ce5535 MM-41834 Add EnableClientPerformanceDebugging setting (#19562) 2022-02-15 13:00:46 -05:00
mkraft
627dd650d6 Revert "MM-41211: Adds ability to set SessionLengthSSOInDays to a decimal. (#19396)" (#19563)
This reverts commit 7398451030.
2022-02-15 12:50:56 -05:00
Jesús Espino
2c3e289509 Working on refactoring jobs service (#19205)
* Working on refactoring jobs service

* Making more consistent with the previous existing code

* Remove no longer needed functions

* Making a base PeridicScheduler to use it in most of the schedulers implementations

* Removing accidental complexity from on of the jobs

* Removing accidental complexity from expirynotify

* Fixing compilation from previous commit

* Remove accidental complexity from the export_delete job

* Simplifying the workers by making a reusable worker

* Using simple worker for export_delete job

* Simpliying export process job

* Simpliying extract content job

* Simpliying import delete job

* Simpliying import process job

* Simpliying product noticies job

* Simpliying fix crt channel unreads job (only removing the uneeded register function)

* Simpliying migrations job (only removing the uneeded register function)

* fixup

* Simpliying plugins job (only removing the uneeded register function)

* Simpliying bleve indexing job (only removing the uneeded register function)

* Simpliying resend invitation email job (only removing the uneeded register function)

* Fixing tests

* Simplifying migration tests infrastructure

* Adding missed license to files

* Adding an empty file to imports package to ensure this package exist even without enterprise repo

* Regenerating einterfaces mocks

* Adding missed license to files

* Updating i18n/en.json file

* help fixing enterprise tests compilation

* Adding new DailyScheduler

* Fixing typo and changing the waitTime type for periodic sechduler

* Making the daily scheduler more generic

* Adding comments to clarify not used parameters in interface scheduler interface implementations

* Using merror to handle multiple errors in jobs workers

* Fixing linter errors

* Addressing PR review comments

* Reverting go.tools.mod changes

* Removing the static check for worker type in the model (moving it to the insertion of new jobs

* Moving migrations job to the jobs directory

* Fixing (and improving a bit) tests

* Apply suggestions from code review

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Fixing enterprise tests

* Removing unneeded InitWorkers/InitSchedulers calls

* Fix expirenotify job when error happens

* Fixing govet errors

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-02-14 18:21:18 +01:00
mkraft
7398451030 MM-41211: Adds ability to set SessionLengthSSOInDays to a decimal. (#19396)
* MM-41211: Accepts a decimal for the SSO session length.

* MM-41211: Fixes test and logic error.

* MM-41211: Validates session length is minimum 1 hour.

* MM-41211: Tricking the CI to allow an empty string.

* Fixes a test error and some lint changes.

* Fix error.

* Reverting IDE change.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-02-14 12:06:47 -05:00
Kitae Kim
ff288b488c [GH-19150] Remove strings in all channel types for constants (#19535)
Automatic Merge
2022-02-11 12:04:18 +02:00
Agniva De Sarker
3f52bd197a GraphQL (part 2): Model changes and resolvers (#19486)
This PR adds the necessary resolvers to support
the graphQL front-end. Some additional methods
need to be added to the model structs to support
this. Comments have been made to clarify their purpose.

There is a slight duplication of code in the api layer.
But eventually that's going to go away when we move
away from the REST API entirely.

The schema is in api4/schema.graphqls and gets compiled
into the binary as an asset.

The GraphiQL editor url is at GET /api/v5/graphql.

Everything is behind the feature flag MM_FEATUREFLAGS_GRAPHQL.

```release-note
NONE
```
2022-02-11 12:37:05 +05:30
Ben Cooke
88968f9e17 Growth spike guest accounts (#19437)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* new endpoint to get users that should potentially be guests

* checking authservice to ensure they were an email signup

* adding tests for new endpoint

* fixing translation issue

* permissions for new endpoint

* fixing tests

* fixing when domain array is empty

* fixing when domain array is empty

* removing bots from request

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: mkraft <martinkraft@gmail.com>
2022-02-10 15:36:14 -05:00
Spiros Economakis
7ebe432fd0 prepare for next 6.5.0 (#19502) 2022-02-10 14:43:59 +01:00
Julien Tant
c4dcf116c4 [MM-41408] Remove autotour feature flag (#19495) 2022-02-09 14:05:25 -07:00
Ben Schumacher
6dab9eadf8 [MM-40935] Add OnInstall() plugin hook (#19499) 2022-02-09 20:29:00 +01:00
Agniva De Sarker
2d986ef920 Migrate Channelstore categories to sqlx (#19506)
Remove db:"-" tags from model.Channel as well.

```release-note
NONE
```
2022-02-09 23:09:42 +05:30
Kirill Krotov
440790dad6 [MM-39631] mirgate user store to sqlx (#19403)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-02-09 19:56:16 +05:30
Gabe Jackson
03d059bd2a Skip and warn on emoji import when name conflicts with system emoji (#19516)
This changes import behavior related to emoji imports when the name
conflicts with the name of a system emoji. Previously, the import
would fail, but now a warning is logged and the conflicting emoji
is skipped.
2022-02-08 10:20:34 -05:00
Ben Cooke
09e13360c2 Feature Flag for health of server dashboard (#19454)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* new feature flag for health of server dashboard

* fixing comment

* changing ff name

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-02-03 13:28:22 -05:00
Agniva De Sarker
79d63193ac MM-41184: Remove /config/migrate API endpoint (#19418)
This was introduced to let the functionality happen
via mmctl, but it does not differentiate between
sysadmins vs people having physical access to machines.

Therefore, we remove it and only keep the local endpoint
accessible from mmctl --local.

https://mattermost.atlassian.net/browse/MM-41184

```release-note
The api/v4/config/migrate API endpoint has been removed
in favor of the mmctl --local endpoint. API clients
won't be able to access this endpoint without having
physical access to the server.
```
2022-02-03 14:38:08 +05:30
Ben Schumacher
321b19e3db [MM-41290] Add Endpoint to complete onboarding (#19435) 2022-02-02 19:45:09 +01:00
Agniva De Sarker
a733fb840d GraphQL (part 1): Store layer (#19465)
We add the necessary store methods to use GraphQL

```release-note
NONE
```
2022-02-02 22:44:22 +05:30
Ben Cooke
e09345798e Growth spike: Get latest MM version (#19366)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* new endpoint to fetch the latest release information

* adding unit tests

* fixing tests and adding check for github response

* error translations

* fixing translations

* chaning error log

* changing cache size

* empty strings for translations

* changing size to 1

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-02-02 09:19:47 -05:00
Julien Tant
257ea22dac Merge pull request #19426 from JulienTant/MM-41189/remove-ff-invite-team 2022-02-01 09:18:27 -07:00
Ashish Bhate
ae16f51aea [MM-41351] Set ThreadAutoFollow to false by default (#19441)
Summary
ThreadAutoFollow is now false by default. Won't affect existing systems that have it set to true.

Ticket Link
https://mattermost.atlassian.net/browse/MM-41351
2022-02-01 16:21:04 +05:30
Julien Tant
0db5df4422 Merge pull request #19414 from JulienTant/MM-41188/remove-ff-plus-btn 2022-01-31 10:46:52 -07:00
Agniva De Sarker
6e97d581e4 PostStore: Remove db:"-" tag and some other hacks (#19384)
Before gorp, to use sqlx we had to resort to using
internal structs without the `db:"-"` tag so that
it doesn't interfere with the gorp table generation.

Now that it's gone, we can use the original model structs.

```release-note
NONE
```
2022-01-31 23:08:30 +05:30
Kyriakos Z
8f35243604 Fixes editing and pinning a post (#19425)
PR https://github.com/mattermost/mattermost-server/pull/19404 fixed the
replies on posts by casting StringArray to a string.

This PR fixes editing and pinning a post by casting StringArray, and
StringInterface to a string as well.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-27 14:47:41 +02:00
Julien Tant
fec826ade4 remove invite to team feature flag 2022-01-26 14:44:16 -07:00
Agniva De Sarker
54938694b2 MM-41209: Fix flaky test CreateRecurringTaskFromNextIntervalTime (#19416)
We were noting down the time of execution of a function and
expected that to match with the exact interval that we set.

However, sometimes in very busy CI environments, the goroutine
does not get a chance to be scheduled at the right time for
the interval to match exactly. Sometimes, we see a delay of
1 second.

To account for this, we increase the interval to 3 seconds,
and consider a 1 second buffer for this. If we see lags of
more than a second, then this test becomes useless and we
would need to remove it entirely.

https://mattermost.atlassian.net/browse/MM-41209

```release-note
NONE
```
2022-01-26 15:28:40 +05:30
Kyriakos Z
513a4669cc MM-41066: fixes replies when binary_parameters=yes (#19404)
* MM-41066: fixes replies when binary_parameters=yes

Migrating post_store from gorp to sqlx breaks replies on threads.
Why? Participants is a jsonb field and when binary_parameters is set to
'yes' it is failing to insert because it needs the version (1) to be
prepended to the bytes array ([]byte{0x01}).

The easiest fix on this is to cast to a string when inserting.
There is a drawback though, non utf8 characters would be replaced by the
question mark icon �.

This commit does exactly that, casts StringArray to a string.

* Adds a comment

* Removes unnecessary conversion

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-26 11:36:33 +02:00
Julien Tant
a6b27a15cc remove FF plus button 2022-01-25 19:06:32 -07:00
Kirill Krotov
e2e049e05e [MM-39633] migrate team store to sqlx (#19207)
```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2022-01-25 23:03:47 +05:30
Nathaniel Allred
3172adfce9 Mm 39663 (#19340)
* Add CurrentProductName to invoice
* make quantity a float
2022-01-24 15:43:42 -06:00
Lev
a0e870bed2 Restored ToJSON encoding (sans Integration) for Post APIs (#19279)
* Restored ToJSON encoding sans Integration for Post APIs

* PR feedback + GetPost test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-21 08:25:33 -08:00
Scott Bishel
956e21cfa2 Boards data retention (#19262)
* add Boards to DataRetention, add hook for data retention

* remove replaces

* update hook to remove parameter

* add boards data retention to telemetry

* fix unit test

* update test, update hooks

* update RunDataRetention server version

* put behind a feature flag

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-20 17:46:03 -07:00
Josh Soref
294bd44971 [GH-19267] Spelling comments (#19268)
* spelling: comments

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-20 10:07:27 +05:30
Martin Kraft
c02c3f7f97 MM-40686: Added feature flag for group member dn lookup. (#19289)
* MM-40686: Added feature flag for group member dn lookup.

* MM-40686: Changes feature flag name.
2022-01-19 09:19:23 -05:00
Scott Bishel
5e147dd150 remove BoardsUnfurl feature flag (#19283) 2022-01-17 10:11:01 -07:00
Agniva De Sarker
b37c07ec41 Migrate channel_store to sqlx (#19247)
* Migrate channel_store to sqlx

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/chur9rxkghprg7dz1mcqssj34ic

```release-note
NONE
```
2022-01-14 10:43:54 +05:30
Ibrahim Serdar Acikgoz
f829dba615 Update morph dependency (#19308)
* Update morph dependency to use a newer version

* remove timeout check for migrations statements

* store/sqlstore: reset timeout for mysql while creating db for migrations

* update morph to v0.2.1
2022-01-12 17:24:29 +03:00
Ashish Bhate
a55bd001b4 Revert "[MM-37013] Async job to fix CRT channel unreads (#18340)" (#19319)
This reverts commit 0da249c651.
2022-01-12 18:51:47 +05:30
Allan Guwatudde
664af506a3 [MM-39583] - Intermediary web login page: Workspace Cookies (#19256)
* [MM-39583] - Intermediary web login page: Workspace Cookies

* only cloud

* fix error with license check

* feedback impl

* improvement

* make improvements

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-12 10:31:46 +03:00
Nick Misasi
8ad9a22e77 Add a field to ConfirmPaymentMethodRequest type (#19301)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-11 09:49:29 -05:00
Ibrahim Serdar Acikgoz
240bfb2244 Fix a couple of issues related with morph feature branch (#19302)
* uncomment s3 uploads

* remove unnecessary check from config validation

* remove translation
2022-01-08 13:01:37 +03:00
Ibrahim Serdar Acikgoz
6595b31f23 Replace go-migrate with morph (#19116) 2022-01-08 10:16:07 +02:00
Agniva De Sarker
93a9c6c293 MM-40852: Fix make gen-serialized breakage (#19291)
- Fixed the Makefile command so that it can be run in CI
- Changed to go install to make it compatible with >1.16 versions.
- Removed unnecessary lines in go.tools.mod now that we aren't using that.

```release-note
NONE
```
2022-01-07 20:02:54 +05:30
Ibrahim Serdar Acikgoz
4ce7d993a4 Merge pull request #19263 from mattermost/MM-40778-migration
Remove AcceptedTermsOfServiceId from Users table
2022-01-03 22:16:46 +03:00
Agniva De Sarker
cfcdce9ae7 Migrate post_store to sqlx (#19241)
* Migrate post_store to sqlx

There are several queries which should improve further
if re-written with squirrel. HW tickets will be opened
for those.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/ctnryw9mga7fu9kc16xsap4phuw

```release-note
NONE
```

* Remove struct

```release-note
NONE
```

* fix tests

```release-note
NONE
```
2022-01-03 10:40:16 +05:30
Ibrahim Serdar Acikgoz
aa7eb64ff7 remove AcceptedTermsOfServiceId from users table 2021-12-30 18:32:24 +03:00
Michel Engelen
c198ef6e16 adding a feature flag for inline post editing (#19210) 2021-12-21 08:59:52 +01:00
Ben Schumacher
34c4e543f9 [MM-39999] Increase key length in plugin KV store to 150 (#19002) 2021-12-20 13:13:50 +01:00