Setting AutomaticPrepackagedPlugins to true was making the test
to download the plugin from the marketplace and initialize it.
While this wasn't wrong in itself but that's not what the test does
and just part of the app initialization and it unnecessarily slowed
down the test by downloading the plugin zip file.
And initializing a plugin from inside a test has some issues
to work properly. While those could be solved, a cleaner way
is to just not download the plugin at all.
https://mattermost.atlassian.net/browse/MM-36947
```release-note
NONE
```
* MM-36894: Racy test: TestExecuteCommandInDirectMessageChannel
We were using the pointer to the same post object
in multiple push notifications because we were sending
it in a loop of mentioned user list.
To fix this, we clone the post every time.
https://mattermost.atlassian.net/browse/MM-36894
```release-note
NONE
```
* Refactor markdown parsing
```release-note
NONE
```
* extend plugin api with sidebar functionalities
* include generated mocks for tests
* bump up version requirements for plugin api
* update tag to 'ChannelSidebar'
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* pre-checkout commit
* add API endpoints for retention policies
* allow deleting multiple teams/channels from a policy in a single request
* pre-checkout commit
* add auditing in API functions
* add permission checks
* update the store layers
* update storetest
* add check constraint on PostDuration column
* pre-checkout commit
* add query to delete posts under the scope of a granular retention policy
* add suggestions from sbishel
* allow clients to specify channels/teams when creating a new policy
* remove foreign keys referencing Channels and Teams tables
* add checks for whether teams and channels exist
* pre-checkout commit
* remove data referencing the Posts table
* pre-checkout commit
* write data store tests
* sort results of buildGetPoliciesQuery
* add missing test cases for teams
* pre-checkout commit
* add Client4 methods for data retention policy endpoints
* add uint and uint64 to app/layer_generators
* make granular policies override global policies
* fix lint errors
* pre-checkout commit
* add license to top of files
* add tests for data store layer
* add missing test cases for store layer
* run make i18n-extract
* add query to delete ChannelMemberHistory
* work in progress
* add test for old reply to old post
* fix lint error
* use COALESCE on each Posts column
* begin implementing orphaned rows worker
* split PR
* pre-checkout commit
* use RetentionPolicyWithTeamAndChannelCounts
* update app and api layers
* run make i18n-extract
* add RetentionPolicy to retrylayer_test.go
* Revert "split PR"
This reverts commit b316f03dd3.
* fix errors caused by revert
* add suggestions from sbishel
* fix copy-paste error
* fix lint errors
* pre-checkout commit
* add function to delete orphaned rows
* use -1 for infinite retention
* remove check constraint
* copy i18n entries from master
* re-run tests with newer enterprise branch
* add team data to channel list
* add search for channels and teams in a policy
* add store tests for channel and team search
* add suggestions from mkraft
* run make einterfaces-mocks
* fix lint errors
* add suggestions from mkraft
* move removeOrphanedRows method to wireup branch
* Revert "move removeOrphanedRows method to wireup branch"
This reverts commit 94605c9b4a.
* use DeleteOrphanedRows where possible
* run make i18n-extract
* use COMPLIANCE permissions
* run make migrations-bindadta
* clean up teams before test
* fix tests for TestRetentionPolicyStore
* add API endpoints for mobile
* fix lint error
* fix some of the lint errors
* move user/data_retention endpoints to data_retention.go
* Revert "fix some of the lint errors"
This reverts commit b5b2dc2756.
* add exclude_policy_constrained parameter for /channels and /teams
* fix lint errors
* add policy_id field to GET endpoints for channels and teams
* use PolicyWithTeamID in RetentionPolicy layer
* fix lint errors
* run make i18n-extract
* update mock call in telemetry_test.go
* return status:OK in JSON instead of 204
* pre-checkout commit
* add policy_id field on channels/teams
* fix lint errors
* use sq.Eq instead of '?'
* use new subsection permissions
* update channels and teams endpoints to use new subsection permissions
* add extra search opts for channels in a policy
* fix lint errors
* allow negative post duration in patch
* remove DELETE FROM query in retention policy tests
* use *int64 for PostDuration
* re-run CI tests
* use 3-step deletion strategy for each table
* fix lint errors
* run make store-layers
* re-run CI tests
* add test with channel, team and global policies
* use common function for SQL queries
* add pagination test
* use struct for args to common SQL function
* fix lint errors
* run make i18n-extract
* check if Channels.TeamId is "" or nil
* use three OR clauses
* write separate genericRetentionPoliciesDeletion function
* add config setting for BatchSize
* add telemetry for BatchSize
* use feature flag
* add old i18n messages back in
* re-run CI tests
* update call signature in storetest
* MM-30831: Adds constant for retention default batch size.
* MM-30831: Removes comment re: optimization.
* MM-30831: Converts days to milliseconds.
* MM-30831: Reverts change to test.
* Revert "MM-30831: Reverts change to test."
This reverts commit 6d14275a1c.
* Revert "MM-30831: Converts days to milliseconds."
This reverts commit a0cb6ec09d.
* MM-30831: Fixes tests.
* MM-30381: Fix for change to method sig.
Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martin@upspin.org>
* MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct.
* MM-34434: Generalized the concept of a license request.
* MM-34434: Verifies JSON field of license instance is set.
* MM-34434: Added missing client param.
* MM-34434: Added some tests of the request trial API endpoint.
* MM-34434: Removed comment.
* fix broken test (#17348)
* Add missing wrapped errors (#17339)
* Improve document extraction and including a document extraction command (#17183)
* Add extract documents content command
* Adding the extraction command and making the pure go pdf library as secondary option
* Improving the memory usage and docextractor interface
* Enable content extraction by default in all the instances
* Tiny improvement on archive indexing
* Adding App interface generation and the opentracing layer
* Fixing linter errors
* Addressing PR review comments
* Addressing PR review comments
* Update en.json (#17356)
Automatic Merge
* adding new feature flag (#17308)
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Bump no_output_timeout to 2 hours (#17358)
* log invalid username (#17345)
Automatic Merge
* MM-34434: Added missing client param.
MM-34434: Added some tests of the request trial API endpoint.
MM-34434: Removed comment.
* MM-34434: Switched to a hard-coded true value.
* MM-34434: Reverts test change.
* MM-34434: Removes unnecessary field.
* MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest.
* MM-34434: Removed accidental commit.
* MM-34434: Removes unnecessary is_trial key from JSON payload.
* MM-34434: Reverts to old pointer receiver variable name.
* MM-34434: Removes test.
* #MM-34437 Initialized license service
* ##MM-34437 Verified at all points if server is trial elligible
* WIp
* #MM-34437 removed unused commented code
* MM-34437 make a log less severe
* #MM-34437 generated einterface mocks
* #MM-34437 added license on new file
* #MM-34437 removed unused translation
* #MM-34437 some refactoring
* Update api4/license.go
* Update api4/license.go
* #MM-34437 made a variable name consistent
* #MM-34437 Added mocks for lince validator
* #M--34437 Added license validator test framework
* #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field
* #M--34437 Allowed sales-sanctioned trials
* #MM-34437 fixed trial license API tests
* Added tests for add license API
* #MM-34437 fixed ValidateLicense test
* #MM-34437 Added util tests
* #MM-34437 using NoError for checking no error
* #MM-34437 using NoError for checking no error
* Added dummy piblic key for testing
* Fixed tests
* #MM-34437 udpaetd trial license URL for testing
* #MM-34437 adjusted times for licences generated through admin portal
* Reverted test-only changes
Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: Amy Blais <amy_blais@hotmail.com>
Co-authored-by: Ben Cooke <benkcooke@gmail.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
This PR builds up on the pass-through DB driver to a fully functioning DB driver implementation via our RPC layer.
To keep things separate from the plugin RPC API, and have the ability to move fast with changes, a separate field Driver is added to MattermostPlugin. Typically the field which is required to be compatible are the API and Helpers. It would be well-documented that Driver is purely for internal use by Mattermost plugins.
A new Driver interface was created which would have a client and server implementation. Every object (connection, statement, etc.) is created and added to a map on the server side. On the client side, the wrapper structs hold the object id, and communicate via the RPC API using this id.
When the server gets the object id, it picks up the appropriate object from its map and performs the operation, and sends back the data.
Some things that need to be handled are errors. Typical error types like pq.Error and mysql.MySQLError are registered with encoding/gob. But for error variables like sql.ErrNoRows, a special integer is encoded with the ErrorString struct. And on the cilent side, the integer is checked, and the appropriate error variable is returned.
Some pending things:
- Context support. This is tricky. Since context.Context is an interface, it's not possible to marshal it. We have to find a way to get the timeout value from the context and pass it.
- RowsColumnScanType(rowsID string, index int) reflect.Type API. Again, reflect.Type is an interface.
- Master/Replica API support.
* Revert "Revert "[MM-8497] Ability to set Do Not Disturb for a specified period of time (#16067)" (#17657)"
This reverts commit ff383990f8.
* add debug log for recurring function
* add feature flag for dnd timed status
* refactoring changes
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Update store function GetThreadForUser to use master DB to fix replica lag
* Refactor GetThreadForUser store func to take membership as argument to prevent replica lag issues and reduce joins in query
* Add translation
* Fix test
* Updates per feedback
* Minor clean-up per feedback
* MM-35030: Hoist GetDBVersion before creating store
The creation of the store included running the migrations
which means that SQL statements would be executed before
we could make the check for DB version.
We perform the DB check before running the migrations.
https://mattermost.atlassian.net/browse/MM-35030
```release-note
NONE
```
* fix lint error
* MM-35538 - display purchase modal when coming from email
* use better name for query param
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
* Added expiry support in custom status APIs (#11)
* Added expiry support in custom status APIs
Added validation for the duration and expiration time in request body
Made enum for the custom status durations
* Fixed the bug in expiry validation with dont clear validation
* Fixed review comments
Converted the durations enum to map
Removed extra if-else
* Added expiry support in custom status slash command (#17)
* Added expiry support in custom status slash command
* Added the check for timezone enabled in expiry time in custom status slash command
* Review fixes
Changed name of calculateExpriryTime to calculateEndOfDay
Made function SetDefaultEmoji for settting default emoji in set custom status API
* Added support for empty duration in custom status APIs
Made one of emoji and text required and duration optional in set custom status API
Made default duration dont clear in both API and slash command
* Changed value of ExpiresAt field in custom status slash command
* Code refactoring
Combined SetDefaults and TrimMessage into 1 function PreSave
Refactored isExpirationTimeValid function
* Used model variables instead of new variables in custom status slash command
* Modified behaviour of set custom status APIs (#19)
Removed dont_clear from validCustomStatusDuration map
Added logic to set duration custom date/time if only expires_at is specified in the body
Made function AreDurationAndExpirationTimeValid in custom status model
* Trigger CI build
* Added logic to detect and set unicode emoji in the custom status slash command
* Replaced strings.split with strings.Fields
* Added logic to handle empty string as message in custom status slash command
* Changed custom status slash command empty message behavior to set def… (#14)
* Changed custom status slash command empty message behavior to set default emoji
* Code refactoring
* Added unit tests and refactored some code
* WIP: Unit tests and refactoring for detecting unicode emoji in custom status slash commands
* Complete unit testing for Get custom status
* Fixed lint
* Added logic for removing skin tone from unicode emoji (#16)
* Added logic for removing skin tone from unicode emoji
Made a reverse system emojis map of string vs []string and stored the emojiNames in sorted order
Added the logic for detecting and replacing/removing skin tone in unicode emoji with variation selector
Added new unit tests with different skin tone emojis
* Refactored removeSkinTone logic to a separate function
* Added check for emoji before removing skin tone in custom status slash command
* Fixed custom status slash command unit test and refactored some code
Chanded the return type of GetEmojiNameFromUnicode from bool to int
Changed the logic for checking presence of emoji without removing skin tone
Fixed the unit tests
* Review fixes: Indentation changes
* MM-35945: handle lots of files in ExtractTarGz
`ExtractTarGz` can fail on archives with a largish number or files, complaining about too many open file handles. Clean up as we go to avoid this.
Fixes: https://mattermost.atlassian.net/browse/MM-35945
* use closure to allow defer