Commit graph

605 commits

Author SHA1 Message Date
Miguel de la Cruz
821e3e1c85
Add mariadb tests and update database migration for compatibility (#3929)
* Add mariadb tests and update database migration for compatibility

* add additional tests for migrating json fields

* remove unnecessary test

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2022-10-20 07:36:13 -06:00
Scott Bishel
cb4e5d9c39
Gh 3942 - fix bug with Boards bot, update link text (#4027)
* fix error when ensuring bot

* update link/unlink board text

* lint fixes
2022-10-19 09:22:55 -06:00
Doug Lauder
14ba1ad0b0
Don't replace newlines with symbol when adding comment or text. (#4035)
* Don't replace newlines with symbol when adding comment or block.
2022-10-19 08:29:28 -04:00
Tobias Oetiker
d586c9351e
make sure users.props contains a hash! (#4029)
* make sure users.props contains a hash!

Partial fix for #4018. This does NOT address the 'dirty' column mentioned in this issue!

* Update server/services/store/sqlstore/migrations/000027_migrate_user_props_to_preferences.up.sql

* Just make sure that props is an object

* add newline back in

* Update 000027_migrate_user_props_to_preferences.up.sql

* Also added the check for sytandalone version query for POstgres

* added explicit cast to JSONB

Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
2022-10-19 13:54:24 +05:30
Scott Bishel
6f0c34ddd1
Gh 3953 remove channel link duplicate (#4011) 2022-10-17 16:45:51 -05:00
Doug Lauder
2b984d45b2
Fix collation and charset after migrations (every run) (#4002)
* fix collation and charset after migrations (every run)
2022-10-14 18:39:25 -04:00
Doug Lauder
0381c624cf
Check-in templates.boardarchive file (#3984)
* add full templates.boardarchive
* no longer need to create templates.boardarchive on every build.
2022-10-11 21:09:52 -04:00
Scott Bishel
eb7601d841
GH-3992 fix for missing templates, error when 'system' not found as user. (#3998) 2022-10-11 14:34:33 -05:00
Mattermost Build
3335ccd364
fix another migration error (#3988) (#3989)
(cherry picked from commit b952291c30)

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2022-10-10 17:24:55 -06:00
Scott Bishel
4b0f69da57
fix migration syntax (#3985) 2022-10-10 16:02:36 -06:00
Harshil Sharma
f5a068e382
Added duplicate data test for user preference (#3968)
* Added handling of duplicate key conflicts

* Added a test

* Add value checks and fix username for the test

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
2022-10-07 16:28:47 +02:00
Harshil Sharma
3af20268bc
Added handling of duplicate key conflicts (#3963) 2022-10-07 07:08:42 -06:00
Scott Bishel
ee2f07c3da
fix adding members to public board by editor (#3954)
* fix adding members to public board by editor

* remove log line

* fix unit tests

* lint fix

* update test
2022-10-06 14:02:15 -06:00
Harshil Sharma
2c27d2626e
Fix bug where workspace era uploaded files won't load on team era codebase (#3907)
* WIP

* Added comment for explaination

* Lint fix

* move file if found in channel directory

* lint fixes

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-05 14:16:03 -06:00
Paul Esch-Laurent
fe010b3b40
Remove synthetic/implicit memberships for guests (#3786)
* fix: no implicit (synthetic) memberships for guest

* fix: only check if guest if no explicit member

* refactor: join() to select() non-guest users

* style: golant lint

* fix: search as guest only returns explicit boards

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-03 18:23:21 -06:00
Scott Bishel
cff39e7140
update to release 7.5.0 (#3890) 2022-10-03 11:55:20 -06:00
Miguel de la Cruz
4e8a3f8232
Preserve old handleServeFile endpoint behavior after refactor (#3892) 2022-10-03 10:45:04 +05:30
Scott Bishel
8f4951dd4a
Fix members (#3875)
* retrieve all team members for specific lists

* retrieve all team members for specific lists

* final fixes

* update to use enum

* unit test fixes

* lint fixes

* fix integration test

* fixup integration test

* fix issues with making board private

* update to make webapp and server enums match

* fix to add member in correct role

* remove unnecessary property, check Open/Private board

* cleanup confirm for non admin

* some final cleanup

* move default to webapp

* only allow greater roles in drop down, change property name to minimumRole

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-30 08:26:41 -06:00
Harshil Sharma
8ded5838a8
removed non-existent field (#3856) 2022-09-16 07:40:38 +02:00
Rajat Dabade
80024851a5
Added single-user check for getUserList (#3801)
* Added single-user check for getUserList

* Added check for length of UserIDs slice

* ErrorResponse arg fix and UserIDs len fix

* Linter fixes

* Error fixes

* Linter and error fix
2022-09-15 16:52:35 -04:00
Miguel de la Cruz
dfa9d8f452
Update user store to return the updated entities after inserting / patching them (#3843) 2022-09-15 13:58:20 +02:00
Miguel de la Cruz
9163e4cd9b
Check on GetBoardsForUserAndTeam if the board result list is incomplete and continue if that's the case (#3842)
* Check on GetBoardsForUserAndTeam if the board result list is incomplete and continue if that's the case

* Remove template filter and correctly check for not founds
2022-09-14 08:59:39 -04:00
Doug Lauder
6f35ed8678
Fix broken main store.getBoardsInTeamByIds (#3840)
* fix broken main GetBoardsForUserAndTeam

* comment unit tests
2022-09-14 11:27:36 +02:00
Scott Bishel
b3a356067c
GH-3797 Update telemetry to send boards count (#3820)
* update telemetry to send boards count

* fix lint

* fix unit test
2022-09-13 14:37:05 -06:00
Miguel de la Cruz
f35ac66232
Update board store to return inserted / patched values without querying the DB after modifying them (#3832)
* Update board store to return inserted / patched values without querying the DB after modifying them

* Remove redundant condition check after error refactoring
2022-09-13 12:43:03 +02:00
Miguel de la Cruz
08c0b7a2fd
Refactor error usage from the store level up and add API helpers (#3792)
* Refactor error usage from the store level up and add API helpers

* Complete API tests

* Fix merge errorResponse calls

* Remove ensure helpers to allow for custom messages on permission errors

* Fix bad import and call

* Remove bad user check on auth that was added as part of the main merge

* Fix empty list test

* Replace deprecated proxy calls to ioutil.ReadAll with io.ReadAll

* Add information to the NotFound errors

* Add context to all remaining errors and address review comments

* Fix linter

* Adapt the new card API endpoints to the error refactor

* Remove almost all customErrorResponse calls

* Add request entity too large to errorResponse and remove customErrorResponse

* Fix linter
2022-09-13 12:18:40 +02:00
Paul Esch-Laurent
15e13fcdac
fix: filter out bots for sharing, @mention-ing, and Person property (#3762)
* fix: filter out bots for sharing and @mention-ing

* feat: add `?exclude_bots` to `getTeamUsers` API

* chore: `make swagger`

* chore: `make generate`

* fix: plugin store test function implementation

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-09 19:56:44 -06:00
Scott Bishel
01eb95a6d2
Update to version 7.4.0 (#3819) 2022-09-09 11:37:03 -05:00
Harshil Sharma
5f4ad80ef0
Read Mattermost s3 timeout value and used a default if not exist (#3817)
* read Mattermost s3 timeout value and used a default if not exist

* Protection from setting 0 or negative timeout
2022-09-09 11:42:55 +02:00
Doug Lauder
4652a15bab
Card APIs (#3760)
* cards apis wip

* create card API

* validate cards when creating

* create card fixes

* patch card wip

* wip

* unit test for createCard; CardPatch2BlockPatch

* unit test for PatchCard

* more APIs

* unit tests for GetCardByID

* register GetCard API

* Set FOCALBOARD_UNIT_TESTING for integration tests

* integration tests for CreateCard

* more integration tests for CreateCard

* integtration tests for PatchCard

* fix integration tests for PatchCard

* integration tests for GetCard

* GetCards API wip

* fix merge conflict

* GetCards API and unit tests

* fix linter issues

* fix flaky unit test for mySQL

* Update server/api/api.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Update server/api/api.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* address review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2022-09-08 13:01:33 +02:00
Miguel de la Cruz
7ebcdf59c2
Add remove templates channel link migration (#3794) 2022-09-07 14:22:06 -06:00
Paul Esch-Laurent
d1346be051
Fix make swagger errors & update version (#3772)
* chore: fix `make swagger` errors

* chore: update Swagger version and re-generate
2022-09-07 08:32:53 -06:00
Scott Bishel
af2727085d
Fix template websocket (#3747)
* fix websockets with templates

* add more unit tests

* add synthetic, update tests

* Update mattermost-plugin/server/manifest.go

* clean up lint, reduce cyclomatic complexity

* update tests that call patchBoard with patch.Type set

* cleanup messages

* cleanup code more readable

* fixes from code review

* fix null check

* remove log lines
2022-09-04 16:51:31 -06:00
Miguel de la Cruz
956675aa07
Fix migration 27 and update boards_migrator_test to support sqlite (#3775)
* Fix migration 27 and update boards_migrator_test to support sqlite

* Adds comments for clarity
2022-09-02 13:39:00 -06:00
Scott Bishel
a6ca2c2011
Merge pull request #3774 from mattermost/mysql-extra-safe
Extra safe MySQL migration
2022-09-02 10:00:22 -06:00
Harshil Sharma
80d2984cf8 Fixed an incorrect case in table name 2022-09-02 11:28:37 +05:30
Miguel de la Cruz
3acd505618
Refactor schema table migration mechanism (#3709)
* Refactor schema table migration mechanism

The old schema table migration code was initializing the migration
engine before changing the migrations table and was mixing queries on
two different database connections (the `s.db` connection and the
migrations `db` connection).

The changes on this commit take care of changing the migrations table
before the morph migration engine is initialized and they use the same
connection for all operations, better isolating the schema table
migration process.

* Update migrate function to take the cluster mutex first thing

* Split migration code and orchestration on different functions

* Wrap custom errors on data migrations

* Rename private migration method

* Update server/services/store/sqlstore/migrate.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-09-01 15:05:11 +02:00
Harshil Sharma
66e8af85a8 Extra safe MySQL migration 2022-09-01 16:15:31 +05:30
Harshil Sharma
12ba9a6382 Extra safe MySQL migration 2022-09-01 16:07:11 +05:30
Scott Bishel
270a110dc1
Merge pull request #3761 from mattermost/mentions-and-guests
Fix @-mentions in boards & for guests
2022-08-31 13:40:32 -06:00
Paul Esch-Laurent
31569c655a
fix: reference Uppercase MM tables (#3756) 2022-08-30 14:32:31 -05:00
Paul Esch-Laurent
9101ef81e2 style: golang linting (shadow declaration) 2022-08-30 12:45:20 -05:00
Paul Esch-Laurent
b7ead8a7e0 fix: handle includePublicBoards 2022-08-30 11:56:24 -05:00
Paul Esch-Laurent
33987d5c5b fix: invalid db query for guests 2022-08-30 11:56:24 -05:00
Doug Lauder
2035337049
getBlocks store API with query options (#3755) 2022-08-30 15:56:41 +02:00
Harshil Sharma
63edf2c987
Props to preferences (#3722)
* Added tab;le creation migration

* WIP

* Finished base impl

* Added MySQL migration

* WIP

* Added personal server store methods

* WIP

* Fixed webapp tests

* Updated server tests

* generated code

* generated code

* generated code

* used raw queries instead of plugin methods to avoid updating productapi package

* Added API doc

* Added sqlite migratins

* used plugin APIs again s=instead of raw queries

* WIP

* Added missed case of SQL migration where personal server can run on Postgres and MySQL

* CI

* Removed unsupported POSL operator

* Low on caffine. Making silly mistakes

* json handling

* int test

* hope tests pass

* Fix incorrect column size

* Webapp lint fixes

* remived debug code

* Updated moigration version

* Review fixes
2022-08-29 12:55:12 +05:30
Scott Bishel
52598b583f
fix sql statement, add 'isGuest' (#3745) 2022-08-25 13:36:39 -05:00
Jesús Espino
61a8af8f34
Restoring guest account access and adding backend part of the guest accounts support (#2929)
Co-authored-by: Paul Esch-Laurent <paul.esch-laurent@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-24 17:08:58 -05:00
Miguel de la Cruz
e1a39e57ff
Adds a check that errors on store start if MariaDB is detected (#3725)
* Adds a check that errors on store start if MariaDB is detected

* Fix linter

* Update error message

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-24 14:36:43 -06:00
Jesús Espino
2b39745f68
Adding the permissions for commenter + viewer roles (#2882)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Paul Esch-Laurent <paul.esch-laurent@mattermost.com>
2022-08-24 15:36:28 -05:00