Skip to content

refactor(kclshim): decouple Synthesize from stdin/stdout I/O#575

Open
JinghanFu wants to merge 3 commits intomainfrom
jinghanfu/kclshim-decouple-io
Open

refactor(kclshim): decouple Synthesize from stdin/stdout I/O#575
JinghanFu wants to merge 3 commits intomainfrom
jinghanfu/kclshim-decouple-io

Conversation

@JinghanFu
Copy link

Accept structured input parameter and return []client.Object instead of reading from stdin and writing to stdout. Add comprehensive tests with fixture-based KCL synthesizer covering deployment and service account assertions, and error handling for bad synthesizer input.

Accept structured input parameter and return []client.Object instead of
reading from stdin and writing to stdout. Add comprehensive tests with
fixture-based KCL synthesizer covering deployment and service account
assertions, and error handling for bad synthesizer input.
- Refactor kcl_test.go to use table-driven tests with simple if/else assertions
- Remove unused Result and ResultResourceRef schemas from resource_list.k
- Change KCL output type from ResourceList to object list ([any])
Replace field-by-field assertions with JSON string comparison using
normalizeWhitespace helper. Consolidate expectErr/errContains into
a single expectedErrs field and add inline expectedOutput for
success cases. Remove unused unstructured import.
@ruinan-liu
Copy link
Collaborator

Overall looks good, just had some clarifying question regarding the new approach given it looks like breaking. Would you mind letting me know what is the motivation of this change?

Copy link
Collaborator

@ruinan-liu ruinan-liu left a comment

Choose a reason for hiding this comment

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

review

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.

4 participants