Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@smarchone
Copy link
Member

@smarchone smarchone commented Aug 18, 2022

Changes:

  • during plugin installation, server creates a zip file (yaml-plugins.zip) containing all yaml plugins
    and cli downloads the zip from server
  • server : http://{{host}}/plugins
  • client : optimus plugin sync -c optimus.yaml
  • refactor : move plugin logic from cmd to plugin pkg.
  • plugin discovery is static - .plugins (for client and server) fix : backward compatibility in loading yaml plugins #567
  • remove plugins.Dir from server plugin config (to keep it simple)

Implementation Details:

type IPluginManager interface {
	Install(dst string, sources ...string) error
	Archive(name string) error        // by server
	UnArchive(src, dest string) error // by client
}

@coveralls
Copy link

coveralls commented Aug 18, 2022

Pull Request Test Coverage Report for Build 2947776163

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 76.502%

Files with Coverage Reduction New Missed Lines %
ext/notify/pagerduty/pagerdutynotifier.go 2 93.75%
Totals Coverage Status
Change from base Build 2927829150: -0.02%
Covered Lines: 7602
Relevant Lines: 9937

💛 - Coveralls

}

func (p *PluginManager) Install(dst string, sources ...string) error {
// p.preCleanUp(dst) -- TODO: after making plugin discovery static
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

@smarchone smarchone requested a review from sbchaos August 25, 2022 09:20
}

func (s *syncCommand) downloadArchiveFromServer() error {
optimusServerURL := fmt.Sprintf("http://%s/%s", s.clientConfig.Host, "plugins") // will url work ?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbchaos can we rely on this url format ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the host include the scheme ? if we need to support https or ftp path, this will be restrictive.
Just append path plugins to the Host if we can accept it along with scheme.

return nil
}

func SanitizeArchivePath(d, t string) (v string, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using this function outside this module ? if not it should start with lowercase letter

@smarchone smarchone merged commit 5120902 into feat-plugin-yaml Sep 1, 2022
@smarchone smarchone deleted the feat-plugin-sync branch September 1, 2022 16:06
sravankorumilli pushed a commit that referenced this pull request Sep 7, 2022
…s on client side(#452)

* add YamlPlugin

* add yamlMod in models.Plugin

* fix plugin fallback (first bin else yaml)

* add default assets in yaml plugin

* add validations

* add default config

* add sortplugins; dir (.plugins); migratePlugins

* fix: lint, remove yamlpluginrepo

* add DefaultConfig, fix lint, sort plugin multiselect in survey

* add validations, remove defaultconfig

* add job hook from yaml

* add plugin validation (init & model)

* fix lint

* add defaultconfig; log yaml plugin in validation

* refactor pluginMod; make validations strict

* refactor and add tests

* add/fix tests

* fix lint

* add version override in yaml; add review changes

* review changes

* fix rebase

* fix : feedback

* feat : cli syncs yaml plugins from server (#530)

* refactor cmd/plugin

* add client sync feature; refactor plugin manager to plugin pkg

* fix lint; sync&cleanup issue

* make plugin discovery static (both client and server)

* fix : feedback

* fix : feedback

* fix : url formatting for downloading plugins

* fix: remove pluginversion override; --print; and IYamlmod naming

* fix: remove pluginversion override; --print; and IYamlmod naming (#554)

* fix error on sync without project

* minor display fix in cmd

* exit with status 1 on plugin validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync Questions to Optimus users to avoid installation of plugins on the client side.

4 participants