mattermost / mattermost-plugin-starter-template

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

[MM-57738] Retrieve Id through GetPluginID method in Manifest model #199

Closed willypuzzle closed 2 months ago

willypuzzle commented 3 months ago

Summary

Changed the way plugin ID is retrieved from the manifest. Instead of directly accessing the Id property, now using the GetPluginID() method for better encapsulation and consistency.

Ticket Link

Fixes https://github.com/mattermost/mattermost/issues/26710

Related PR

https://github.com/mattermost/mattermost/pull/27281

mattermost-build commented 3 months ago

Hello @willypuzzle,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

willypuzzle commented 3 months ago

@mickmister sorry, if I bother you but but due that https://github.com/mattermost/mattermost/pull/27281 was merged shouldn't we make start the Ci/CD again? Or I have to commit something?

mattermost-build commented 2 months ago

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!

willypuzzle commented 2 months ago

@mickmister we should merge this PR, it's relative to ne feature for API of the plugin

mickmister commented 2 months ago

Hi @willypuzzle, thanks for pinging on this. There is one remaining issue in CI that needs to be addressed here https://github.com/mattermost/mattermost-plugin-starter-template/actions/runs/9380693770/job/25854231700?pr=199

# github.com/mattermost/mattermost-plugin-starter-template/build/manifest
Error: ./main.go:150:2[8](https://github.com/mattermost/mattermost-plugin-starter-template/actions/runs/9380693770/job/25854231700?pr=199#step:4:10):
manifest.GetPluginID undefined (type *model.Manifest has no field or method GetPluginID)
make: build/bin/manifest: No such file or directory
build/setup.mk:21: *** "Cannot parse id from ".  Stop.
Error: Process completed with exit code 2.

Specifically this line:

manifest.GetPluginID undefined (type *model.Manifest has no field or method GetPluginID)

In order for the plugin project to use this new method, the server dependency needs to be updated in the plugin project.

It's currently using v0.0.14:

https://github.com/mattermost/mattermost-plugin-starter-template/blob/9805832b2f774602bd460d05e6b7d633d00becef/go.mod#L6

The latest is v0.1.4 https://pkg.go.dev/github.com/mattermost/mattermost/server/public?tab=versions, though it doesn't contain your changes yet. We can reference a commit instead of a tag for our dependency version.


Can you try running this command to update the dependency? This is the merge commit from your PR https://github.com/mattermost/mattermost/commit/4acc4796edb2c1ff93e861b4732c1c758ac76371

go get github.com/mattermost/mattermost/server/public@4acc4796edb2c1ff93e861b4732c1c758ac76371

Then you can run make or individual make commands defined here for testing.