container-service-extension
container-service-extension copied to clipboard
Add interview command
Add a command which will walk through the configuration asking questions and offering suggestions at each stage.
This is still work-in-progress, it will walk through the interview, but still has some UX issues, and only prints the result YAML to the console.
Unit tests are included, but system tests are not written yet.
Signed-off-by: Glenn McElhoe [email protected]
I've looked over this a few times now and I think the design has been well thought out.
Can you give us an example code flow of the interview noninteractive as well as interactive (walk us through something like interviewing for the vcd config file group). Can you show us how the interview handles all objects it encounters in the stack? - Group, Comment, Question, Confirmation - When/why InteractionContexts and TopLevelContext come into play and what they do/what they're used for - Derived class vs parent class attributes/methods that are used during the interview I think this would be valuable to help our understanding of these object relations and inheritances (especially the multiple inheritance objects)
InteractionContext is confusing to me. I'm understanding it as it's a class that is partly static/global while also partly local to the concrete Group/IndexedGroup that derives from it? basically keeps track of positioning while inside of a group/entire config file? It seems to directs question flow as well as be the hub to retrieve common values independent to any single question's inherent context? Could you explain what InteractionContext's role is/some of its responsibilities/when it's used during the interview process?
I'm also confused what self.skip_function is intended to do/skip, as it's only ever used in Comment class. Question never uses it, but it's explicitly set in the Question constructors.
Few other small things:
I think a few of these names could be made more intuitive: Confirmation -> InterviewConfirmation, since this is a special case question at the end of the interview TopLevelContext -> InterviewContext ??? unsure about this one, but TopLevelContext was confusing for me
We shouldn't use assert
in program code, because it's intended for testing purposes, and any asserts are stripped from the code when python is run with the -O flag