| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* MM-12193: remove auto configuration unmarshalling
Since plugin hook events are called concurrently, there's no way for the plugin framework to coordinate safe access to the automatically unmarshalled configuration fields. Remove this functionality, and update documentation to illustrate a safe way to do this.
* better Fprint example
* fix unit tests
* log when OnConfigurationChange fails through OnActivate
* clarify lifecycle when OnConfigurationChange returns an error
* call SetAPI even if OnConfigurationChange not implemented
|
|
|
|
|
|
|
|
| |
* change MessageWillBePosted nil return semantics
* change FileWillBeUploaded nil return semantics
* use LogDebug to verify plugin inputs vs. the confusing Delete(User|Team)
|
|
|
| |
Tests; gofmt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ensure plugin is always shutdown
Once we call `.client.Client()` the plugin has started, and must be shut
down. `newSupervisor` sometimes returned with an error (and without a
reference to the supervisor), leaving the client running indefinitely.
* Clarify the documentation to explain that plugin hooks will not trigger until `OnActivate` returns successfully, and will stop triggering just before `OnDeactivate` is called.
* test for plugin deadlock
* plugin/environment.go: switch to sync.Map
From: https://golang.org/pkg/sync/#Map
> If a goroutine holds a RWMutex for reading and another goroutine might call Lock, no goroutine should expect to be able to acquire a read lock until the initial read lock is released. In particular, this prohibits recursive read locking. This is to ensure that the lock eventually becomes available; a blocked Lock call excludes new readers from acquiring the lock.
The previous `RWMutex` was not safe given that we effectively acquired read locks recursively (hook -> api -> hook). This worked up until we activated or deactivated plugins, tried to acquire a write lock, and the plugin used the API to effectively trigger another hook.
Switching to sync.Map avoids this by divesting the need to lock at all, avoiding the potential for a recursive lock in the first place.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Adding file upload hook.
* Adding hook test for FileWillBeUploaded
* Some debugging fixes.
* Fix typo.
* Fixing double close
* Fix capitalization on docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* clean up plugins GoDoc:
- eliminate plugin.NewBlankContext() as unnecessary
- export ValidIdRegex as a string vs. the less readable var
- add/update various documentation strings
- hide everything by default, except where used by client plugins or the mattermost-server. The exception to this rule are the `*(Args|Returns)` structs which must be public for go-plugin, but are now prefixed with `Z_` with a warning not to use.
- include a top-level example to get plugin authors started
This is not a breaking change for existing plugins compiled against
plugins-v2.
* remove commented out ServeHTTPResponseWriter
* update examples to match developer docs
* add missing plugin/doc.go license header
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
update api mocks
Generated new hooks
ChannelHasJoinedChannel Implementation
User Left Team/Channel Hook; User Joined Team Hook Implementation
Update RPC Client and Mocks
gofmt
go tests fix
Add Config API Methods
codegne
Add Channel Has Been Created Hook
Fix ChannelHasBeenCreated hook
fix missing context param
fix duplicate hooks; remove redudandcy
|
|
|
|
|
|
|
|
|
|
| |
* Adding blank request context to plugin hooks for future use.
* Rename RequestContext to Context
* Adding context to ServeHTTP and ExecuteCommand
* Fixing import cycle in test.
|
|
|
|
|
|
| |
* Moving plugins to use hashicorp go-plugin.
* Tweaks from feedback.
|
|
|
|
|
|
|
|
| |
(#8791)
* Adding plugin ability to intercept posts before they reach the DB.
* s/envoked/invoked/
|
|
|
|
|
|
|
|
| |
* add plugin slash command support
* remove unused string
* rebase
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* add some plugin docs
* one more comment
* spacing
* example simplification
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tie back-end plugins together
* fix comment typo
* add tests and a bit of polish
* tests and polish
* add test, don't let backend executable paths escape the plugin directory
|
| |
|
|
* begin backend plugin wip
* flesh out rpcplugin. everything done except for minor supervisor stubs
* done with basic plugin infrastructure
* simplify tests
* remove unused test lines
|