Respect HomepageURL in manifest for local plugins (#13595)

* Respect HomepageURL in manifest for local plugins

* Add documentation for updating the plugin signatures
Этот коммит содержится в:
Ben Schumacher
2020-01-17 09:09:58 +01:00
коммит произвёл GitHub
родитель 566f28be0a
Коммит 3491c3abb2
8 изменённых файлов: 43 добавлений и 21 удалений

Просмотреть файл

@@ -604,7 +604,7 @@ func TestGetInstalledMarketplacePlugins(t *testing.T) {
expectedPlugins := append(samplePlugins, &model.MarketplacePlugin{ expectedPlugins := append(samplePlugins, &model.MarketplacePlugin{
BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ BaseMarketplacePlugin: &model.BaseMarketplacePlugin{
HomepageURL: "", HomepageURL: "https://example.com/homepage",
IconData: "", IconData: "",
DownloadURL: "", DownloadURL: "",
Labels: []model.MarketplaceLabel{{ Labels: []model.MarketplaceLabel{{
@@ -739,7 +739,7 @@ func TestSearchGetMarketplacePlugins(t *testing.T) {
plugin1 := &model.MarketplacePlugin{ plugin1 := &model.MarketplacePlugin{
BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ BaseMarketplacePlugin: &model.BaseMarketplacePlugin{
HomepageURL: "", HomepageURL: "https://example.com/homepage",
IconData: "", IconData: "",
DownloadURL: "", DownloadURL: "",
Labels: []model.MarketplaceLabel{{ Labels: []model.MarketplaceLabel{{
@@ -756,7 +756,7 @@ func TestSearchGetMarketplacePlugins(t *testing.T) {
CheckNoError(t, resp) CheckNoError(t, resp)
plugin2 := &model.MarketplacePlugin{ plugin2 := &model.MarketplacePlugin{
BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ BaseMarketplacePlugin: &model.BaseMarketplacePlugin{
HomepageURL: "", HomepageURL: "https://example.com/homepage2",
IconData: "", IconData: "",
DownloadURL: "", DownloadURL: "",
Labels: []model.MarketplaceLabel{{ Labels: []model.MarketplaceLabel{{
@@ -898,7 +898,8 @@ func TestGetLocalPluginInMarketplace(t *testing.T) {
newPlugin := &model.MarketplacePlugin{ newPlugin := &model.MarketplacePlugin{
BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ BaseMarketplacePlugin: &model.BaseMarketplacePlugin{
Manifest: manifest, HomepageURL: "https://example.com/homepage",
Manifest: manifest,
}, },
InstalledVersion: manifest.Version, InstalledVersion: manifest.Version,
} }
@@ -931,7 +932,8 @@ func TestGetLocalPluginInMarketplace(t *testing.T) {
newPlugin := &model.MarketplacePlugin{ newPlugin := &model.MarketplacePlugin{
BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ BaseMarketplacePlugin: &model.BaseMarketplacePlugin{
Manifest: manifest, HomepageURL: "https://example.com/homepage",
Manifest: manifest,
Labels: []model.MarketplaceLabel{{ Labels: []model.MarketplaceLabel{{
Name: "Local", Name: "Local",
Description: "This plugin is not listed in the marketplace", Description: "This plugin is not listed in the marketplace",

Просмотреть файл

@@ -598,8 +598,9 @@ func (a *App) mergeLocalPlugins(remoteMarketplacePlugins map[string]*model.Marke
remoteMarketplacePlugins[plugin.Manifest.Id] = &model.MarketplacePlugin{ remoteMarketplacePlugins[plugin.Manifest.Id] = &model.MarketplacePlugin{
BaseMarketplacePlugin: &model.BaseMarketplacePlugin{ BaseMarketplacePlugin: &model.BaseMarketplacePlugin{
Labels: labels, HomepageURL: plugin.Manifest.HomepageURL,
Manifest: plugin.Manifest, Labels: labels,
Manifest: plugin.Manifest,
}, },
InstalledVersion: plugin.Manifest.Version, InstalledVersion: plugin.Manifest.Version,
} }

Просмотреть файл

@@ -16,3 +16,23 @@ In the text input box in Mattermost, type: `/test url [file-name-in-testing-fold
## Manual Testing ## Manual Testing
It is possible to manually test specific sections of any test, instead of using the /test command. Do this by clicking **Raw** in the header for the file when its open in GitHub, then copy and paste any section into Mattermost to post it. Manual testing only supports sections of 4000 characters or less per post. It is possible to manually test specific sections of any test, instead of using the /test command. Do this by clicking **Raw** in the header for the file when its open in GitHub, then copy and paste any section into Mattermost to post it. Manual testing only supports sections of 4000 characters or less per post.
## Test plugins
There are two test plugins: `testplugin.tar.gz` and `testplugin2.tar.gz`. These are use in some integration tests in the `api4` package. Any changes to the plugin bundles require updating the coresponding signatures.
First, import the public and privat development key:
```
$ gpg --import ./development-public-key.gpg
$ gpg --import ./development-private-key.asc
```
This has to be done only once.
Then update the sigantures:
```
$ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign testplugin.tar.gz
$ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign --armor testplugin.tar.gz
$ gpg -u F3FACE45E0DE642C8BD6A8E64C7C6562C192CC1F --verbose --personal-digest-preferences SHA256 --detach-sign testplugin2.tar.gz
Finally, include the updates bundles and signatures in your commit.

Двоичные данные
tests/testplugin.tar.gz

Двоичный файл не отображается.

Просмотреть файл

@@ -1,15 +1,14 @@
-----BEGIN PGP ARMORED FILE----- -----BEGIN PGP SIGNATURE-----
Comment: Use "gpg --dearmor" for unpacking
iQGzBAABCAAdFiEE8/rOReDeZCyL1qjmTHxlYsGSzB8FAl3vHFQACgkQTHxlYsGS iQGzBAABCAAdFiEE8/rOReDeZCyL1qjmTHxlYsGSzB8FAl4hYxIACgkQTHxlYsGS
zB933gv5AcDL/MW5/fwsLnhWW9plSCbRTMOckt94r0ASOKRzPP7ngEzGtkCFEIGQ zB97wwwAqI1gZQsOg6zsKIPCJ6kQ721rG5EaI/eDseRbKnxaFdcoe2+QzqDXE0Ax
bN/T60s9uADuIRHEFhmtZvG2MOg9Z688BxiDpyyTx7ENZH0zzPnULEg5hqf7DJqK P5RhZBKr+5hcS4msxjKPPMAVUZeMrhM7pYFV7y1zSkYQkyk8bcfspL3bVbAT4lXA
Q8IdPSNE4wk4gvJLdrYIYUkQT4TkQonmBbIHvj3wWKaXTheDnUNp90pOiTszKubK x2u2HN6zQqajmX5231hM60ScyIaQXE4aAyruJs4Jw0Cky+NWbXlmo+VVacRxjjp4
ghpAj6ZAlRK60HuMMF7v0RIhqLKYKUGUWvzClKEUZlAKlqTK++FTM0Zot/7KTLDz eAodiF+WNuQb0+72qdrvaP/X6PVi/eKe3uv/fWGOKeQUb7yV8WBOcXbyhA7qHY9F
KEv8gf6xe4oL7vSQBoZDa3Vvcn6tPF0gvwg2DrITT3MG2Rmgpbc74iUXWqoZ+XQp n2utzLXyu34UBKlkUA7T/RQvFFJCzZAoctR3oN0lPOVdRzRIw0T1WqSxRNbnRgW4
zf1P+vxbfbyKMYZ4tERlKfwnl6Dbz5vBvlz/U+ZYBmwuw4wD2DvdrecPHj1KcBNy YPJdKvED7M68HFpdK37SBiMDivseU9I9vOfHRoaQlCK8CYTs1qHPx2hrivj7s5qN
2Auap8qhMQcZvYV7D/qnYL8/QU4roQdg4z+G/S0vQTlK5izpzY+/M8ofZHtjDdWD DStkmzcx1C6OwDt93my3M7WdUHeQ96ryXxFpS9Fj6vYdNTgOE03CW1WIPoNxXJme
cD3w1cvwBFKn9EBJ1HA4/7FEHUzFrh/kWRw2PpUjkydCur2rHqecpRXBqS+Haz7J FHu5o9DNr0bNcsye8TNWqoemmM6NlAEdk239NoODwMwtoTia2eufmfMqkgeH8kR8
OT9k54ab BNCgEYSq
=ywEK =8YEF
-----END PGP ARMORED FILE----- -----END PGP SIGNATURE-----

Двоичные данные
tests/testplugin.tar.gz.sig

Двоичный файл не отображается.

Двоичные данные
tests/testplugin2.tar.gz

Двоичный файл не отображается.

Двоичные данные
tests/testplugin2.tar.gz.sig

Двоичный файл не отображается.