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

feat: import resources from git repo or archive file #628

Draft
wants to merge 22 commits into
base: dev
Choose a base branch
from

Conversation

keithmanville
Copy link
Collaborator

@keithmanville keithmanville commented Aug 21, 2024

@keithmanville keithmanville linked an issue Aug 23, 2024 that may be closed by this pull request
11 tasks
@keithmanville keithmanville force-pushed the workflow-import branch 2 times, most recently from b933b2d to e39cb71 Compare September 23, 2024 19:28
@keithmanville
Copy link
Collaborator Author

Basic import functionality is now working. To test it with the included hello world plugin, go to the /api/v1/workflows/resourceImport endpoint in swagger, then either import via git or upload:

for git, set sourceType to "git" and gitUrl to https://github.com/usnistgov/dioptra#workflow-import

for file upload, first create an archive containing the necessary files (from the root dioptra dir in this branch)

tar -czf plugins.tar.gz -C . plugins examples/hello-world.yaml dioptra.toml

then set sourceType to "upload" and select the archive you created.

The following example illustrates how to configure a collection of resources
including a Plugin, PluginParameterType, and Entrypoint.

.. code:: TOML
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: update commented example in docs to match the example.


groupId = fields.Integer(
attribute="group_id",
# data_key="group",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is a bug in marshmallow swagger docs. When the schema is used as form data, it ignores data_key in the swagger UI.

@keithmanville keithmanville marked this pull request as ready for review October 30, 2024 19:50
f.seek(0)

return f

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should be:

    yield f
    f.close()

@keithmanville keithmanville marked this pull request as draft December 24, 2024 16:29
@keithmanville
Copy link
Collaborator Author

converting back to Draft.

Needs to update the client to support the new workflow. Tests should be updated to use client.

Blocked by #694

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.

Add a workflow for importing a plugin from a git repository or file upload
2 participants