-
Notifications
You must be signed in to change notification settings - Fork 243
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
feat(versioning): add code fixes for incompatible version errors #5459
feat(versioning): add code fixes for incompatible version errors #5459
Conversation
- add code fixes for most of incompatible version errors - fix inconsistent error message formats - add unit test case - remove redudant codes resolve microsoft#4842
All changed packages have been documented.
|
You can try these changes here
|
A few issues worth mentioning. Fix Parameter VersionsI cannot insert @added(Versions.v2)
model Foo {}
op test(param: Foo): void; Ideally, it should be op test(@added(Version.V2)
param:Foo): void; The reason is that the type of Fix by InsertionIn this PR, I only provide fixes to insert @added(Versions.V3)
@added(Versions.V2) // a better fix is to replace `@added(Versions.V3)`
model Foo {}; @removed(Versions.V2)
@added(Versions.V2) // a better fix is to delete `@removed(Versions.V2)`
model Foo{}; Alternative fixesSome error cases can have other ways to fix. But that requires more context which is not available in the validation logic, unless we do more changes. For example, @added(Versions.v3)
model Foo {}
model Bar {
foo: Foo;
} The error is reported on |
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.
Looks good to me. I think these codefixes may sometimes not do what the user wants, but will be right enough of the time to be valuable to our users who are using versioning but sometimes miss these added/removed decorators where they're needed.
resolve #4842