Commit graph

16 commits

Author SHA1 Message Date
Jesse Hallam
5956e4d624
Fix PluginHTTPStream request body closing before read (#34434)
* Fix regression in PluginHTTPStream where request body closed prematurely

When WriteHeader was called before reading the request body in inter-plugin
communication, the body would be closed prematurely due to defer r.Body.Close()
executing when the function returned (after starting the response goroutine).

This fix moves defer r.Body.Close() into the goroutine to ensure the request
body remains available until after the response is fully processed.

Added test case TestInterpluginPluginHTTPWithBodyAfterWriteHeader to verify
the fix and prevent future regressions.

* Fix resource leak by closing request body in all PluginHTTPStream error paths

---------

Co-authored-by: Christopher Speller <crspeller@gmail.com>
2025-12-01 08:26:33 -08:00
Christopher Speller
318b12532f
Add streaming support to PluginHTTP API for inter-plugin requests (#34366)
* Add ability to stream requests across the interplugin API

* Lint

* Cleaup error handling

* Lint

* Feedback fixes.

* Some tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-11-05 14:21:13 +00:00
Ben Schumacher
892a7c9c69
Use golangci-lints's build-in modernize linter (#34341)
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Waiting to run
Web App CI / check-types (push) Waiting to run
Web App CI / test (push) Waiting to run
Web App CI / build (push) Waiting to run
2025-11-04 12:09:11 +01:00
Agniva De Sarker
9dd8c056e7
MM-63368: Remove MySQL (#33458)
https://mattermost.atlassian.net/browse/MM-63368

```release-note
Remove MySQL support from the codebase entirely.
```
2025-07-22 20:40:55 +05:30
David Krauser
aaa62a40ae
[MM-64686] Expose audit logging functionality via plugin API (#31204)
This commit exposes audit logging functionality to plugins via the plugin API, allowing plugins to create and log audit records. Additionally, it addresses a gob encoding issue that could cause plugin crashes when audit data contains nil pointers or unregistered types.
2025-06-25 20:37:32 -04:00
Julien Tant
731bd7c414
MM-63285: Add property field methods to plugin API (#31035)
Co-authored-by: Claude <noreply@anthropic.com>
2025-06-10 16:10:28 -07:00
Claudio Costa
7c25de2cff
[MM-63345] Address Go v1.23 incompatibility issues with plugins (#30386)
* Address Go v1.23 incompatibility issues with plugins

* Install multiple Go versions for compatibility tests

* Rename
2025-03-11 17:44:42 +00:00
Agniva De Sarker
9431239b2e
MM-57378: Bump up golangci version (#26535)
https://mattermost.atlassian.net/browse/MM-57378
```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-22 10:23:21 +05:30
Ben Schumacher
e99ded1635
[MM-55480] Update logr to v2.0.21 (#25431) 2023-11-23 10:30:08 +01:00
Claudio Costa
aa3a12f183
[MM-55268] Implement ServeMetrics plugins hook (#24249)
* Implement ServeMetrics plugins hook

* Update error id

* Simplify

* Revert "Simplify"

This reverts commit c9dc5d5eac.

* Add comment and error handler

* Wrap error

* Update translation file

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-17 14:39:06 -06:00
Daniel Espino García
cee4411355
[MM-54495] Fix update post plugin hooks (#24602)
* Fix updatePost props and plugin hooks

* Add more tests

* Minor naming improvement

* Revert props related changes

* Fix test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-10-26 15:15:00 +02:00
Qrypt
a46ad3169c
(feature) New MessagesWillBeConsumed Server Plugin Hook (#23305)
* feature: implemented basic MessageWillBeConsumed hook and applied on GetSinglePost method.

* use hook in get methods

* chore: refactored hook usage and created utils functions to apply hook

* bugfix: single post not updating

* chore: adjusted hook to return post

* chore: reverted some uneeded  changes

* chore: updated hook to accept slice of posts

* bugfix: slice filled with niil values

* chore: MessageWillBeConsumed ranamed to MessagesWillBeConsumed

* Update plugin/hooks.go

Co-authored-by: Jesse Hallam <jesse@thehallams.ca>

* Add feature flag

* Update min version

* update tests to account for feature flag

* fix linting issues

---------

Co-authored-by: Matej Topolovac <>
Co-authored-by: mtopolovac <43346061+mtopolovac@users.noreply.github.com>
Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
Co-authored-by: Kevin Hsieh <kevinh@qrypt.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2023-10-23 11:12:46 -03:00
Ben Schumacher
0d5a8b8841
Add whitespace linter (#24855) 2023-10-11 10:13:36 +02:00
Agniva De Sarker
c249ba4a66
MM-52532: Fix golangci warnings (#23709)
https://mattermost.atlassian.net/browse/MM-52532

- Replace golint with revive
- Add makezero linter
- Fix all the required linter failures

Some issues in enterprise and public modules
are yet to be fixed. We send this to expediate things.
2023-06-13 14:08:36 +05:30
Agniva De Sarker
efaa6264cc
MM-53032: Fix module path after repo rename (#23689)
It was a good decision in hindsight to keep the public module as 0.x
because this would have been a breaking change again.

https://mattermost.atlassian.net/browse/MM-53032
```release-note
Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8.

For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public
```
2023-06-11 10:54:35 +05:30
Jesse Hallam
bb02b35048
Expose public/ API as submodule (#23345)
* model -> public/model

* plugin -> public/plugin

* public/model/utils -> public/utils

* platform/shared/mlog -> public/shared/mlog

* platform/shared/i18n -> public/shared/i18n

* platform/shared/markdown -> public/shared/markdown

* platform/services/timezones -> public/shared/timezones

* channels/einterfaces -> einterfaces

* expose public/ submodule

* go mod tidy

* .github: cache-dependency-path, setup-go-work

* modules-tidy for public/ too

* remove old gomodtidy
2023-05-10 13:07:02 -03:00
Renamed from server/plugin/client_rpc.go (Browse further)