-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add support for JSON serialization #507
Conversation
wingetcreate doesnt' necessarily need to serialize as JSON. YAML serialization is fine as long as wingetcreate knows how to transform the YAML file-based manifests to the JSON expected by a WinGet source REST endpoint. The same would be true in terms of the upgrade scenario where the package ID and source are REST based. The transformation from JSON to YAML could happen inside wingetcreate. |
I'm not opposed to this, but we should be careful in terms of how we decide which format wingetcreate defaults to and how we do any of the transformations. |
wingetcreate will always default to YAML serialization. That is the default Moreover, submitting anything other than YAML to the main community repository has also been blocked as part of this PR. I'm not opposed to closing this if we don't want this, but there could still be value in this PR. The refactorings made to the Serialization flow here may make it easier for a future REST-source implementation. The target of this PR was not really REST implementations but more of private GitHub repositories that want JSON as their output manifests (as was mentioned in the original feature request) |
No worries :) If @ryfu-msft is good with it, then I am too. |
@mdanish-kh, will take a look at this soon. I want to create a new release for winget-create to support 1.6 manifests first since there are a lot of your new features in there. This will be included in our next 1.7 release. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I have merged microsoft/winget-pkgs-submission-test#4784 so that these tests will pass. We will need to get this in first so that #512 can pull in latest changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really awesome feature :)
Changes
--format
to specify output manifest format (json, yaml etc).--format
arg takes precedence over this value)Validations
Added E2E tests for JSON, and added a bunch of unit tests.
Important
The tests will only pass once changes in microsoft/winget-pkgs-submission-test#4784 are merged since I had to refactor the directory structures as well. For local testing, you can pull the changes in that PR to the master branch of your fork and run the tests locally;
cc @denelon @Trenly from the original issue for any naming/design considerations
Microsoft Reviewers: Open in CodeFlow