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

81 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
a258fd80b2 Remove remaining references to model.NewXX (#28678)
And we remove the deprecated functions to force uses
only of the new function.
```release-note
NONE
```
2024-10-10 22:15:22 +05:30
Ben Cooke
b3c7ef0b97 [MM-56073] MMCTL delete post command (#27539)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-10-08 16:45:31 +02:00
Ibrahim Serdar Acikgoz
076a3cb0d5 cmd/mmctl/user: attempt to improve migrate-auth documentation (#28330) 2024-10-01 12:46:06 +02:00
Ben Schumacher
d9e47522a0 Remove unnecessary copies of loop variables (#28138) 2024-09-11 16:51:30 +02:00
Ibrahim Serdar Acikgoz
4b3de1861f [MM-59519] preserve DM/GM unread/read state over export and import (#27707) 2024-08-26 17:04:48 +02:00
Matthew Straughn
8ccdca0954 [MM-21473] Review archiveTeamsCmdF function to return an error in case of a failure (#26622)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-08-13 16:49:40 +02:00
Agniva De Sarker
c3ed07e679 OSF: Used model.NewPointer everywhere (#27838)
```release-note
NONE
```
2024-08-06 09:15:00 +05:30
Ben Schumacher
1158e6358c [MM-54593] HA aware Support Packet (#27598) 2024-08-03 16:11:13 +02:00
Scott Bishel
08ed72f060 MM-54502 - Update regex to force first character to be alpha (#24675)
Automatic Merge
2024-07-31 17:27:52 +03:00
Devin Binnie
aa85a13c8f [MM-58492][MM-58523] Fixed some access control bugs around archived channels by replacing the permission check with HasPermissionToReadChannel (#27409)
* [MM-58492][MM-58523] Fixed some access control bugs around archived channels by replacing the permission check with HasPermissionToReadChannel

* Fix lint, add ChannelId to uploads

* Fix MMCTL tests and remove unnecessary check for the error message that doesn't work anyways

* Include channel map for getting flagged posts

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-29 10:05:20 -04:00
Jesse Hallam
9304c404df MM-58756: paginate webhooks list (#27368)
* MM-58756: paginate webhooks list

* show error if webhook list fails
2024-07-17 10:02:07 -03:00
Agniva De Sarker
177389d224 MM-53962: Adding ES8 dependency (#24399)
* Adding ES8 dependency

```release-note
NONE
```


Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-11 13:13:31 +05:30
Ben Schumacher
3513d310af [MM-58003] Allow setting AdvancedLoggingJSON via mmctl (#27388) 2024-07-08 21:20:25 +02:00
Miguel de la Cruz
bc49f348bf Correctly merge plugin configuration on mmctl config patch (#26647)
* Adds a step to the config patch command to merge plugin configurations

* Fix linter

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-07-08 11:54:40 +02:00
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