* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w`
* added goimports lint check to .golangci.yml
* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w` for a corner case
* make app-layers, *-mocks and store-layers for ci check
Co-authored-by: Mahmudul Haque <mahmudulhaque@protonmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-31063: Change constants to use CamelCase
* store package
* change allcaps to camel case (#16615)
* New tools.mod
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* Moving diagnostics into a service
* Fixing golint checks
* Fixing tests
* Renaming from diagnostics to telemetry
* Adding missing files
* Initializing telemetry earlier in the server startup
* Fixing tests
* Adding a log for the telemetryID initialization error
* Addressing PR review comments
* Fixing merge problem
* Removing some extra Diagnostics mentions
* Making tests pass
* [MM-20684] Initial implementation of the Command Autocomplete (#13602)
* Implement Autocomplete Data
* Change CommandName to Trigger
* Fix Autocomplete test
* Make stylistic changes
* Rename a bunch of fields and methods
* Fix variable names, safer type assertions
* [MM-20684] plugin autocomplete implementation (#14259)
* Add an endpoint for command autocomplete suggestions
* Add full Suggestion to the AutocompleteSugestion struct
* Add Dynamic Argument support
* Tidy up things
* Fix missed test case
* Add support of the named arguments
* Update autocomplete API
Fix review issues
Implement dynamic args as a local request
* Fix ineffassign
* Add support of the uppercase letters in arguments
* Add support of the optional arguments
* Remove ineffectual assignment
* Add support for icons (#14489)
* Address couple of nits
* Add comment to IconData
* Add types to all consts
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* store failed timestamps on health check job instead of on registeredPlugin
Update test
* change EnsurePlugin calls
* Make env.SetPluginState private
* Write test for plugin deactivate and PluginStateFailedToStayRunning
* Add license comment
* adjust comments, use time.Since
* Additional PR feedback:
time.Since cleanup
test cleanup
remove duplicate .Store() call
* PR Feedback
- Add test case for reactivating the failed plugin
- Change `crashed` to `healthy` and `hasPluginCrashed` to `isPluginHealthy`
- remove stale timestamps from health check job
* Keep registeredPlugins in env when plugin is deactivated, so the crashed state of a plugin can be persisted.
* PR feedback
* PR feedback from Jesse
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* Document minimum server version required for plugin hooks
* change mins < v5.2 for v5.2
Co-authored-by: Federico Martín Alconada Verzini <fedealconada@gmail.com>
* explicitly assert panic as error log
* Revert "[MM-18150] plugin panic trace should not be lost (#13559)"
This reverts commit 5d928b4f94, while leaving the unit tests intact
and now asserting debug logs instead.
* missing license header
* Transit panic from debug to error
* Parse plugin's StdErr and output panic to the mlog.Error
* Add unit tests
* Change log test
* Remove buffer from logger
* Remove 'panic' string filter
* Change *Buffer to io.Writer
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* constants and options for getting files
* Method to get files with options
* Add i18n strings for en
* Add API methods for getting files with options
* gofmt -s file
* explicitly set create at in tests
* use greater than nanosecond time difference for tests
* use gte instead of gt for getting files by created time
* use created at time as default sort order for getting file infos
* use explicit inline strings instead of format strings
* join tables only when required
* use if as secondary sort, and update tests
* update field docs to reflect previous changes
* make page and perPage get options as required
* add json struct tags to GetFileOptions
* bump minimum server versioni
* remove sorting by username and channelname
* use bool for sort order type
* use FileInfo prefix instead of just File
* clearer comments
* use zero-based page numbering
* test filtering by user and channel
* remove unnecessary whitespace
* use int instead of uint for page and perPage arguments
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* MM-21019 - Fix race in (*Environment).SetPluginState()
- We change from passing pointers to registeredPlugin to passing
the struct by value.
- We also add a mutex to the supervisor struct to protect
from racy data access.
* move the immutability comment to the godoc of the Active method
* Changing mut to lock
Co-authored-by: mattermod <mattermod@users.noreply.github.com>