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 tool to handle major version upgrade of release #18188

Closed
tadelesh opened this issue May 19, 2022 · 10 comments · Fixed by #18208 or #18271
Closed

Update tool to handle major version upgrade of release #18188

tadelesh opened this issue May 19, 2022 · 10 comments · Fixed by #18208 or #18271
Assignees
Labels
EngSys This issue is impacting the engineering system. Mgmt This issue is related to a management-plane library.

Comments

@tadelesh
Copy link
Member

Apply go package rule for major version. Need to use v2/v3/... sub-path for the major version upgrade.

@tadelesh tadelesh added the Mgmt This issue is related to a management-plane library. label May 19, 2022
@tadelesh tadelesh self-assigned this May 19, 2022
@jhendrixMSFT
Copy link
Member

We don't need to do this for the source code, just append it to the module's identity in go.mod.

@RickWinter
Copy link
Member

Note, It should be the uncommon case that we do major version updates. If you are expecting this to be the common case we should discuss where and why to see how we can fix the generated code to better handle those cases.

cc: @JeffreyRichter

@RickWinter RickWinter added the EngSys This issue is impacting the engineering system. label May 19, 2022
@jhendrixMSFT
Copy link
Member

The common case is bugs in the swagger where types are just incorrectly defined (should have been int but was marked string). We see these all the time and will necessitate breaking changes.

@tadelesh
Copy link
Member Author

Among 13 preview we need to release, there are 7 have breaking changes. I went through all the changelogs and seems all from swagger breaking (e.g., string to enum, type change, remove operation, param name change). I've already hold the v2 beta release for more careful review.

@jhendrixMSFT
Copy link
Member

A parameter name change shouldn't be considered breaking. Looks like the tool will need to be updated to handle this.

@tadelesh
Copy link
Member Author

@jhendrixMSFT, among these six v2 version PRs breakings (18227-18232), there is a breaking: string change to modelAsString enum. For other SDK, it will not be a breaking. But it seems if we treat it as enum, the breaking is not avoidable in Go. What do you think?

@jhendrixMSFT
Copy link
Member

When you have a single value enum with modelAsString: false it means that the value is considered a constant, and that's how M4 models it. I'm surprised that other languages would model this as an enum as per swagger definition it's not. Can you share a link to an example?

@tadelesh
Copy link
Member Author

tadelesh commented May 25, 2022

When you have a single value enum with modelAsString: false it means that the value is considered a constant, and that's how M4 models it. I'm surprised that other languages would model this as an enum as per swagger definition it's not. Can you share a link to an example?

I mean change from type string to type enum with modelAsString: true.
E.g., for this PR's breaking: KeySource changed from string to enum. The swagger's related PR is here. From the SDK automation result, it seems other SDK has no breaking for such change. It is a little special that this enum only has one value. @ArcturusZhang think, for strongly typed language, it should be a breaking, but none-breaking for other languages. For modelAsString value, I wonder whether it could be defined a string type with a helper function.

@jhendrixMSFT
Copy link
Member

jhendrixMSFT commented May 31, 2022

I took a look at the swagger PR, and it looks to me that the cross-version breaking change didn't flag this. Is this a bug? For a single value enum, changing from modelAsString: false to modelAsString: true is a breaking change.

CC @mikekistler

@tadelesh
Copy link
Member Author

tadelesh commented Jun 2, 2022

Close this task as the tool has already updated. The breaking change issues are discussed in the mail thread.

@tadelesh tadelesh closed this as completed Jun 2, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
EngSys This issue is impacting the engineering system. Mgmt This issue is related to a management-plane library.
Projects
None yet
3 participants