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

Multiple Init Params Support #45

Closed
azriel91 opened this issue Oct 28, 2022 · 0 comments · Fixed by #63
Closed

Multiple Init Params Support #45

azriel91 opened this issue Oct 28, 2022 · 0 comments · Fixed by #63
Assignees

Comments

@azriel91
Copy link
Owner

azriel91 commented Oct 28, 2022

Currently WorkspaceInit, ProfileInit, and FlowInit are single types.

Implementors may wish to take in init parameters that are relevant to different ItemSpecs, and so each init parameter needs to be able to be mapped to multiple different data types and inserted as resources.

Use cases:

  • Parameters from the user during CLI usage -- these should be serialized and stored, and deserialized for subsequent commands.
  • Tests may want to insert params for each item spec -- not necessarily to be serialized, but doesn't hurt if they are.

Options:

  • Store a TypeMap per workspace / profile / flow, then move the resources across to the CmdContextBuilder resources map.

    We need to be able to deserialize parameters from the *_init.yaml files, so taking in arbitrary with_*_init(..) doesn't work.

  • Still take a single type per workspace / profile / flow, but also take a mapper that maps from that init param type to different data types and inserts them into the resources map.

  • Also have with_resource(..) methods in CmdContextBuilder for things that don't need to be serialized/deserialized -- saves people from needing to access Resources after building the context and then insert.

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 a pull request may close this issue.

1 participant