Commit graph

543 commits

Author SHA1 Message Date
Scott Bishel
2f0c1235bb
don't copy 'comment' blocks (#3267)
* don't copy 'comment' blocks

* update tests

* lint fixes
2022-06-22 15:57:27 -06:00
Doug Lauder
39c1d07974
Update 000017_add_file_info.up.sql (#3266)
Make CREATE TABLE idempotent.
2022-06-22 12:51:06 -04:00
Scott Bishel
34e7f88f53
add cyclo complexity, update migrate() to use defer (#3257) 2022-06-21 09:12:55 -06:00
Scott Bishel
3e9219ab0f
GH-3050 - Fix deleting empty property (#3249)
* remove check for blocks on patch, a delete may not have blocks

* remove no longer necessary tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-20 14:16:02 -06:00
Harshil Sharma
ed79026578
Fix failure to upgrade from 7.0 to 7.2 (#3240)
* WIP

* Removed placeholder migrationa s no longer needed

* Removed placeholder migrationa s no longer needed
2022-06-16 12:55:48 +02:00
Harshil Sharma
6d243e1c0e
Registered personal-server specific APIs only when running as personal server (#3228) 2022-06-16 16:16:35 +05:30
Miguel de la Cruz
fa6de94070
Adds limits implementation to the server (#3213)
* Adds limits implementation to the server

* Add test for deleted boards on active card count
2022-06-15 12:17:44 +02:00
Doug Lauder
e4231198d5
Multi product architecture (#3218)
* skeleton lifecycle

* bare minimum to satisfy mm-server import
2022-06-14 09:00:09 -06:00
Harshil Sharma
f3faf39eaa
Forward-porting fileinfo limits (#3164)
* Updated go version

* Generated mocks

* lint fix

* lint fix

* lint fix

* backported fileinfo limits

* backported fileinfo limits

* added tests

* synced with main

* Server lint fix

* used a better name
2022-06-13 13:35:42 +05:30
Doug Lauder
95d0f37420
Migration fixes (#3196)
* simplify block.board_id population
* only create tables if not existing
* fix migration ordering
* fix min schema versions for code-based migrations
2022-06-08 10:13:56 -04:00
Harshil Sharma
2ab4e95289
Updated go version (#3189)
* Updated go version

* Generated mocks

* lint fix

* lint fix

* lint fix

* Updated gitlab builder image
2022-06-06 10:18:21 +02:00
Jesús Espino
8cefcd8e8c
Allowing subpath in development environment (#3000)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-03 12:10:46 +02:00
Doug Lauder
fa258fe91e
fix postgres SQL for legacyBoardFields (#3111)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-26 18:11:53 -04:00
Chen-I Lim
9eb3bd5487
Fix #3072. Add docs on how to auth to API readme. (#3102) 2022-05-25 09:19:02 -07:00
Harshil Sharma
d6e494ca29
Fixed a bug where migrations didn't run on a clean DB (#3104) 2022-05-24 09:40:34 +02:00
Prakhar Porwal
c6869df914
Added Tests for NewServer() , snapshot matching (#3037)
* Added Tests for NewServer() in webserver.go , snapshot matching

* fixed linting issue

* added test for bad base url and made changes as asked by @jespino

* fixed lint error

Co-authored-by: prakharporwal <prakharporwal@github>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-23 13:16:05 +02:00
Doug Lauder
f874c3dce3
don't redundantly send config chg messages to cluster nodes (#3090)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-19 13:59:04 -06:00
Scott Bishel
8fe007277e remove invalid assigned settings 2022-05-17 14:14:48 -06:00
Scott Bishel
aa29fd8a61
update template, remove view (#3080)
* update template, remove view

* update new template file
2022-05-16 17:04:09 -04:00
Jesús Espino
d3edf2f698
Adding the board default role for public boards (#2884)
* Adding the default role concept in the backend

* Adding the interface part

* Fix golang-ci lint errors

* Adding local permissions tests

* Address PR review comments

* Improving the code a bit

* Another small fix

* Renaming DefaultRole to MinimumRole

* Setting the minimum role at minimum to check the permissions per roles in the integration tests

* Adding the new minimum role behavior

* Fixing some tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-16 10:09:11 -06:00
Doug Lauder
11bd3720f1
Refactor notify init (#3043)
* remove unneeded store interfaces

* - reduce dependencies for notifications service
- notifications service no longer concerned with web socket notifications

gnored, and an empty message aborts the commit.

* use app to add member to board

* remove unneeded API

* remove dependency on app package

* fix webapp jest

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-16 11:53:41 -04:00
Scott Bishel
073ef8af75 update to version 7.2.0 2022-05-11 17:25:46 -06:00
Scott Bishel
5d5147511d update singleUser to return workspace UpdateAt as getMe User createAt 2022-05-11 14:39:51 -06:00
Doug Lauder
554a790e57
standardize env var naming (#3031) 2022-05-05 15:49:34 -04:00
Scott Bishel
31a3ba8e6a
allow duplicating cards/baords if filecopy fails (#3012)
* allow duplicating cards/baords if filecopy fails

* change back to error logs
2022-05-05 09:40:46 -06:00
Doug Lauder
1ff28087f8
GH-2469 Add board-bot to team (#3026)
* add bot to team before any mention or subscription notification
2022-05-04 16:10:26 -04:00
Scott Bishel
24ff8d5d38
update board title when duplicated (#3011) 2022-05-03 12:44:34 -06:00
Scott Bishel
f4541630e7
update for v0.17.0 (#2943) 2022-04-28 14:41:38 -06:00
Miguel de la Cruz
c08ce96076
Remove timeout from MySQL migrations (#2974) 2022-04-28 11:58:17 -06:00
Miguel de la Cruz
ae97d5c314
Move teamless data migration with the rest of data migrations and update teamless boards query (#2942)
* Move teamless data migration with the rest of data migrations

* Fix get board user teams query to work on both Postgres and MySQL
2022-04-27 13:34:02 -06:00
Miguel de la Cruz
dc07df6bc9
Update permissions migration to ensure all boards are either open or private (#2928) 2022-04-27 18:21:26 +02:00
Miguel de la Cruz
74e39fa5bf
Initialise the store with a single user flag and pass it to the migrations (#2906) 2022-04-27 15:11:27 +02:00
Scott Bishel
5efcc4dcac
Implement Boards Data Retention - Take 2 (#2859)
* implement boards data retention

* cleanup logs

* revert removal

* update logger creation
2022-04-25 12:58:08 -06:00
Doug Lauder
8a4672bd23
GH-2890 Copy files when duplicating boards (#2915)
* copy files when duplicating boards

* fix unit tests

* Update server/app/boards.go

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

* Update server/app/boards.go

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

* fix review commit

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-25 10:37:57 -06:00
Miguel de la Cruz
a439d11f66
Handle jsonb fields on postgres with binary_parameters set (#2854)
* Handle jsonb fields on postgres with binary_parameters set

* Finx linter adding dot
2022-04-25 17:43:06 +02:00
Miguel de la Cruz
cda064a83a
Add team access checks (#2862) 2022-04-25 17:39:40 +02:00
Scott Bishel
c765c5ef19
return nothing, not empty object (#2909) 2022-04-25 08:54:14 -06:00
Doug Lauder
cabc15b226
reduce log level when deliverying notifications to users without permission (#2912) 2022-04-22 11:32:15 -06:00
Doug Lauder
ca5f3f65e2
call notification engine when duplicating boards (#2910) 2022-04-22 11:14:12 -06:00
Jesús Espino
f439e3474d
Merging the local_permissions tests and the permissions tests (#2908)
* Moving a lot of local tests permissions into the permissions tests

* Merging all the local permissions tests into the regular permissions tests

* Fixing golangci lint errors
2022-04-22 10:38:36 -06:00
Harshil Sharma
c64b95cf92
Updated update category-board mapping method to not rely on DB returning affected rows (#2840)
* Updated update category-board mapping method to not rely on DB returning affected rows

* Wrapped into transaction
2022-04-20 09:21:53 -06:00
Doug Lauder
936cc820ab
Standardize err not found (#2834)
* cleanup log levels

* Standardize on model.IsErrNotFound instead of the mix of error checking done previously.

* fix merge conflicts

* fix comment typo

* add description to asserts
2022-04-20 11:02:12 -04:00
Doug Lauder
99882bf197
Include plugin unit tests in CI via makefile; fix unit tests (#2848)
* include plugin unit tests in CI via makefile; fix unit tests

* include hello endpoint for unit test and web service up check
2022-04-20 11:01:40 -04:00
Harshil Sharma
183c8157cb
Removed teamID from search API (#2842) 2022-04-19 17:43:40 -06:00
Chen-I Lim
3c7fd72dcf
Local permissions test (#2839)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Add local permissions tests

* local_permissions_test with standard store

* UserID tokens, duplicate check toTeam permissions

* cleanup

* cleanup

* Fix server lint

* Update TestLocalPermissionsRegister
2022-04-19 10:00:52 -07:00
Scott Bishel
74053655b6
Revert "implement data retention for boards (#2588)" (#2843)
This reverts commit 0489de8bd3.
2022-04-19 09:18:31 -06:00
Chen-I Lim
bb7ee3851c
Fix Swagger schema for OnboardingResponse (#2838)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Fix Swagger schema
2022-04-18 22:53:41 -07:00
Harshil Sharma
50930a1cd3
Cross team search (#2829)
* WIP

* Added test

* Added snapshot

* Updated server tests

* Fixed server lint

* Fixed webapp lint

* Updated server tests
2022-04-19 10:27:14 +05:30
Chen-I Lim
958fbd28bf
Add integration tests for createBoard (#2632)
* Add integration tests for createBoard

* Update tests - no board access for nonmembers

* Fix TestCreateBoard

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-18 17:07:54 -04:00
Chen-I Lim
e9e8d64333
Add TestDuplicateBoard (#2832)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Add TestDuplicateBoard
2022-04-18 10:30:14 -07:00
Scott Bishel
0489de8bd3
implement data retention for boards (#2588)
* implement data retention for boards

* fix lint errors

* start of orphans

* add and update tests

* fixes for merge

* fix tests

* fix lint

* reset from testing

* update setting unit test variable

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-18 09:03:42 -06:00
Scott Bishel
21667aa8d0
GH-2808: fix some logging issues with share board. (#2827)
* fix some logging issues

* fix unit test

* more test fixes

* unit test
2022-04-18 08:57:42 -06:00
Doug Lauder
b47e70579b
cleanup log levels (#2824) 2022-04-18 08:21:44 -04:00
Scott Bishel
a2e7deba84
make all duplicated boards private (#2823) 2022-04-15 14:29:33 -06:00
Scott Bishel
5723709605
make board private when created from template (#2821) 2022-04-15 11:27:21 -06:00
Chen-I Lim
154c344077
Fix #2800. Add missing Swagger docs (#2801)
* Fix #2800. Add missing Swagger docs

* Add note that timestamps are  in miliseconds

* Fix merge, update docs.
2022-04-15 10:21:10 -07:00
Scott Bishel
90677ba7b8
GH 2393 Move calculationColumns from board to view (#2762)
* move calculation columns to view

* update tests

* add conversion for column calculations

* remove column_Calculations from boards and boards_history

* updates from testing

* update for sqlite

* fixes from testing

* fix lint, cleanup

* update templates,remove field from boards

* revert bad changes

* update snapshots

* Update server/services/store/sqlstore/migrations/000017_add_teams_and_boards.up.sql

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-14 10:33:57 -06:00
Chen-I Lim
5b423d6647
CI updates: Speed up register / login, minimize Windows tests, and add Mac tests (#2784)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Add CI for macOS

* Lower password hash during unit tests

* Add comment

* Only integration tests on Windows

* Tweak TestCreateRecurringTask timings

* Fix server-test-mini-sqlite
2022-04-13 15:36:20 -07:00
Jesús Espino
bc37e97ae9
Applying migration changes (#2752)
* Applying migration changes

* Fixing linter erros

* Restoring userID

* Updated user id length

* Update server/app/category_boards.go

* Skiped creating categories for boards belonging to DMs

* Handled private group messages as well

* fix sql error for insert_at

* fix timestamp parsing

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-04-13 16:10:53 -06:00
Doug Lauder
89cc947a21
Implement permissions specs for mentions. (#2758)
* Implement permissions specs for mentions.
- public boards: admin, editor, commenter can mention team members and auto-add them to board; guests can mention board members
- private boards:  admin, editor, commenter, guest can mention board members
- viewers cannot mention
2022-04-13 18:09:55 -04:00
Miguel de la Cruz
4c61ae9623
Update focalboard endpoints to v2 namespace (#2781) 2022-04-13 15:24:32 -05:00
Chen-I Lim
8433b9eada
Fix CI: Data tamper attempt (#2782)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Expected update time is right after insert returns
2022-04-13 12:17:30 -07:00
Chen-I Lim
3264902131
Fix #2770: Handle Windows path in import and tests (#2771)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Support Windows in import archive and tests

* Run CI on Windows too

* CI: Windows SQLite only

* Remove npm ci fromn Windows CI
2022-04-13 10:17:04 -07:00
Scott Bishel
3e9ad7b9e1
Merge pull request #2743 from mattermost/category-websocket-broadcast-fix
Broadcasting category changes only to the correct user
2022-04-13 10:07:36 -06:00
Miguel de la Cruz
59b387035f
Remove export archive from plugin header (#2779)
* Remove export archive from plugin header

* Update snapshot
2022-04-13 17:52:11 +02:00
Scott Bishel
4fb14bc653
Merge pull request #2778 from wiggin77/GH-2744_export_with_pound
GH-2744 Fix export with hash sign (#) in block title breaks export to CSV
2022-04-13 09:49:25 -06:00
Scott Bishel
a69a6f65f5
Merge pull request #2774 from mattermost/mysql-5.7-uuid-fix
Avoided using UUID() as function param for MySQL migration
2022-04-13 08:39:54 -06:00
Miguel de la Cruz
9c03838840 Use the correct endpoint for exporting all boards on a team 2022-04-13 15:04:47 +02:00
Harshil Sharma
d744d69b43 Added category change broaadcast to cluster 2022-04-13 15:46:35 +05:30
Harshil Sharma
280e38604f Merge branch 'main' into category-websocket-broadcast-fix 2022-04-13 15:09:49 +05:30
Harshil Sharma
15cac1b066 Avoided using UUID() as function param for MySQL migration 2022-04-13 12:12:50 +05:30
wiggin77
2c75097680 unit test for export board 2022-04-12 23:41:32 -04:00
Spiros Economakis
539aee6a46
Fix configuration for prometheus address (#2763)
The env variable for prometheus address is not respected as it should be set as
viper default config.

Ticket: https://mattermost.atlassian.net/browse/43295
2022-04-12 17:43:29 -04:00
Chen-I Lim
af35a8e2c2
GH 2593: Fix Windows migration (#2767)
* Upgrade npm in build-ubuntu

* npm i -S moment

* Don't upgrade npm

* macos-latest on build-mac

* Update dev-release.yml

* Fix #2593: Fix Windows migration
2022-04-12 12:17:58 -07:00
Miguel de la Cruz
c5f8b7f142
Add coalesce to template version migration (#2764) 2022-04-12 08:47:45 -04:00
Miguel de la Cruz
5f963af701 Use the right single user ID on the WS implementation 2022-04-11 19:16:16 +02:00
Scott Bishel
a19840a76a
Merge pull request #2756 from wiggin77/add_remove_unit_tests
Add unit test for GetAllBlocksForBoard; remove integration test GetSubtree
2022-04-09 08:43:31 -06:00
wiggin77
43662e3a9a Add unit test for GetAllBlocksForBoard; remove integration test GetSubtree 2022-04-08 15:57:37 -04:00
Jesús Espino
f3267e2458
Fixing delete/undelete boards (#2571)
* Fixing delete/undelete boards

* Adding permissions checks for undelete board and undelete block

* Fixing server-lint

* Handling permissions for deleted boards

* Fixing linter errors

* Fixing tests

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

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

* Fixing error message

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-04-08 13:31:28 -04:00
Doug Lauder
30e6bc477d
GH-2745 Don't init default templates when unit testing (#2748)
* Don't warn when  appears in card followed by text that is not a username

* Selectively initalize default templates for unit tests that need them to reduce test times. Reduce log noise.
2022-04-08 13:46:16 +02:00
Doug Lauder
68b623ff29
Don't warn when appears in card followed by text that is not a username (#2747) 2022-04-07 17:39:35 -04:00
Doug Lauder
ff020d85e3
Don't notify non-board members of card changes (#2718)
* Don't notify non-board members of card changes
- include permissions service in notifications backends
- use permissions service to ensure @mentions are to users on team
- use permissions service to ensure subscribers are members of board
2022-04-07 11:42:32 -04:00
Harshil Sharma
2358e3e792 Broadcasting category changes only to the correct user 2022-04-07 15:33:56 +05:30
Jesús Espino
0363357209
Simplifying the categories migration (#2739)
* Simplifying the categories migration

* A bit more of simplification

* Leaving the channel_id there because sqlite doesn't support drop columns

* Update server/services/store/sqlstore/migrations/000018_populate_categories.up.sql

* Update server/services/store/sqlstore/migrations/000019_populate_category_blocks.up.sql

* Update server/services/store/sqlstore/migrations/000018_populate_categories.up.sql

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-04-06 16:15:50 -04:00
Jesús Espino
6fef5f0c92
Avoid possible problem of block history with null in the title (#2721)
* Avoid possible problem of block history with null in the title

* Making title not nullable
2022-04-06 18:55:03 +02:00
Scott Bishel
dc72e3d3bd
Merge pull request #2664 from jespino/issue-2617
Adding file size limit
2022-04-06 10:43:41 -06:00
Scott Bishel
e9ab26a641
Merge pull request #2735 from jespino/removing-unussed-methods
Removing not used code
2022-04-06 10:35:12 -06:00
Scott Bishel
286f7f0663
Merge pull request #2737 from jespino/smallfix
Removing duplicated logic
2022-04-06 10:32:38 -06:00
Jesús Espino
f9f269c21a Removing duplicated logic 2022-04-06 16:58:01 +02:00
Jesús Espino
87e84589ba Fixing cypress tests 2022-04-06 16:22:47 +02:00
Jesús Espino
c3cb4a1491 Fixing tests 2022-04-06 16:04:21 +02:00
João Aldeano
263bd92424
Refactor errorResponse to set the logger to debug if the response cod… (#2719)
* Refactor errorResponse to set the logger to debug if the response code is set to unauthorised. Fixes #2488

* Fix merge conflicts
2022-04-06 07:54:40 -04:00
Jesús Espino
bc52b2f044 Fixing golangci-lint errors 2022-04-06 13:01:45 +02:00
Jesús Espino
af5193bbd0 Removing not used code 2022-04-06 12:57:30 +02:00
Jesús Espino
e2648f516a Making error handling more precise in the server (and fixing tests) 2022-04-06 10:35:26 +02:00
Scott Bishel
140af2e52f
Merge branch 'main' into issue-2617 2022-04-05 11:56:29 -06:00
Jesús Espino
a4ef8ec6bc
Permissions integration tests (#2697)
* Initial permissions review infrastructure

* Adding more tests cases

* Modifying a bit the tests approach and adding more tests

* Adding more tests

* Adding more tests for permissions

* Adding more tests

* Adding more permissions tests

* Adding more tests

* Adding more permission checks

* Adding more permissions tests

* Adding more permission tests

* Adding more tests

* Adding subscriptions tests

* Adding more permissions tests

* Adding tests for read tokens in the files

* Update APIs and fix unit tests

* Fix linter errors

* Auto-assign category id from the database (as expected because is serial/auto_increment integer field)

* Revert "Auto-assign category id from the database (as expected because is serial/auto_increment integer field)"

This reverts commit 5c98fd76a3.

* Fixing Category scheme in postgres and MySQL

* Removing restriction about the channel_id and add it to all the databases

* Moving everything to a new migration

* Fix bad merge (?)

* Update 000021_fix_categories.up.sql

Fix Postgres ALTER COLUMN syntax

* Update 000021_fix_categories.down.sql

Fix Postgres ALTER COLUMN syntax

* Update 000021_fix_categories.up.sql

Remove unnecessary, and unsupported MODIFY COLUMNs for SQLite.

* Update 000021_fix_categories.up.sql

Remove not null from categories.channel_id

* Update 000021_fix_categories.down.sql

Migrate down removing not null from categories.channel_id

* Update 000021_fix_categories.up.sql

Fix drop not null on categories.channel_id

* Update 000021_fix_categories.down.sql

Fix down migration of drop not null from categories.channel_id.

* Restore default notification level to debug

Co-authored-by: Chen-I Lim <chenilim@gmail.com>
Co-authored-by: Chen-I Lim <46905241+chenilim@users.noreply.github.com>
2022-04-05 08:00:04 -07:00
Scott Bishel
0cff6e10b1
Merge pull request #2687 from mattermost/private-onboarding-board
Set type as private for onboarding board
2022-04-04 15:11:16 -06:00
Scott Bishel
3757c19a6d
Merge pull request #2716 from mattermost/gh-2712-fix-templates
GH-2712:Don't check team permission for GlobalTeamID
2022-04-04 09:48:09 -06:00
Jesús Espino
3eb9e469d4 Revert "Removing restriction about the channel_id and add it to all the databases"
This reverts commit b9be81b900.
2022-04-04 17:45:18 +02:00