Allow plugins to specify a ReleaseNotesURL via manifest (#13677)

Этот коммит содержится в:
Ben Schumacher
2020-01-28 19:33:21 +01:00
коммит произвёл GitHub
родитель 5f888bd4fc
Коммит cb49d560ab
11 изменённых файлов: 62 добавлений и 45 удалений

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

@@ -154,6 +154,9 @@ type Manifest struct {
// SupportURL is an optional URL where plugin issues can be reported.
SupportURL string `json:"support_url,omitempty" yaml:"support_url,omitempty"`
// ReleaseNotesURL is an optional URL where a changelog for the release can be found.
ReleaseNotesURL string `json:"release_notes_url,omitempty" yaml:"release_notes_url,omitempty"`
// A relative file path in the bundle that points to the plugins svg icon for use with the Plugin Marketplace.
// This should be relative to the root of your bundle and the location of the manifest file. Bitmap image formats are not supported.
IconPath string `json:"icon_path,omitempty" yaml:"icon_path,omitempty"`
@@ -330,6 +333,10 @@ func (m *Manifest) IsValid() error {
return errors.New("invalid SupportURL")
}
if m.ReleaseNotesURL != "" && !IsValidHttpUrl(m.ReleaseNotesURL) {
return errors.New("invalid SupportURL")
}
_, err := semver.Parse(m.Version)
if err != nil {
return errors.Wrap(err, "failed to parse Version")