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

validate upgraded models in MigrateCommand #1579

Merged
merged 1 commit into from
May 5, 2023

Conversation

AndrewFossAWS
Copy link
Contributor

@AndrewFossAWS AndrewFossAWS commented Jan 11, 2023

Issue:

The Smithy CLI has a command that allows you to update IDL 1 models to IDL 2 models in place, overwriting the IDL 1 files. However, the resulting IDL 2 model isn't guaranteed to be valid, because no validation is done on the upgraded model within the CLI. The upgrade command needs to be updated to always produce valid IDL 2 models, by building and validating the upgraded model before writing out the files.

Description of changes:
Validate upgraded models before writing out files in MigrateCommand.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AndrewFossAWS AndrewFossAWS requested a review from a team as a code owner January 11, 2023 22:33
Copy link
Contributor

@milesziemer milesziemer left a comment

Choose a reason for hiding this comment

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

Maybe should update the Upgrade1to2Command tests to validate the upgraded models too, to protect against future changes to the internals of the command

@AndrewFossAWS AndrewFossAWS changed the title validate upgraded models in Upgrade1to2Command validate upgraded models in MigrateCommand May 4, 2023
@AndrewFossAWS AndrewFossAWS merged commit 7b89d73 into smithy-lang:main May 5, 2023
@AndrewFossAWS AndrewFossAWS deleted the validate-upgrade branch September 21, 2023 21:46
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.

2 participants