Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow for importing a plugin from a git repository or file upload #588

Open
7 of 11 tasks
Tracked by #586
keithmanville opened this issue Aug 8, 2024 · 1 comment · May be fixed by #628
Open
7 of 11 tasks
Tracked by #586

Add a workflow for importing a plugin from a git repository or file upload #588

keithmanville opened this issue Aug 8, 2024 · 1 comment · May be fixed by #628
Assignees
Labels
feature New feature to add to project

Comments

@keithmanville
Copy link
Collaborator

keithmanville commented Aug 8, 2024

We want to support the importing of plugins from external sources. This allows for:

  • External development of plugins
  • Sharing of plugins between deployments
  • Management and automatic registration of Dioptra built-in plugins
  • Automated registration of plugins (instead of manually uploading each file via a client)

This will be implemented as a new workflow in the REST API, /workflows/resourcesImport.

Initially, all imported plugins will have a read-only lock applied. We will consider mechanisms for editing and reconciling changes in the future.

Initially, we will support importing from a archive (.zip, or .tar.gz) file upload or a git repository (no authentication support). We will consider other sources in the future.

A new database table to track import source will be needed. It should include: id, name, source_type, url, hash, and timestamp(s).

Tasks:

  • Design the schemas and endpoint(s) for the resourcesImport workflow in the REST API design doc on google drive
  • Add the design to this issue once finalized
  • Implement the schema(s) and controller(s) for the workflow
  • Add new database table for tracking import source
  • Implement the service layer with a single database commit
  • Write documentation for the structure of an importable plugin

Definition of Done:

  • The contract for the structure of a plugin is documented in the sphinx docs
  • Plugins can be imported from a file upload or git repository via a workflow
  • New integration tests that cover plugin import functionality are implemented
  • All tests pass
  • The feature is merged into dev
@keithmanville keithmanville added feature New feature to add to project blocked Unable to move forward because a dependency has yet to be completed labels Aug 8, 2024
@keithmanville keithmanville self-assigned this Aug 9, 2024
@keithmanville
Copy link
Collaborator Author

A workflow for importing resources from a file or git repo. It will handle the importing of the following resources:

  • Plugin
  • PluginFile
  • PluginParameterType
  • EntryPoint

POST /workflows/resourcesImport
payload:

{
  "groupId": int,  # the group that will own the imported resources
  "sourceType": Enum("upload", "git"),  # the source of the import
  "uri": str | None,  # the uri of the git repository (if sourceType is git)
  "data": bytes | None,  # the uploaded archive file (if sourceType is upload)
  "readOnly": bool,  #  whether imported resources should get a readonly lock
  "resolveNameConflicts", Enun("fail", "overwrite")  # behavior for resolving name conflicts
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature to add to project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant