Commit graph

19 commits

Author SHA1 Message Date
Nisheet Sinvhal
f1c52387ae
MM-25779 - Update apiTimerLayerTemplate and hooksTimerLayerTemplate to record error values (#14764)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-12 12:12:37 -04:00
Shota Gvinepadze
77b468e456
[MM-25606] Make plugin API errors encodable (#14692)
* Make plugin API errors encodable

* Remove newlines

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-11 16:44:50 +04:00
Ali Farooq
bd9d674006
Fixing master (#13900)
* updating api_timer_layer_generated.go

* Fixing GetFileInfos

* Fixing TestPluginAPIGetFileInfos

* Remove file.go.orig
2020-02-14 18:08:00 -05:00
Ali Farooq
e4fb5791b0
MM-21626, MM-21627 - Plugin API/Hooks Prometheus instrumentati… (#13825)
* MM-21626,MM-21627 - Plugin API/Hooks Prometheus instrumentation

* Updated einterface mocks

* Fixed supervisor tests

* ignoring golint errors for plugin metrics wrappers

* Making golangci happy

* Using variadic form when generating wrapper code

* Removed artificial delay

* Removed comments from tests

* Renaming plugin wrappers to api/hooks_timer_layer

* updating vendor dir and mod files

* Recording plugin api/hook responses in prometheus

* Updated einterfaces-mocks

* Updating go sum

* Updating go sum

* Fixing conflicts

* More conflicts fixing

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-02-14 15:47:43 -05:00
Eli Yukelzon
17523fa5d9
MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)
* Generate and use an interface instead of *App
2020-02-13 13:26:58 +01:00
Ben Schumacher
5122b9e292
[MM-20723] Add golint for plugin package to golangci (#13090) 2019-12-05 20:31:53 +01:00
İlker Göktuğ Öztürk
0adbfa8478 plugin: fix InstallPlugin() API by manually creating RPC code (#13041)
Flugin: fix InstallPlugin() API by manually creating RPC code

previous implementation of InstallPlugin()-#12232 's RPC funcs wasn't working because `io.Reader` isn't supported by the RPC code generation tool.

RPC does not support streaming data and RPC code generation tool does not handle this exception.

thus, RPC funcs are now implemented manually to stream `io.Reader` through a separate multiplexed connection.
2019-11-29 12:41:17 +01:00
Miguel de la Cruz
2259b7f2a8
[MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
Christopher Speller
428454cee4
Adding interplugin communication. (#12829)
* Adding interplugin communication.

* Naming changes and moving ResponseTransfer to own file.

* Fix.

* Tests and moving to buffering bytes.

* Switching API to passing plugin ID through path rather than a header.

* Review feedback.
2019-11-04 17:35:58 -08:00
Clément Collin
7cc1f19453 [MM-18898] Stringify plugin.Log* parameters (#12700)
- Add stringutils with method that "stringify" object slices
  - "stringify" means convert each object to its string representation
- Move plugin.Log* implementations to client_rpc, use stringify method before calling server method
- Exclude Log* methods from generated RPC methods
- No signature change for plugin.Log* API
- Add test in plugin_api_test to use plugin.Log* methods with RPC
2019-10-30 04:17:04 +01:00
Christopher Speller
c208de7c44
MM-13312 Prevent clobbering of new fields by old plugins. (#10087)
* Prevent clobbering of new fields by old plugins.

* Apply suggestions from code review

Spelling and copy paste error.

Co-Authored-By: crspeller <crspeller@gmail.com>
2019-01-14 09:03:16 -08:00
Jesse Hallam
f2ddef9117 MM-11734: better plugin error handling (#9405)
* MM-11734: encode unregistered error implementations as an ErrorString

* MM-11734: test error string handling

* more idiomatic error handling
2018-09-13 11:31:22 -07:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
Christopher Speller
c8013d4982
Remove accidential dependency (#9203) 2018-08-01 15:38:56 -07:00
Jesse Hallam
1d9c144854 s/mlog/log/ in apiRPCClient (#9171)
We never actually initialized `log` on apiRPCClient, and it can't log
without making an RPC call anyway, so just switch to logging errors from
the plugin to STDERR instead.
2018-07-27 08:17:29 -07:00
Christopher Speller
026f0152a8 Adding FileWillBeUploaded plugin hook (#9169)
* Adding file upload hook.

* Adding hook test for FileWillBeUploaded

* Some debugging fixes.

* Fix typo.

* Fixing double close

* Fix capitalization on docs.
2018-07-27 08:25:53 -04:00
Jesse Hallam
17f211c393
MM-11292: clean up plugins GoDoc (#9109)
* 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
2018-07-13 10:29:50 -04:00
Christopher Speller
83a3ac089c
MM-11029 Adding plugin logging functionality. (#9034)
* Capturing stdout, stderr of plugins in logs.

* Cleanup go-plugin debug logs.

* Adding logging to plugin API

* Generating mocks.

* godoc convention
2018-07-03 09:58:28 -07:00
Christopher Speller
1e5c432e10
MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.

* Tweaks from feedback.
2018-06-25 12:33:13 -07:00