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

Update TS SDK to minimize diffs during no-op round trip #2404

Open
phanimarupaka opened this issue Jul 16, 2021 · 1 comment
Open

Update TS SDK to minimize diffs during no-op round trip #2404

phanimarupaka opened this issue Jul 16, 2021 · 1 comment
Labels
area/fn-sdk Typescript SDK enhancement New feature or request p1 size/M 2 day triaged Issue has been triaged by adding an `area/` label

Comments

@phanimarupaka
Copy link
Contributor

TS sdk currently creates unwanted diffs when we roundtrip resources. Here are the issues

  1. Double quotes and single quotes around strings are not being preserved.
  2. (Augment this list when we find more of such)

https://github.com/GoogleContainerTools/kpt-functions-sdk/blob/master/ts/kpt-functions/src/io.ts#L29

@phanimarupaka phanimarupaka added enhancement New feature or request size/M 2 day p1 area/fn-sdk Typescript SDK triaged Issue has been triaged by adding an `area/` label labels Jul 16, 2021
@phanimarupaka phanimarupaka self-assigned this Jul 16, 2021
@phanimarupaka
Copy link
Contributor Author

phanimarupaka commented Jul 22, 2021

Edit for Point 1: Single quotes are being added to the fields which are ambiguous strings. We want double quotes for them. Quoting option is available in 4.0+ versions(https://github.com/nodeca/js-yaml/tree/4.0.0#dump-object---options-) of js-yaml. However, I am not able to get it working even if I upgrade js-yaml.

@mikebz mikebz changed the title Update TS Sdk to minimize diffs during no-op round trip Update TS SDK to minimize diffs during no-op round trip Jul 22, 2021
@droot droot assigned droot and unassigned droot and phanimarupaka Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/fn-sdk Typescript SDK enhancement New feature or request p1 size/M 2 day triaged Issue has been triaged by adding an `area/` label
Projects
None yet
Development

No branches or pull requests

2 participants