Commit graph

67 commits

Author SHA1 Message Date
Akis Maziotis
762ff9b96c
[chore] migration of plugin-store (#27506)
Plugin store is gradually migrated from:
- https://plugins-store.test.mattermost.com
to
- https://plugins.releases.mattermost.com

We reflect that change here

Note: Currently both CDN's are working as expected, to facilitate the mgiration. Upon succesfull migration, https://plugins-store.test.mattermost.com will be decomissioned
2024-07-03 08:23:43 +03:00
Ben Schumacher
213ebc57fb
Print panic message when mmctl panics (#27390) 2024-07-02 13:58:37 +02:00
Ben Cooke
9187c772b6
[MM-56074] mmctl job commands (#26855)
* add job list and update  job status command to mmctl
2024-06-17 12:07:05 -04:00
Jesse Hallam
cd51dec6e5
Centralize the GetPackagePath (#27004) 2024-05-15 12:05:13 -03:00
Jesse Hallam
630bd40141
Eliminate MM_SERVER_PATH (#24968) 2024-05-10 18:13:05 -03:00
Ben Schumacher
09c39cf3ec
[MM-58020] Improve error message of NotFound errors in store (#26870)
* Improve error message of NotFound errors in store

* update mmctl tests
2024-05-07 15:30:48 +02:00
Ezekiel
b7e830f4a1
Print & Return errors using multierror if an error happens (#26625)
* Print & Return errors using multierror if an error happens

* Group up errors assertion in test

* Remove trailing newspace

* Remove WrappedErrors loop

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-30 22:16:05 +02:00
Ben Schumacher
af031b4d0c
Fix merge error (#26933) 2024-04-30 16:02:28 +02:00
Ezekiel
b6a8965969
Gh 19916 mmctl list deactivated users only (#26646) 2024-04-30 14:49:50 +02:00
Agniva De Sarker
10a59619c7
MM-57997: Fix bypass-upload in HA mode (#26850)
Now we throw an error if the server is in HA. This is
because there is no guarantee that the server where the
request lands has access to the file locally.

https://mattermost.atlassian.net/browse/MM-57997
```release-note
NONE
```
2024-04-30 14:14:45 +05:30
Ben Schumacher
32d93fd469
[MM-57743] Enable errcheck linter (#26723) 2024-04-29 11:23:01 +02:00
Ben Schumacher
30d450c4d8
Cleanup usage of global logger (#26835) 2024-04-24 11:52:33 +02:00
Ben Schumacher
92a6c6517d
[MM-56854] Add shell completion to mmctl user active|deactivate (#26358)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-24 10:14:20 +02:00
Ben Schumacher
3dae305dc7
[MM-56000] Add LDAP job command to mmctl (#25633) 2024-04-22 12:19:53 +02:00
Claudio Costa
446c763fa8
[MM-57500] Streaming support for importing file attachments (#26629)
* Bulk import: stream file attachments uploads

* Add comment with context on buffer size

* Add file name to logs

* Use sha256 to do checksum

* Fix bad merge

* Fix import file

* Update test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-19 15:49:33 -06:00
Julien Tant
ffc08858cf
[MM-54730] Don't use old hardcoded rule for validating imported posts (#25823)
* don't use old hardcoded rule for validating imported posts

* fix http verb in doc

* Use client config

* Handle local mode

* E2E tests

* Enforce default if unable to use real limit

* Unit tests

* Fix tests

* Use model.PostMessageMaxRunesV2 as lower default

* Update direct post message length validation

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: streamer45 <cstcld91@gmail.com>
2024-04-19 11:45:32 -06:00
Ben Schumacher
b56c65ec2d
Simplify page size in mmctl (#26664) 2024-04-10 12:47:06 +02:00
Ezekiel
db2cfe953b
updated modifyTeamsCmdF to return error instead of nil when encounting error (#26606) 2024-04-10 11:02:41 +05:30
Ben Schumacher
1e0de8f559
[MM-57356] Make use of go1.21 features (#26620) 2024-04-04 13:44:03 +02:00
Elton Goh Jun Hao
4bbcfd74ad
[MM-49243] - Use paged requests to request the list of teams (#26278)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-04-04 10:09:15 +02:00
Agniva De Sarker
273d4432b4
MM-57512: Disable content extraction during import (#26619)
https://mattermost.atlassian.net/browse/MM-57512
```release-note
NONE
```
2024-04-03 09:04:33 +05:30
Claudio Costa
4d6602aff0
[MM-57295] Bulk export: add roles and permission schemes (#26523)
* Bulk export: add roles and permission schemes

* Update mmctl docs

* Fix log

* Update mmctl tests

* Update mmctl unit tests

* Refactor to avoid extra calls

* Update translations

* Add test case

* Fix test

* Fix test
2024-03-26 08:43:25 -06:00
Anna Os
00d48b04ed
[GH-21216] Function removeUserFromChannel return error (#26428) 2024-03-25 12:53:22 +01:00
Anna Os
1021e51270
[GH-26382] format command mmctl auth list (#26423) 2024-03-25 09:20:16 +01:00
FutureFoodBanker
46bd4599f0
[MM-47824] fix promoteGuestToUserCmdF to handle the proper errors (#26397)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-22 13:42:37 +01:00
Ben Schumacher
2c2dbba72c
[MM-56853] Add mmctl shell completion for commands (#26214) 2024-03-21 14:50:44 +01:00
Agniva De Sarker
5e851f708b
MM-57245: Bump up Go version to 1.21 (#26512)
* MM-57245: Bump up Go version to 1.21

https://mattermost.atlassian.net/browse/MM-57245
```release-note
NONE
```
2024-03-21 09:12:35 +05:30
Elias Nahum
7e9cd04a8b
Channel Bookmarks (#25449)
* create ChannelBookmarks table

* ChannelBookmark model

* channel bookamrks Store layer

* add GetBookmarksForAllChannelByIdSince

* add channel bookmarks to test store

* Add channel bookmarks to app layer

* remove index for createAt in channel bookmarks migrations

* remove createAt from select channel bookmark query and enable store delete bookmark test

* update reponse of UpdateBookmark

* rename db migration files

* channel bookmarks store update sort order

* channel bookmarks app layer update sort order

* fix lint & tests

* Fix lint and introduce util functions to insert / remove from slice

* remove model etag

* i18n

* defer remove file info after test run

* Fix tests passing the request context

* fix migrations

* fix TestRetry

* Add bookmark permissions (#25560)

* Adds channel bookmarks permissions

* Fix linter

* Remove unnecessary empty lines

* Remove scss change as it's not necessary anymore

* Fix mock store

* Fix mock store and add role entry

* Fix test

* Adds cypress test and update permissions migration to update admin roles

* Adds channel bookmarks roles to default admin roles

* Adds bookmark permissions to default role permissions constant in webapp

* Update mmctl test

* Update permission test after normalising the roles

* fix store tests

* fix app layer tests

* Add new bookmark endpoint (#25624)

* Adds channel bookmarks api scaffold and create endpoint

* Applies review comments to the API docs

* Adds websocket test to create channel bookmark

---------

Co-authored-by: Mattermost Build <build@mattermost.com>

* MM-54426 exclude Channel Bookmarks files from data retention (#25656)

* Augment channel APIs to include bookmarks (#25567)

* update files docs for server 9.4

* Adds update channel bookmark endpoint (#25653)

* Adds update channel bookmark sort order endpoint (#25686)

* Adds update channel bookmark endpoint

* Updates edit app method to return the right deleted bookmark and adds tests

* Adds the update channel bookmark sort order endpoint

* Fix repeated test after merge

* Assign right permissions to each test

* Update store and app layer to return specific errors and add tests

* Adds delete channel bookmark endpoint (#25693)

* Updates edit app method to return the right deleted bookmark and adds tests

* Fix repeated test after merge

* Updates edit app method to return the right deleted bookmark and adds tests

* Adds delete channel bookmark endpoint

* Adds list channel bookmarks endpoint (#25700)

* Add channel moderation to bookmarks (#25716)

* fix migrations index

* fix getChannelsForTeamForUser

* fix getChannelsForTeamForUser

* fix bad merge client4

* fix file api with bookmark permission

* add ChannelBookmarks feature flag

* add missing translations

* Set DB column for type as enum

* use custom type for bookmark query using sqlx

* use transaction when saving bookmark

* return NewErrNotFound instead of Sql.ErrNoRows

* use squirrel for IN query

* add a limit of 1K for records in GetBookmarksForAllChannelByIdSince

* UpdateSortOrder with one single query instead of multiple updates

* fix shadow declaration

* fix channel bookmarks permission string definition in admin console

* fix another shadow declaration

* Fix model conversion

* add SplitSliceInChunks

* remove include bookmarks in channels api

* Cap amount of bookmarks per channel

* add etag back to get channels

* feedback review

* update file info when replacing a bookmark file

* return 501 not implemented when the license is not available

* add detail message when getting channel member on bookmark api

* start audit before permission check on create bookmark api

* use require.Eventuallyf for testing WS events

* remove unnecessary log in app layer

* use require instead of assert to avoid panics

* enforce limit when querying bookmarks since

* prevent to create/update bookmark if file is already attached

* fix lint

* delete file when a bookmark is deleted

* Dot allow to set a fileId and a url at the same time to a bookmark

* fix query to delete a file that belongs to a bookmark

* do not patch the bookmark type

* Server side FeatureFlag check (#26145)

* use ff in server, set ff to false

* turn on FF for unit tests

* defer unset FF for unit tests

* turn ff on for testing

* only allow attaching files that were uploaded for bookmark

* Set feature flag off as default

* fix lint

* update email templates as PR failed

* revert templates

* force the assignment of ID when creating a bookmark

* Fix unit tests

---------

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Caleb Roseland <caleb@calebroseland.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2024-03-12 08:36:05 -06:00
Ezekiel
1c846d8341
[GH-25494] add request context to public methods in bot go (#26408) 2024-03-11 13:24:35 +01:00
Anna
3efcef45ff
[GH-21224] return error in plugin cmd (#26305) 2024-03-05 13:18:30 +01:00
Alejandro García Montoro
fac1245143
Fix "doesn't exists" typo (#26307) 2024-02-27 08:13:12 +05:30
Ibrahim Serdar Acikgoz
7d8a56019b
[MM-56348] system/ping: add new method with options (#26079) 2024-02-20 14:22:28 +01:00
Jesse Hallam
7e419e98ee
do not delete an empty set of preferences (#26172) 2024-02-09 10:59:05 -04:00
Jesse Hallam
ec1c693df9
mmctl: user preferences (#25721)
* add support for get/set/delete user preferences

* make mmctl-docs

* make --category required

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-07 15:34:37 -04:00
Ben Schumacher
d9200ab5e9
Space out plugin list in mmctl (#25986)
* Space out plugin list in mmctl

* Fix test

* Fix test part 2
2024-01-31 13:48:00 +01:00
Agniva De Sarker
d8e11fe292
MM-54264: Unblock TestCheckValidSocket (#26021)
The failure seemed to be due to incorect detection from gotestsum
itself rather than any failure in the test.

I note that from that time onwards, gotestsum has had a new release
and we are using that.

I also ran the test several times with gotestsum and could not
repro this. Let's hope that the new version of gotestsum has fixed
the issue. Otherwise, there isn't much we can do.

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

```release-note
NONE
```
2024-01-24 20:43:01 +05:30
Julien Tant
6f1bbcd8ec
[MM-54770] Add ability to export profile pictures and fix importing them (#25042)
* add ability to export pp and fix import

* remove unused nopSeeker

* remove debug log

* fix shadow vars

* generate a warning instead of an error when unable to export profile picture

* fix merge conflicts

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-15 14:29:45 -07:00
Jesse Hallam
b05093d508
Source available metrics (#24879)
* Expose metrics under a source available license

* do not assume Cluster()

* allow metrics if licensed or dev

* temporary vet override

* simplify BULID_TAGS handling

* auto clean old imports.go

* fix license listener

* e2e test metrics & license semantics

* update from enterprise

* switch back to mattermost-govet/v2@new now

* update metrics from upstream

* Update license_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update license_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e-tests/cypress/tests/integration/channels/enterprise/metrics/license_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e-tests/cypress/tests/integration/channels/enterprise/metrics/license_spec.js

* split up specs

* require/delete license earlier in e2e test

* expanded expect to debug failures

* more logging

* Revert "more logging"

This reverts commit 0bc513fd92.

* e2e: try deleting license first

* update from enterprise

* toggleMetricsOn to work around license delete

* eslint

* ensure admin before deleting license

* update from enterprise

* updates from enterprise

* fix cypress logging

* temp: log at DEBUG for Cypress tests

---------

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-08 10:47:24 -04:00
Matthew Straughn
ebdc964161
Mm 16623 fix all initialism errors in channels/app and channels/api4 dir (#25743)
* updated go mod and sum files

* fixed var-naming errors in channels/app and channels/api4 dir

* Revert "updated go mod and sum files"

This reverts commit 088dd00a84.

* renamed a cost .
2023-12-20 06:46:54 +01:00
Agniva De Sarker
b946dad78d
MM-55987: Bypass uploading to S3 for local mode mmctl import (#25591)
We directly instruct the server to read from the local filesystem
in case the local_mode key is set.

There is now no need to upload the file in --local mode and a warning
is thrown accordingly.

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

```release-note
Now the mmctl bulk import process command in local mode supports processing an import file without actually uploading it to the server. Simply pass the file path to the import file and the server will directly read from it, and pass the --bypass-upload flag. There is no need to use the import upload command. NOTE: all of this is applicable only in local mode.
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-13 09:38:00 +05:30
Ben Schumacher
5b6b425cfc
[MM-56061] Only render where field in model.AppError when it's present (#25648)
* Only render where field in model.AppError when it's present

* Remove trailing comma from permission error
2023-12-11 10:27:51 +01:00
Joram Wilander
e0a36cf60a
mmctl: add listing oauth apps (#25497)
* mmctl: add listing oauth apps

* Fix tests

* Update mmctl docs

* Fix tests

* Update server/cmd/mmctl/commands/oauth.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Update server/cmd/mmctl/commands/oauth.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Add paging

* Update docs

---------

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2023-12-05 12:25:35 -05:00
Ben Schumacher
0a38042d58
[MM-55739] Allow admins to pipe the output of mmctl websocket into JSON parser (#25545) 2023-11-27 12:45:32 +01:00
Carrie Warner (Mattermost)
91a7639c3c
Updated mmctl export create command flag (#25474)
* Updated export create flag

* Update server/cmd/mmctl/docs/mmctl_export_create.rst

* Updated mmctl export create command flags
2023-11-23 08:58:34 -05:00
Ben Schumacher
5e94af1302
[MM-54852] Add mmctl command to download Support Packet (#25419)
* Add mmctl command to download Support Packet

* Simplify file name

* Revert "Simplify file name"

This reverts commit 17084a3350.

* Fix docs
2023-11-21 15:25:01 +01:00
Aldrin
2ff946e79b
chore: remove deprecated "io/ioutil" imports (#25119)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2023-11-16 12:15:30 +01:00
Jesse Hallam
48bf4e9bd8
Fix issue 25390 (#25403) 2023-11-10 21:55:33 -04:00
Catena cyber
04e7b6bc9e
Applies perfsprint linter (#24999)
Replacing usages of fmt.Sprint with faster alternatives

Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
2023-11-03 11:18:18 +01:00
Neto Costa
00108d44bb
[MM-47821]: fix searchUserCmdF to return proper errors (#24700)
* fix: fix searchUserCmdF to return proper errors

* fix: fix broken tests

* fix: fix go-ci issues

* fix: fix more broken tests

* fix: fix wrong function call on error getting user test

* fix: fix e2e test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-25 14:56:12 -04:00
Ben Schumacher
22c9c80cd2
[MM-54929] Revert "Remove unnecessary mmctl enterprise deps (#24395)" (#25063)
* Revert "Remove unnecessary mmctl enterprise deps (#24395)"

This reverts commit 32512d35fb.

* Add comment
2023-10-24 10:51:38 +02:00