mattermost / mattermost-plugin-starter-template

Build scripts and templates for writing Mattermost plugins.
https://developers.mattermost.com/extend/plugins/
Apache License 2.0
133 stars 121 forks source link

Update manifest.go to include entire plugin manifest. #72

Closed jespino closed 4 years ago

jespino commented 4 years ago

Update build/manifest.main.go to dump the entire manifest from plugin.json into server/manifest.go instead of just the two fields listed there now. The declared type can just be model.Manifest from the github.com/mattermost/mattermost-server/model package.

This will enable plugins to reference their own manifests programmatically without having to parse the plugin.json manually.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-20035

ilgooz commented 4 years ago

I'll take this one, thanks!

lieut-data commented 4 years ago

Thanks, @ilgooz!

ilgooz commented 4 years ago

The declared type can just be model.Manifest from the github.com/mattermost/mattermost-server/model package.

@jespino Directly exposing *mode.Manifest in the manifest.go is a breaking change since in the current anonymous struct type, we have an ID with the upper case D and *model.Manifest has an Id with the lower case d.

Should we introduce a breaking change or keep the anonymous struct type by just extending it with the other fields?

jespino commented 4 years ago

@lieut-data ☝️ ?

lieut-data commented 4 years ago

@ilgooz, it’s breaking in that it is, indeed, not drop-in compatible. But since plugins only get these changes when updating from the starter template, it’s fine to break and expect some effort to migrate.

Ideally we document some kind changelog for anyone updating from an older template.